Add Chromium-only Blender WebEngine parity work
This commit is contained in:
10
blender-5.2.0/source/blender/makesdna/CMakeLists.txt
Normal file
10
blender-5.2.0/source/blender/makesdna/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# SPDX-FileCopyrightText: 2006 Blender Authors
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
if(WITH_FREESTYLE)
|
||||
add_definitions(-DWITH_FREESTYLE)
|
||||
endif()
|
||||
|
||||
add_subdirectory(intern)
|
||||
add_subdirectory(tests)
|
||||
1433
blender-5.2.0/source/blender/makesdna/DNA_ID.h
Normal file
1433
blender-5.2.0/source/blender/makesdna/DNA_ID.h
Normal file
File diff suppressed because it is too large
Load Diff
191
blender-5.2.0/source/blender/makesdna/DNA_ID_enums.h
Normal file
191
blender-5.2.0/source/blender/makesdna/DNA_ID_enums.h
Normal file
@@ -0,0 +1,191 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* \brief Enumerations for `DNA_ID.h`.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
enum eIconSizes {
|
||||
ICON_SIZE_ICON = 0,
|
||||
ICON_SIZE_PREVIEW = 1,
|
||||
|
||||
NUM_ICON_SIZES,
|
||||
};
|
||||
|
||||
/** #IDProperty.type */
|
||||
enum eIDPropertyType : char {
|
||||
IDP_STRING = 0,
|
||||
IDP_INT = 1,
|
||||
IDP_FLOAT = 2,
|
||||
/** Array containing int, floats, doubles or groups. */
|
||||
IDP_ARRAY = 5,
|
||||
IDP_GROUP = 6,
|
||||
IDP_ID = 7,
|
||||
IDP_DOUBLE = 8,
|
||||
IDP_IDPARRAY = 9,
|
||||
/**
|
||||
* True or false value, backed by an `int8_t` underlying type for arrays. Values are expected to
|
||||
* be 0 or 1.
|
||||
*/
|
||||
IDP_BOOLEAN = 10,
|
||||
};
|
||||
#define IDP_NUMTYPES 11
|
||||
|
||||
/** Used by some IDP utils, keep values in sync with type enum above. */
|
||||
enum eIDPropertyTypeFilter : int {
|
||||
IDP_TYPE_FILTER_STRING = 1 << IDP_STRING,
|
||||
IDP_TYPE_FILTER_INT = 1 << IDP_INT,
|
||||
IDP_TYPE_FILTER_FLOAT = 1 << IDP_FLOAT,
|
||||
IDP_TYPE_FILTER_ARRAY = 1 << IDP_ARRAY,
|
||||
IDP_TYPE_FILTER_GROUP = 1 << IDP_GROUP,
|
||||
IDP_TYPE_FILTER_ID = 1 << IDP_ID,
|
||||
IDP_TYPE_FILTER_DOUBLE = 1 << IDP_DOUBLE,
|
||||
IDP_TYPE_FILTER_IDPARRAY = 1 << IDP_IDPARRAY,
|
||||
IDP_TYPE_FILTER_BOOLEAN = 1 << IDP_BOOLEAN,
|
||||
};
|
||||
ENUM_OPERATORS(eIDPropertyTypeFilter)
|
||||
|
||||
/** #IDProperty.subtype for #IDP_STRING properties. */
|
||||
enum eIDPropertySubType {
|
||||
IDP_STRING_SUB_UTF8 = 0, /* default */
|
||||
IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
|
||||
};
|
||||
|
||||
/** #IDProperty.flag. */
|
||||
enum eIDPropertyFlag : short {
|
||||
/**
|
||||
* This #IDProperty may be library-overridden.
|
||||
* Should only be used/be relevant for custom properties.
|
||||
*/
|
||||
IDP_FLAG_OVERRIDABLE_LIBRARY = 1 << 0,
|
||||
/**
|
||||
* This collection item #IDProperty has been inserted in a local override.
|
||||
* This is used by internal code to distinguish between library-originated items and
|
||||
* local-inserted ones, as many operations are not allowed on the former.
|
||||
*/
|
||||
IDP_FLAG_OVERRIDELIBRARY_LOCAL = 1 << 1,
|
||||
/**
|
||||
* This #IDProperty has a static type, i.e. its #eIDPropertyType cannot be changed by assigning a
|
||||
* new value to it.
|
||||
*
|
||||
* Currently, array length is also considered as fixed (i.e. part of the type) when this flag is
|
||||
* set. This allows to avoid IDProperty storing vectors e.g. to see their length modified.
|
||||
*
|
||||
* \note Currently, all overridable IDProp are also statically typed. IDProps used as storage for
|
||||
* dynamic RNA properties are also always dynamically typed.
|
||||
*
|
||||
* \note Internal flag, user have no direct way to define or edit it.
|
||||
*/
|
||||
IDP_FLAG_STATIC_TYPE = 1 << 4,
|
||||
/**
|
||||
* This means the property is set but RNA will return false when checking
|
||||
* #RNA_property_is_set, currently this is a runtime flag.
|
||||
*/
|
||||
IDP_FLAG_GHOST = 1 << 7,
|
||||
};
|
||||
ENUM_OPERATORS(eIDPropertyFlag)
|
||||
|
||||
/**
|
||||
* #Library.flag
|
||||
*
|
||||
* Some of these flags define a 'virtual' library, which may not be an actual blendfile, store
|
||||
* 'archived' embedded data, etc. IDs contained in these virtual libraries are _not_ managed by
|
||||
* regular linking code.
|
||||
*
|
||||
* Warning: 16 bits only (uint16_t) currently!
|
||||
*/
|
||||
enum LibraryFlag {
|
||||
/** The library is an 'archive' that only contains embedded linked data. */
|
||||
LIBRARY_FLAG_IS_ARCHIVE = 1 << 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines for working with IDs.
|
||||
*
|
||||
* The tags represent types! This is a dirty way of enabling RTTI. The
|
||||
* sig_byte end endian defines aren't really used much.
|
||||
*/
|
||||
/* NOTE: this is endianness-sensitive. */
|
||||
#define MAKE_ID2(c, d) ((d) << 8 | (c))
|
||||
|
||||
/**
|
||||
* ID from database.
|
||||
*
|
||||
* Written to #BHead.code (for file IO)
|
||||
* and the first 2 bytes of #ID.name (for runtime checks, see #GS macro).
|
||||
*
|
||||
* These types should also be available on their corresponding DNA struct.
|
||||
* It must be a static `constexpr` data member so that it can be used in
|
||||
* compile-time expressions and does not take up space in the struct.
|
||||
* This is used by e.g. #BKE_id_new_nomain for improved type safety.
|
||||
*
|
||||
* Update #ID_TYPE_IS_DEPRECATED() when deprecating types.
|
||||
*/
|
||||
enum ID_Type {
|
||||
ID_SCE = MAKE_ID2('S', 'C'), /* Scene */
|
||||
ID_LI = MAKE_ID2('L', 'I'), /* Library */
|
||||
ID_OB = MAKE_ID2('O', 'B'), /* Object */
|
||||
ID_ME = MAKE_ID2('M', 'E'), /* Mesh */
|
||||
ID_CU_LEGACY = MAKE_ID2('C', 'U'), /* Curve. ID_CV should be used in the future (see #95355). */
|
||||
ID_MB = MAKE_ID2('M', 'B'), /* MetaBall */
|
||||
ID_MA = MAKE_ID2('M', 'A'), /* Material */
|
||||
ID_TE = MAKE_ID2('T', 'E'), /* Tex (Texture) */
|
||||
ID_IM = MAKE_ID2('I', 'M'), /* Image */
|
||||
ID_LT = MAKE_ID2('L', 'T'), /* Lattice */
|
||||
ID_LA = MAKE_ID2('L', 'A'), /* Light */
|
||||
ID_CA = MAKE_ID2('C', 'A'), /* Camera */
|
||||
ID_KE = MAKE_ID2('K', 'E'), /* Key (shape key) */
|
||||
ID_WO = MAKE_ID2('W', 'O'), /* World */
|
||||
ID_SCR = MAKE_ID2('S', 'R'), /* bScreen */
|
||||
ID_VF = MAKE_ID2('V', 'F'), /* VFont (Vector Font) */
|
||||
ID_TXT = MAKE_ID2('T', 'X'), /* Text */
|
||||
ID_SPK = MAKE_ID2('S', 'K'), /* Speaker */
|
||||
ID_SO = MAKE_ID2('S', 'O'), /* Sound */
|
||||
ID_GR = MAKE_ID2('G', 'R'), /* Collection */
|
||||
ID_AR = MAKE_ID2('A', 'R'), /* bArmature */
|
||||
ID_AC = MAKE_ID2('A', 'C'), /* bAction */
|
||||
ID_NT = MAKE_ID2('N', 'T'), /* bNodeTree */
|
||||
ID_BR = MAKE_ID2('B', 'R'), /* Brush */
|
||||
ID_PA = MAKE_ID2('P', 'A'), /* ParticleSettings */
|
||||
ID_GD_LEGACY = MAKE_ID2('G', 'D'), /* bGPdata, (legacy Grease Pencil) */
|
||||
ID_WM = MAKE_ID2('W', 'M'), /* wmWindowManager */
|
||||
ID_MC = MAKE_ID2('M', 'C'), /* MovieClip */
|
||||
ID_MSK = MAKE_ID2('M', 'S'), /* Mask */
|
||||
ID_LS = MAKE_ID2('L', 'S'), /* FreestyleLineStyle */
|
||||
ID_PAL = MAKE_ID2('P', 'L'), /* Palette */
|
||||
ID_PC = MAKE_ID2('P', 'C'), /* PaintCurve */
|
||||
ID_CF = MAKE_ID2('C', 'F'), /* CacheFile */
|
||||
ID_WS = MAKE_ID2('W', 'S'), /* WorkSpace */
|
||||
ID_LP = MAKE_ID2('L', 'P'), /* LightProbe */
|
||||
ID_CV = MAKE_ID2('C', 'V'), /* Curves */
|
||||
ID_PT = MAKE_ID2('P', 'T'), /* PointCloud */
|
||||
ID_VO = MAKE_ID2('V', 'O'), /* Volume */
|
||||
ID_GP = MAKE_ID2('G', 'P'), /* Grease Pencil */
|
||||
};
|
||||
|
||||
/* Only used as 'placeholder' in .blend files for directly linked data-blocks. */
|
||||
#define ID_LINK_PLACEHOLDER MAKE_ID2('I', 'D') /* (internal use only) */
|
||||
|
||||
/* Deprecated. */
|
||||
#define ID_SCRN MAKE_ID2('S', 'N')
|
||||
|
||||
/* NOTE: Fake IDs, needed for `g.sipo->blocktype` or outliner. */
|
||||
#define ID_SEQ MAKE_ID2('S', 'Q')
|
||||
/* constraint */
|
||||
#define ID_CO MAKE_ID2('C', 'O')
|
||||
/* pose (action channel, used to be ID_AC in code, so we keep code for backwards compatible). */
|
||||
#define ID_PO MAKE_ID2('A', 'C')
|
||||
/* used in outliner... */
|
||||
#define ID_NLA MAKE_ID2('N', 'L')
|
||||
/* fluidsim Ipo */
|
||||
#define ID_FLUIDSIM MAKE_ID2('F', 'S')
|
||||
|
||||
} // namespace blender
|
||||
1399
blender-5.2.0/source/blender/makesdna/DNA_action_types.h
Normal file
1399
blender-5.2.0/source/blender/makesdna/DNA_action_types.h
Normal file
File diff suppressed because it is too large
Load Diff
592
blender-5.2.0/source/blender/makesdna/DNA_anim_enums.h
Normal file
592
blender-5.2.0/source/blender/makesdna/DNA_anim_enums.h
Normal file
@@ -0,0 +1,592 @@
|
||||
/* SPDX-FileCopyrightText: 2009 Blender Authors, Joshua Leung. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* ************************************************ */
|
||||
/* F-Curve DataTypes */
|
||||
|
||||
/* Modifiers -------------------------------------- */
|
||||
|
||||
/**
|
||||
* Types of F-Curve modifier
|
||||
* WARNING: order here is important!
|
||||
*/
|
||||
enum eFModifier_Types : short {
|
||||
FMODIFIER_TYPE_NULL = 0,
|
||||
FMODIFIER_TYPE_GENERATOR = 1,
|
||||
FMODIFIER_TYPE_FN_GENERATOR = 2,
|
||||
FMODIFIER_TYPE_ENVELOPE = 3,
|
||||
FMODIFIER_TYPE_CYCLES = 4,
|
||||
FMODIFIER_TYPE_NOISE = 5,
|
||||
FMODIFIER_TYPE_FILTER = 6, /* Was never implemented, removed in #123906. */
|
||||
FMODIFIER_TYPE_PYTHON = 7, /* Was never implemented, removed in #123906. */
|
||||
FMODIFIER_TYPE_LIMITS = 8,
|
||||
FMODIFIER_TYPE_STEPPED = 9,
|
||||
FMODIFIER_TYPE_SMOOTH = 10,
|
||||
|
||||
/* NOTE: all new modifiers must be added above this line */
|
||||
FMODIFIER_NUM_TYPES,
|
||||
};
|
||||
|
||||
/** F-Curve Modifier Settings. */
|
||||
enum eFModifier_Flags : short {
|
||||
/** Modifier is not able to be evaluated for some reason, and should be skipped (internal). */
|
||||
FMODIFIER_FLAG_DISABLED = (1 << 0),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** Modifier's data is expanded (in UI). Deprecated, use `ui_expand_flag`. */
|
||||
FMODIFIER_FLAG_EXPANDED = (1 << 1),
|
||||
#endif
|
||||
/** Modifier is active one (in UI) for editing purposes. */
|
||||
FMODIFIER_FLAG_ACTIVE = (1 << 2),
|
||||
/** User wants modifier to be skipped. */
|
||||
FMODIFIER_FLAG_MUTED = (1 << 3),
|
||||
/** Restrict range that F-Modifier can be considered over. */
|
||||
FMODIFIER_FLAG_RANGERESTRICT = (1 << 4),
|
||||
/** Use influence control. */
|
||||
FMODIFIER_FLAG_USEINFLUENCE = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eFModifier_Flags);
|
||||
|
||||
/* --- */
|
||||
|
||||
/* generator modes */
|
||||
enum eFMod_Generator_Modes : int {
|
||||
FCM_GENERATOR_POLYNOMIAL = 0,
|
||||
FCM_GENERATOR_POLYNOMIAL_FACTORISED = 1,
|
||||
};
|
||||
|
||||
/* generator flags
|
||||
* - shared by Generator and Function Generator
|
||||
*/
|
||||
enum eFMod_Generator_Flags : int {
|
||||
/* generator works in conjunction with other modifiers (i.e. doesn't replace those before it) */
|
||||
FCM_GENERATOR_ADDITIVE = (1 << 0),
|
||||
};
|
||||
|
||||
/* 'function' generator types */
|
||||
enum eFMod_Generator_Functions : int {
|
||||
FCM_GENERATOR_FN_SIN = 0,
|
||||
FCM_GENERATOR_FN_COS = 1,
|
||||
FCM_GENERATOR_FN_TAN = 2,
|
||||
FCM_GENERATOR_FN_SQRT = 3,
|
||||
FCM_GENERATOR_FN_LN = 4,
|
||||
FCM_GENERATOR_FN_SINC = 5,
|
||||
};
|
||||
|
||||
/* cycling modes */
|
||||
enum eFMod_Cycling_Modes : short {
|
||||
/** don't do anything */
|
||||
FCM_EXTRAPOLATE_NONE = 0,
|
||||
/** repeat keyframe range as-is */
|
||||
FCM_EXTRAPOLATE_CYCLIC,
|
||||
/** repeat keyframe range, but with offset based on gradient between values */
|
||||
FCM_EXTRAPOLATE_CYCLIC_OFFSET,
|
||||
/** alternate between forward and reverse playback of keyframe range */
|
||||
FCM_EXTRAPOLATE_MIRROR,
|
||||
};
|
||||
|
||||
/* limiting flags */
|
||||
enum eFMod_Limit_Flags : int {
|
||||
FCM_LIMIT_XMIN = (1 << 0),
|
||||
FCM_LIMIT_XMAX = (1 << 1),
|
||||
FCM_LIMIT_YMIN = (1 << 2),
|
||||
FCM_LIMIT_YMAX = (1 << 3),
|
||||
};
|
||||
|
||||
/* modification modes */
|
||||
enum eFMod_Noise_Modifications : short {
|
||||
/** Modify existing curve, matching its shape. */
|
||||
FCM_NOISE_MODIF_REPLACE = 0,
|
||||
/** Add noise to the curve. */
|
||||
FCM_NOISE_MODIF_ADD,
|
||||
/** Subtract noise from the curve. */
|
||||
FCM_NOISE_MODIF_SUBTRACT,
|
||||
/** Multiply the curve by noise. */
|
||||
FCM_NOISE_MODIF_MULTIPLY,
|
||||
};
|
||||
|
||||
/* stepped modifier range flags */
|
||||
enum eFMod_Stepped_Flags : int {
|
||||
/** Don't affect frames before the start frame. */
|
||||
FCM_STEPPED_NO_BEFORE = (1 << 0),
|
||||
/** Don't affect frames after the end frame. */
|
||||
FCM_STEPPED_NO_AFTER = (1 << 1),
|
||||
};
|
||||
|
||||
/* Drivers -------------------------------------- */
|
||||
|
||||
/** Driver Target options. */
|
||||
enum eDriverTarget_Options : short {
|
||||
/** Use the fallback value when the target is invalid (rna_path cannot be resolved). */
|
||||
DTAR_OPTION_USE_FALLBACK = (1 << 0),
|
||||
};
|
||||
|
||||
/** Driver Target flags. */
|
||||
enum eDriverTarget_Flag : short {
|
||||
/** used for targets that use the pchan_name instead of RNA path
|
||||
* (i.e. rotation difference) */
|
||||
DTAR_FLAG_STRUCT_REF = (1 << 0),
|
||||
/** The `idtype` can only be "Object". */
|
||||
DTAR_FLAG_ID_OB_ONLY = (1 << 1),
|
||||
|
||||
/* "local-space" flags. */
|
||||
/** base flag - basically "pre parent+constraints" */
|
||||
DTAR_FLAG_LOCALSPACE = (1 << 2),
|
||||
/** include constraints transformed to space including parents */
|
||||
DTAR_FLAG_LOCAL_CONSTS = (1 << 3),
|
||||
|
||||
/** error flags */
|
||||
DTAR_FLAG_INVALID = (1 << 4),
|
||||
|
||||
/** the fallback value was actually used */
|
||||
DTAR_FLAG_FALLBACK_USED = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eDriverTarget_Flag);
|
||||
|
||||
/* Transform Channels for Driver Targets */
|
||||
enum eDriverTarget_TransformChannels : short {
|
||||
DTAR_TRANSCHAN_LOCX = 0,
|
||||
DTAR_TRANSCHAN_LOCY,
|
||||
DTAR_TRANSCHAN_LOCZ,
|
||||
DTAR_TRANSCHAN_ROTX,
|
||||
DTAR_TRANSCHAN_ROTY,
|
||||
DTAR_TRANSCHAN_ROTZ,
|
||||
DTAR_TRANSCHAN_SCALEX,
|
||||
DTAR_TRANSCHAN_SCALEY,
|
||||
DTAR_TRANSCHAN_SCALEZ,
|
||||
DTAR_TRANSCHAN_SCALE_AVG,
|
||||
DTAR_TRANSCHAN_ROTW,
|
||||
|
||||
MAX_DTAR_TRANSCHAN_TYPES,
|
||||
};
|
||||
|
||||
/* Rotation channel mode for Driver Targets */
|
||||
enum eDriverTarget_RotationMode : char {
|
||||
/** Automatic euler mode. */
|
||||
DTAR_ROTMODE_AUTO = 0,
|
||||
|
||||
/** Explicit euler rotation modes - must sync with BLI_math_rotation.h defines. */
|
||||
DTAR_ROTMODE_EULER_XYZ = 1,
|
||||
DTAR_ROTMODE_EULER_XZY,
|
||||
DTAR_ROTMODE_EULER_YXZ,
|
||||
DTAR_ROTMODE_EULER_YZX,
|
||||
DTAR_ROTMODE_EULER_ZXY,
|
||||
DTAR_ROTMODE_EULER_ZYX,
|
||||
|
||||
DTAR_ROTMODE_QUATERNION,
|
||||
|
||||
/**
|
||||
* Implements the very common Damped Track + child trick to decompose
|
||||
* rotation into bending followed by twist around the remaining axis.
|
||||
*/
|
||||
DTAR_ROTMODE_SWING_TWIST_X,
|
||||
DTAR_ROTMODE_SWING_TWIST_Y,
|
||||
DTAR_ROTMODE_SWING_TWIST_Z,
|
||||
|
||||
DTAR_ROTMODE_EULER_MIN = DTAR_ROTMODE_EULER_XYZ,
|
||||
DTAR_ROTMODE_EULER_MAX = DTAR_ROTMODE_EULER_ZYX,
|
||||
};
|
||||
|
||||
enum eDriverTarget_ContextProperty : int {
|
||||
DTAR_CONTEXT_PROPERTY_ACTIVE_SCENE = 0,
|
||||
DTAR_CONTEXT_PROPERTY_ACTIVE_VIEW_LAYER = 1,
|
||||
};
|
||||
|
||||
/* --- */
|
||||
|
||||
/* maximum number of driver targets per variable */
|
||||
#define MAX_DRIVER_TARGETS 8
|
||||
|
||||
/** Driver Variable Types.* */
|
||||
enum eDriverVar_Types : char {
|
||||
/** single RNA property */
|
||||
DVAR_TYPE_SINGLE_PROP = 0,
|
||||
/** rotation difference (between 2 bones) */
|
||||
DVAR_TYPE_ROT_DIFF,
|
||||
/** distance between objects/bones */
|
||||
DVAR_TYPE_LOC_DIFF,
|
||||
/** 'final' transform for object/bones */
|
||||
DVAR_TYPE_TRANSFORM_CHAN,
|
||||
/** Property within a current evaluation context */
|
||||
DVAR_TYPE_CONTEXT_PROP,
|
||||
|
||||
/**
|
||||
* Maximum number of variable types.
|
||||
*
|
||||
* \note This must always be the last item in this list,
|
||||
* so add new types above this line.
|
||||
*/
|
||||
MAX_DVAR_TYPES,
|
||||
};
|
||||
|
||||
/* Driver Variable Flags */
|
||||
enum eDriverVar_Flags : short {
|
||||
/* variable is not set up correctly */
|
||||
DVAR_FLAG_ERROR = (1 << 0),
|
||||
|
||||
/* variable name doesn't pass the validation tests */
|
||||
DVAR_FLAG_INVALID_NAME = (1 << 1),
|
||||
/* name starts with a number */
|
||||
DVAR_FLAG_INVALID_START_NUM = (1 << 2),
|
||||
/* name starts with a special character (!, $, @, #, _, etc.) */
|
||||
DVAR_FLAG_INVALID_START_CHAR = (1 << 3),
|
||||
/* name contains a space */
|
||||
DVAR_FLAG_INVALID_HAS_SPACE = (1 << 4),
|
||||
/* name contains a dot */
|
||||
DVAR_FLAG_INVALID_HAS_DOT = (1 << 5),
|
||||
/* name contains invalid chars */
|
||||
DVAR_FLAG_INVALID_HAS_SPECIAL = (1 << 6),
|
||||
/* name is a reserved keyword */
|
||||
DVAR_FLAG_INVALID_PY_KEYWORD = (1 << 7),
|
||||
/* name is zero-length */
|
||||
DVAR_FLAG_INVALID_EMPTY = (1 << 8),
|
||||
};
|
||||
ENUM_OPERATORS(eDriverVar_Flags);
|
||||
|
||||
/** All invalid `dvar` name flags. */
|
||||
#define DVAR_ALL_INVALID_FLAGS \
|
||||
(DVAR_FLAG_INVALID_NAME | DVAR_FLAG_INVALID_START_NUM | DVAR_FLAG_INVALID_START_CHAR | \
|
||||
DVAR_FLAG_INVALID_HAS_SPACE | DVAR_FLAG_INVALID_HAS_DOT | DVAR_FLAG_INVALID_HAS_SPECIAL | \
|
||||
DVAR_FLAG_INVALID_PY_KEYWORD | DVAR_FLAG_INVALID_EMPTY)
|
||||
|
||||
/* --- */
|
||||
|
||||
/** Driver type. */
|
||||
enum eDriver_Types : int {
|
||||
/** target values are averaged together. */
|
||||
DRIVER_TYPE_AVERAGE = 0,
|
||||
/** python expression/function relates targets. */
|
||||
DRIVER_TYPE_PYTHON,
|
||||
/** sum of all values. */
|
||||
DRIVER_TYPE_SUM,
|
||||
/** smallest value. */
|
||||
DRIVER_TYPE_MIN,
|
||||
/** largest value. */
|
||||
DRIVER_TYPE_MAX,
|
||||
};
|
||||
|
||||
/** Driver flags. */
|
||||
enum eDriver_Flags : int {
|
||||
/** Driver has invalid settings (internal flag). */
|
||||
DRIVER_FLAG_INVALID = (1 << 0),
|
||||
DRIVER_FLAG_DEPRECATED = (1 << 1),
|
||||
/** Driver does replace value, but overrides (for layering of animation over driver) */
|
||||
/* TODO: this needs to be implemented at some stage or left out... */
|
||||
// DRIVER_FLAG_LAYERING = (1 << 2),
|
||||
/** Use when the expression needs to be recompiled. */
|
||||
DRIVER_FLAG_RECOMPILE = (1 << 3),
|
||||
/** The names are cached so they don't need have python unicode versions created each time */
|
||||
DRIVER_FLAG_RENAMEVAR = (1 << 4),
|
||||
/* Set if the driver cannot run because it uses Python which isn't allowed to execute. */
|
||||
DRIVER_FLAG_PYTHON_BLOCKED = (1 << 5),
|
||||
/** Include 'self' in the drivers namespace. */
|
||||
DRIVER_FLAG_USE_SELF = (1 << 6),
|
||||
};
|
||||
ENUM_OPERATORS(eDriver_Flags);
|
||||
|
||||
/* F-Curves -------------------------------------- */
|
||||
|
||||
/** When #active_keyframe_index is set to this, the FCurve does not have an active keyframe. */
|
||||
#define FCURVE_ACTIVE_KEYFRAME_NONE -1
|
||||
|
||||
/* user-editable flags/settings */
|
||||
enum eFCurve_Flags : short {
|
||||
/** Curve/keyframes are visible in editor */
|
||||
FCURVE_VISIBLE = (1 << 0),
|
||||
/** Curve is selected for editing. */
|
||||
FCURVE_SELECTED = (1 << 1),
|
||||
/** Curve is active one. */
|
||||
FCURVE_ACTIVE = (1 << 2),
|
||||
/** Keyframes (beztriples) cannot be edited. */
|
||||
FCURVE_PROTECTED = (1 << 3),
|
||||
/** FCurve will not be evaluated for the next round. */
|
||||
FCURVE_MUTED = (1 << 4),
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** fcurve uses 'auto-handles', which stay horizontal... */
|
||||
FCURVE_AUTO_HANDLES = (1 << 5), /* Dirty. */
|
||||
#endif
|
||||
FCURVE_MOD_OFF = (1 << 6),
|
||||
/** skip evaluation, as RNA-path cannot be resolved
|
||||
* (similar to muting, but cannot be set by user) */
|
||||
FCURVE_DISABLED = (1 << 10),
|
||||
/** curve can only have whole-number values (integer types) */
|
||||
FCURVE_INT_VALUES = (1 << 11),
|
||||
/** curve can only have certain discrete-number values
|
||||
* (no interpolation at all, for enums/booleans) */
|
||||
FCURVE_DISCRETE_VALUES = (1 << 12),
|
||||
|
||||
/** temporary tag for editing */
|
||||
FCURVE_TAGGED = static_cast<short>(1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eFCurve_Flags);
|
||||
|
||||
/* extrapolation modes (only simple value 'extending') */
|
||||
enum eFCurve_Extend : short {
|
||||
/** Just extend min/max keyframe value. */
|
||||
FCURVE_EXTRAPOLATE_CONSTANT = 0,
|
||||
/** Just extend gradient of segment between first segment keyframes. */
|
||||
FCURVE_EXTRAPOLATE_LINEAR,
|
||||
};
|
||||
|
||||
/* curve coloring modes */
|
||||
enum eFCurve_Coloring : int {
|
||||
/** Automatically determine color using rainbow (calculated at draw-time). */
|
||||
FCURVE_COLOR_AUTO_RAINBOW = 0,
|
||||
/** Automatically determine color using XYZ (array index) <-> RGB. */
|
||||
FCURVE_COLOR_AUTO_RGB = 1,
|
||||
/** Automatically determine color where XYZ <-> RGB, but index(X) != 0. */
|
||||
FCURVE_COLOR_AUTO_YRGB = 3,
|
||||
/** Custom color. */
|
||||
FCURVE_COLOR_CUSTOM = 2,
|
||||
};
|
||||
|
||||
/* curve smoothing modes */
|
||||
enum eFCurve_Smoothing : char {
|
||||
/** legacy mode: auto handles only consider adjacent points */
|
||||
FCURVE_SMOOTH_NONE = 0,
|
||||
/** maintain continuity of the acceleration */
|
||||
FCURVE_SMOOTH_CONT_ACCEL = 1,
|
||||
};
|
||||
|
||||
/* ************************************************ */
|
||||
/* 'Action' Data-types */
|
||||
|
||||
/* NOTE: Although these are part of the Animation System,
|
||||
* they are not stored here, see `DNA_action_types.h` instead. */
|
||||
|
||||
/* ************************************************ */
|
||||
/* NLA - Non-Linear Animation */
|
||||
|
||||
/* NLA Strips ------------------------------------- */
|
||||
|
||||
/* NLA Strip Blending Mode */
|
||||
enum eNlaStrip_Blend_Mode : short {
|
||||
NLASTRIP_MODE_REPLACE = 0,
|
||||
NLASTRIP_MODE_ADD,
|
||||
NLASTRIP_MODE_SUBTRACT,
|
||||
NLASTRIP_MODE_MULTIPLY,
|
||||
NLASTRIP_MODE_COMBINE,
|
||||
};
|
||||
|
||||
/** NLA Strip Extrapolation Mode. */
|
||||
enum eNlaStrip_Extrapolate_Mode : short {
|
||||
/* extend before first frame if no previous strips in track,
|
||||
* and always hold+extend last frame */
|
||||
NLASTRIP_EXTEND_HOLD = 0,
|
||||
/* only hold+extend last frame */
|
||||
NLASTRIP_EXTEND_HOLD_FORWARD = 1,
|
||||
/* don't contribute at all */
|
||||
NLASTRIP_EXTEND_NOTHING = 2,
|
||||
};
|
||||
|
||||
/** NLA Strip Settings. */
|
||||
enum eNlaStrip_Flag : uint32_t {
|
||||
/* UI selection flags */
|
||||
/** NLA strip is the active one in the track (also indicates if strip is being tweaked) */
|
||||
NLASTRIP_FLAG_ACTIVE = (1 << 0),
|
||||
/* NLA strip is selected for editing */
|
||||
NLASTRIP_FLAG_SELECT = (1 << 1),
|
||||
// NLASTRIP_FLAG_SELECT_L = (1 << 2), /* left handle selected. */
|
||||
// NLASTRIP_FLAG_SELECT_R = (1 << 3), /* right handle selected. */
|
||||
|
||||
/**
|
||||
* NLA strip uses the same action that the action being tweaked uses
|
||||
* (not set for the tweaking one though).
|
||||
*/
|
||||
NLASTRIP_FLAG_TWEAKUSER = (1 << 4),
|
||||
|
||||
/* controls driven by local F-Curves */
|
||||
/** strip influence is controlled by local F-Curve */
|
||||
NLASTRIP_FLAG_USR_INFLUENCE = (1 << 5),
|
||||
NLASTRIP_FLAG_USR_TIME = (1 << 6),
|
||||
NLASTRIP_FLAG_USR_TIME_CYCLIC = (1 << 7),
|
||||
|
||||
/** NLA strip length is synced to the length of the referenced action */
|
||||
NLASTRIP_FLAG_SYNC_LENGTH = (1 << 9),
|
||||
|
||||
/* playback flags (may be overridden by F-Curves) */
|
||||
/** NLA strip blend-in/out values are set automatically based on overlaps */
|
||||
NLASTRIP_FLAG_AUTO_BLENDS = (1 << 10),
|
||||
/** NLA strip is played back in reverse order */
|
||||
NLASTRIP_FLAG_REVERSE = (1 << 11),
|
||||
/** NLA strip is muted (i.e. doesn't contribute in any way) */
|
||||
NLASTRIP_FLAG_MUTED = (1 << 12),
|
||||
/** NLA Strip is played back in 'ping-pong' style */
|
||||
/* NLASTRIP_FLAG_MIRROR = (1 << 13), */ /* UNUSED */
|
||||
|
||||
/* temporary editing flags */
|
||||
|
||||
/**
|
||||
* When transforming strips, this flag is set when the strip is placed in an invalid location
|
||||
* such as overlapping another strip or moved to a locked track. In such cases, the strip's
|
||||
* location must be corrected after the transform operator is done.
|
||||
*/
|
||||
NLASTRIP_FLAG_INVALID_LOCATION = (1 << 28),
|
||||
/** NLA strip should ignore frame range and hold settings, and evaluate at global time. */
|
||||
NLASTRIP_FLAG_NO_TIME_MAP = (1 << 29),
|
||||
/** NLA-Strip is really just a temporary meta used to facilitate easier transform code */
|
||||
NLASTRIP_FLAG_TEMP_META = (1 << 30),
|
||||
NLASTRIP_FLAG_EDIT_TOUCHED = (1u << 31),
|
||||
};
|
||||
ENUM_OPERATORS(eNlaStrip_Flag)
|
||||
|
||||
/* NLA Strip Type */
|
||||
enum eNlaStrip_Type : short {
|
||||
/* 'clip' - references an Action */
|
||||
NLASTRIP_TYPE_CLIP = 0,
|
||||
/* 'transition' - blends between the adjacent strips */
|
||||
NLASTRIP_TYPE_TRANSITION,
|
||||
/* 'meta' - a strip which acts as a container for a few others */
|
||||
NLASTRIP_TYPE_META,
|
||||
|
||||
/* 'emit sound' - a strip which is used for timing when speaker emits sounds */
|
||||
NLASTRIP_TYPE_SOUND,
|
||||
};
|
||||
|
||||
/* NLA Tracks ------------------------------------- */
|
||||
|
||||
/* settings for track */
|
||||
enum eNlaTrack_Flag : int {
|
||||
/** track is the one that settings can be modified on,
|
||||
* also indicates if track is being 'tweaked' */
|
||||
NLATRACK_ACTIVE = (1 << 0),
|
||||
/** track is selected in UI for relevant editing operations */
|
||||
NLATRACK_SELECTED = (1 << 1),
|
||||
/** track is not evaluated */
|
||||
NLATRACK_MUTED = (1 << 2),
|
||||
/** track is the only one evaluated (must be used in conjunction with adt->flag) */
|
||||
NLATRACK_SOLO = (1 << 3),
|
||||
/** track's settings (and strips) cannot be edited (to guard against unwanted changes) */
|
||||
NLATRACK_PROTECTED = (1 << 4),
|
||||
|
||||
/** track is not allowed to execute,
|
||||
* usually as result of tweaking being enabled (internal flag) */
|
||||
NLATRACK_DISABLED = (1 << 10),
|
||||
|
||||
/** Marks tracks automatically added for space while dragging strips vertically.
|
||||
* Internal flag that's only set during transform operator. */
|
||||
NLATRACK_TEMPORARILY_ADDED = (1 << 11),
|
||||
|
||||
/** This NLA track is added to an override ID, which means it is fully editable.
|
||||
* Irrelevant in case the owner ID is not an override. */
|
||||
NLATRACK_OVERRIDELIBRARY_LOCAL = 1 << 16,
|
||||
};
|
||||
ENUM_OPERATORS(eNlaTrack_Flag);
|
||||
|
||||
/* ************************************ */
|
||||
/* KeyingSet Data-types */
|
||||
|
||||
/* KeyingSet settings */
|
||||
enum eKS_Settings : short {
|
||||
/** Keyingset cannot be removed (and doesn't need to be freed). */
|
||||
/* KEYINGSET_BUILTIN = (1 << 0), */ /* UNUSED */
|
||||
/** Keyingset does not depend on context info (i.e. paths are absolute). */
|
||||
KEYINGSET_ABSOLUTE = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eKS_Settings)
|
||||
|
||||
/* Flags for use by keyframe creation/deletion calls */
|
||||
enum eInsertKeyFlags : short {
|
||||
INSERTKEY_NOFLAGS = 0,
|
||||
/** Only insert keyframes where they're needed. */
|
||||
INSERTKEY_NEEDED = (1 << 0),
|
||||
/** Insert "visual" keyframes where possible/needed. */
|
||||
INSERTKEY_MATRIX = (1 << 1),
|
||||
/** Don't recalculate handles,etc. after adding key. */
|
||||
INSERTKEY_FAST = (1 << 2),
|
||||
/** Don't re-allocate memory (or increase count, as array has already been set out). */
|
||||
/* INSERTKEY_FASTR = (1 << 3), */ /* UNUSED */
|
||||
/** Only replace an existing keyframe (this overrides #INSERTKEY_NEEDED). */
|
||||
INSERTKEY_REPLACE = (1 << 4),
|
||||
/** Ignore user-preferences (needed for predictable API use). */
|
||||
INSERTKEY_NO_USERPREF = (1 << 6),
|
||||
/**
|
||||
* Allow to make a full copy of new key into existing one, if any,
|
||||
* instead of 'reusing' existing handles.
|
||||
* Used by copy/paste code.
|
||||
*/
|
||||
INSERTKEY_OVERWRITE_FULL = (1 << 7),
|
||||
/** For cyclic FCurves, adjust key timing to preserve the cycle period and flow. */
|
||||
INSERTKEY_CYCLE_AWARE = (1 << 9),
|
||||
/** Don't create new F-Curves (implied by #INSERTKEY_REPLACE). */
|
||||
INSERTKEY_AVAILABLE = (1 << 10),
|
||||
};
|
||||
ENUM_OPERATORS(eInsertKeyFlags);
|
||||
|
||||
/* KS_Path->flag */
|
||||
enum eKSP_Settings : short {
|
||||
/* entire array (not just the specified index) gets keyframed */
|
||||
KSP_FLAG_WHOLE_ARRAY = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eKSP_Settings)
|
||||
|
||||
/* KS_Path->groupmode */
|
||||
enum eKSP_Grouping : short {
|
||||
/** Path should be grouped using group name stored in path. */
|
||||
KSP_GROUP_NAMED = 0,
|
||||
/** Path should not be grouped at all. */
|
||||
KSP_GROUP_NONE,
|
||||
/** Path should be grouped using KeyingSet's name. */
|
||||
KSP_GROUP_KSNAME,
|
||||
/** Path should be grouped using name of inner-most context item from templates
|
||||
* - this is most useful for relative KeyingSets only. */
|
||||
/* KSP_GROUP_TEMPLATE_ITEM, */ /* UNUSED */
|
||||
};
|
||||
|
||||
/* ************************************************ */
|
||||
/* Animation Data */
|
||||
|
||||
/* AnimData ------------------------------------- */
|
||||
|
||||
/* Animation Data settings (mostly for NLA) */
|
||||
enum eAnimData_Flag : int {
|
||||
/** Only evaluate a single track in the NLA. */
|
||||
ADT_NLA_SOLO_TRACK = (1 << 0),
|
||||
/** Don't use NLA */
|
||||
ADT_NLA_EVAL_OFF = (1 << 1),
|
||||
/** NLA is being 'tweaked' (i.e. in EditMode). */
|
||||
ADT_NLA_EDIT_ON = (1 << 2),
|
||||
/** Active Action for 'tweaking' does not have mapping applied for editing. */
|
||||
ADT_NLA_EDIT_NOMAP = (1 << 3),
|
||||
/** NLA-Strip F-Curves are expanded in UI. */
|
||||
ADT_NLA_SKEYS_COLLAPSED = (1 << 4),
|
||||
/* Evaluate tracks above tweaked strip. Only relevant in tweak mode. */
|
||||
ADT_NLA_EVAL_UPPER_TRACKS = (1 << 5),
|
||||
|
||||
/** Drivers expanded in UI. */
|
||||
ADT_DRIVERS_COLLAPSED = (1 << 10),
|
||||
/** Don't execute drivers. */
|
||||
/* ADT_DRIVERS_DISABLED = (1 << 11), */ /* UNUSED */
|
||||
|
||||
/** AnimData block is selected in UI. */
|
||||
ADT_UI_SELECTED = (1 << 14),
|
||||
/** AnimData block is active in UI. */
|
||||
ADT_UI_ACTIVE = (1 << 15),
|
||||
|
||||
/** F-Curves from this AnimData block are not visible in the Graph Editor. */
|
||||
ADT_CURVES_NOT_VISIBLE = (1 << 16),
|
||||
|
||||
/** F-Curves from this AnimData block are always visible. */
|
||||
ADT_CURVES_ALWAYS_VISIBLE = (1 << 17),
|
||||
|
||||
/** Animation pointer to by this AnimData block is expanded in UI. This is stored on the AnimData
|
||||
* so that each user of the Animation can have its own expansion/contraction state. */
|
||||
ADT_UI_EXPANDED = (1 << 18),
|
||||
};
|
||||
ENUM_OPERATORS(eAnimData_Flag);
|
||||
|
||||
/* From: `DNA_object_types.h`, see its docstring there. */
|
||||
#define SELECT 1
|
||||
|
||||
} // namespace blender
|
||||
763
blender-5.2.0/source/blender/makesdna/DNA_anim_types.h
Normal file
763
blender-5.2.0/source/blender/makesdna/DNA_anim_types.h
Normal file
@@ -0,0 +1,763 @@
|
||||
/* SPDX-FileCopyrightText: 2009 Blender Authors, Joshua Leung. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_action_types.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace blender {
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace bke {
|
||||
struct NlaStripRuntime;
|
||||
} // namespace bke
|
||||
using NlaStripRuntime = bke::NlaStripRuntime;
|
||||
#else
|
||||
typedef struct NlaStripRuntime NlaStripRuntime;
|
||||
#endif
|
||||
|
||||
/* ************************************************ */
|
||||
/* F-Curve DataTypes */
|
||||
|
||||
/* Modifiers -------------------------------------- */
|
||||
|
||||
/**
|
||||
* F-Curve Modifiers (fcm)
|
||||
*
|
||||
* These alter the way F-Curves behave, by altering the value that is returned
|
||||
* when evaluating the curve's data at some time (t).
|
||||
*/
|
||||
struct FModifier {
|
||||
struct FModifier *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Containing curve, only used for updates to CYCLES. */
|
||||
struct FCurve *curve = nullptr;
|
||||
/** Pointer to modifier data. */
|
||||
void *data = nullptr;
|
||||
|
||||
/** User-defined description for the modifier. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
/** Type of f-curve modifier. */
|
||||
eFModifier_Types type = {};
|
||||
/** Settings for the modifier. */
|
||||
eFModifier_Flags flag = {};
|
||||
/**
|
||||
* Expansion state for the modifier panel and its sub-panels, stored as a bit-field
|
||||
* in depth-first order. (Maximum of `sizeof(short)` total panels).
|
||||
*/
|
||||
short ui_expand_flag = 0;
|
||||
|
||||
char _pad[6] = {};
|
||||
|
||||
/** The amount that the modifier should influence the value. */
|
||||
float influence = 0;
|
||||
|
||||
/** Start frame of restricted frame-range. */
|
||||
float sfra = 0;
|
||||
/** End frame of restricted frame-range. */
|
||||
float efra = 0;
|
||||
/** Number of frames from sfra before modifier takes full influence. */
|
||||
float blendin = 0;
|
||||
/** Number of frames from efra before modifier fades out. */
|
||||
float blendout = 0;
|
||||
};
|
||||
|
||||
/* --- */
|
||||
|
||||
/* Generator modifier data */
|
||||
struct FMod_Generator {
|
||||
/* general generator information */
|
||||
/** Coefficients array. */
|
||||
float *coefficients = nullptr;
|
||||
/** Size of the coefficients array. */
|
||||
unsigned int arraysize = 0;
|
||||
|
||||
/** Order of polynomial generated (i.e. 1 for linear, 2 for quadratic). */
|
||||
int poly_order = 0;
|
||||
/** Which 'generator' to use. */
|
||||
eFMod_Generator_Modes mode = {};
|
||||
|
||||
/** Settings. */
|
||||
eFMod_Generator_Flags flag = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* 'Built-In Function' Generator modifier data
|
||||
*
|
||||
* This uses the general equation for equations:
|
||||
* y = amplitude * fn(phase_multiplier*x + phase_offset) + y_offset
|
||||
*
|
||||
* where amplitude, phase_multiplier/offset, y_offset are user-defined coefficients,
|
||||
* x is the evaluation 'time', and 'y' is the resultant value
|
||||
*/
|
||||
struct FMod_FunctionGenerator {
|
||||
/** Coefficients for general equation (as above). */
|
||||
float amplitude = 0;
|
||||
float phase_multiplier = 0;
|
||||
float phase_offset = 0;
|
||||
float value_offset = 0;
|
||||
|
||||
eFMod_Generator_Functions type = {};
|
||||
eFMod_Generator_Flags flag = {};
|
||||
};
|
||||
|
||||
/* envelope modifier - envelope data */
|
||||
struct FCM_EnvelopeData {
|
||||
/** Min/max values for envelope at this point (absolute values). */
|
||||
float min = 0, max = 0;
|
||||
/** Time for that this sample-point occurs. */
|
||||
float time = 0;
|
||||
|
||||
/** Settings for 'min' control point. */
|
||||
short f1 = 0;
|
||||
/** Settings for 'max' control point. */
|
||||
short f2 = 0;
|
||||
};
|
||||
|
||||
/* envelope-like adjustment to values (for fade in/out) */
|
||||
struct FMod_Envelope {
|
||||
/** Data-points defining envelope to apply (array). */
|
||||
FCM_EnvelopeData *data = nullptr;
|
||||
/** Number of envelope points. */
|
||||
int totvert = 0;
|
||||
|
||||
/** Value that envelope's influence is centered around / based on. */
|
||||
float midval = 0;
|
||||
/** Distances from 'middle-value' for 1:1 envelope influence. */
|
||||
float min = 0, max = 0;
|
||||
};
|
||||
|
||||
/* cycling/repetition modifier data */
|
||||
/* TODO: we can only do complete cycles. */
|
||||
struct FMod_Cycles {
|
||||
/** Extrapolation mode to use before first keyframe. */
|
||||
eFMod_Cycling_Modes before_mode = {};
|
||||
/** Extrapolation mode to use after last keyframe. */
|
||||
eFMod_Cycling_Modes after_mode = {};
|
||||
/** Number of 'cycles' before first keyframe to do. */
|
||||
short before_cycles = 0;
|
||||
/** Number of 'cycles' after last keyframe to do. */
|
||||
short after_cycles = 0;
|
||||
};
|
||||
|
||||
/* limits modifier data */
|
||||
struct FMod_Limits {
|
||||
/** Rect defining the min/max values. */
|
||||
rctf rect = {};
|
||||
/** Settings for limiting. */
|
||||
eFMod_Limit_Flags flag = {};
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* noise modifier data */
|
||||
struct FMod_Noise {
|
||||
float size = 0;
|
||||
float strength = 0;
|
||||
float phase = 0;
|
||||
float offset = 0;
|
||||
float roughness = 0;
|
||||
float lacunarity = 0;
|
||||
|
||||
short depth = 0;
|
||||
eFMod_Noise_Modifications modification = {};
|
||||
char legacy_noise = 0;
|
||||
char _pad[3] = {};
|
||||
};
|
||||
|
||||
/* stepped modifier data */
|
||||
struct FMod_Stepped {
|
||||
/** Number of frames each interpolated value should be held. */
|
||||
float step_size = 0;
|
||||
/** Reference frame number that stepping starts from. */
|
||||
float offset = 0;
|
||||
|
||||
/** Start frame of the frame range that modifier works in. */
|
||||
float start_frame = 0;
|
||||
/** End frame of the frame range that modifier works in. */
|
||||
float end_frame = 0;
|
||||
|
||||
/** Various settings. */
|
||||
eFMod_Stepped_Flags flag = {};
|
||||
};
|
||||
|
||||
/* stepped modifier data */
|
||||
typedef struct FMod_Smooth {
|
||||
/**
|
||||
* The shape of the Gaussian distribution in frames. Lower values will make it sharper.
|
||||
* This can be any value > 0.
|
||||
*/
|
||||
float sigma;
|
||||
|
||||
/** The number of frames to average around each keyframe. */
|
||||
int filter_width;
|
||||
} FMod_Smooth;
|
||||
|
||||
/* Drivers -------------------------------------- */
|
||||
|
||||
/**
|
||||
* Driver Target (`dtar`)
|
||||
*
|
||||
* Defines how to access a dependency needed for a driver variable.
|
||||
*/
|
||||
struct DriverTarget {
|
||||
/** ID-block which owns the target, no user count. */
|
||||
ID *id = nullptr;
|
||||
|
||||
/** RNA path defining the setting to use (for DVAR_TYPE_SINGLE_PROP). */
|
||||
char *rna_path = nullptr;
|
||||
|
||||
/**
|
||||
* Name of the pose-bone to use
|
||||
* (for vars where DTAR_FLAG_STRUCT_REF is used).
|
||||
*/
|
||||
char pchan_name[/*MAX_NAME*/ 64] = "";
|
||||
/** Transform channel index (for #DVAR_TYPE_TRANSFORM_CHAN). */
|
||||
eDriverTarget_TransformChannels transChan = {};
|
||||
|
||||
/** Rotation channel calculation type. */
|
||||
eDriverTarget_RotationMode rotation_mode = {};
|
||||
char _pad[5] = {};
|
||||
|
||||
/**
|
||||
* Flags for the validity of the target
|
||||
* (NOTE: these get reset every time the types change).
|
||||
*/
|
||||
eDriverTarget_Flag flag = {};
|
||||
/** Single-bit user-visible toggles (not reset on type change). */
|
||||
eDriverTarget_Options options = {};
|
||||
/** Type of ID-block that this target can use. */
|
||||
int idtype = 0;
|
||||
|
||||
/* Context-dependent property of a "Context Property" type target.
|
||||
* The `rna_path` of this property is used as a target. */
|
||||
eDriverTarget_ContextProperty context_property = {};
|
||||
|
||||
/* Fall back value to use with DTAR_OPTION_USE_FALLBACK. */
|
||||
float fallback_value = 0;
|
||||
};
|
||||
|
||||
/* --- */
|
||||
|
||||
/**
|
||||
* Driver Variable (`dvar`)
|
||||
*
|
||||
* A 'variable' for use as an input for the driver evaluation.
|
||||
* Defines a way of accessing some channel to use, that can be
|
||||
* referred to in the expression as a variable, thus simplifying
|
||||
* expressions and also Depsgraph building.
|
||||
*/
|
||||
struct DriverVar {
|
||||
struct DriverVar *next = nullptr, *prev = nullptr;
|
||||
|
||||
/**
|
||||
* Name of the variable to use in py-expression
|
||||
* (must be valid python identifier).
|
||||
*/
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** MAX_DRIVER_TARGETS, target slots. */
|
||||
DriverTarget targets[8];
|
||||
|
||||
/** Number of targets actually used by this variable. */
|
||||
char num_targets = 0;
|
||||
/** Type of driver variable. */
|
||||
eDriverVar_Types type = {};
|
||||
|
||||
/** Validation tags, etc. */
|
||||
eDriverVar_Flags flag = {};
|
||||
/** Result of previous evaluation. */
|
||||
float curval = 0;
|
||||
};
|
||||
|
||||
/* --- */
|
||||
|
||||
/**
|
||||
* Channel Driver (i.e. Drivers / Expressions) (driver)
|
||||
*
|
||||
* Channel Drivers are part of the dependency system, and are executed in addition to
|
||||
* normal user-defined animation. They take the animation result of some channel(s), and
|
||||
* use that (optionally combined with its own F-Curve for modification of results) to define
|
||||
* the value of some setting semi-procedurally.
|
||||
*
|
||||
* Drivers are stored as part of F-Curve data, so that the F-Curve's RNA-path settings (for storing
|
||||
* what setting the driver will affect). The order in which they are stored defines the order that
|
||||
* they're evaluated in. This order is set by the Depsgraph's sorting stuff.
|
||||
*/
|
||||
struct ChannelDriver {
|
||||
/** Targets for this driver (i.e. list of DriverVar). */
|
||||
ListBaseT<DriverVar> variables = {nullptr, nullptr};
|
||||
|
||||
/* python expression to execute (may call functions defined in an accessory file)
|
||||
* which relates the target 'variables' in some way to yield a single usable value
|
||||
*/
|
||||
/** Expression to compile for evaluation. */
|
||||
char expression[256] = "";
|
||||
/** PyObject - compiled expression, don't save this. */
|
||||
void *expr_comp = nullptr;
|
||||
|
||||
/** Compiled simple arithmetic expression. */
|
||||
struct ExprPyLike_Parsed *expr_simple = nullptr;
|
||||
|
||||
/** Result of previous evaluation. */
|
||||
float curval = 0;
|
||||
/* XXX to be implemented... this is like the constraint influence setting. */
|
||||
/** Influence of driver on result. */
|
||||
float influence = 0;
|
||||
|
||||
/* general settings */
|
||||
/** Type of driver. */
|
||||
eDriver_Types type = {};
|
||||
/** Settings of driver. */
|
||||
eDriver_Flags flag = {};
|
||||
};
|
||||
|
||||
/* F-Curves -------------------------------------- */
|
||||
|
||||
/**
|
||||
* FPoint (fpt)
|
||||
*
|
||||
* This is the bare-minimum data required storing motion samples. Should be more efficient
|
||||
* than using BPoints, which contain a lot of other unnecessary data...
|
||||
*/
|
||||
struct FPoint {
|
||||
/** Time + value. */
|
||||
float vec[2];
|
||||
/** Selection info. */
|
||||
int flag;
|
||||
char _pad[4];
|
||||
};
|
||||
|
||||
/** 'Function-Curve' - defines values over time for a given setting (fcu). */
|
||||
struct FCurve {
|
||||
struct FCurve *next = nullptr, *prev = nullptr;
|
||||
|
||||
/* group */
|
||||
/** Group that F-Curve belongs to. */
|
||||
bActionGroup *grp = nullptr;
|
||||
|
||||
/* driver settings */
|
||||
/** Only valid for drivers (i.e. stored in AnimData not Actions). */
|
||||
ChannelDriver *driver = nullptr;
|
||||
/* evaluation settings */
|
||||
/** FCurve Modifiers. */
|
||||
ListBaseT<FModifier> modifiers = {nullptr, nullptr};
|
||||
|
||||
/* motion data */
|
||||
/** User-editable keyframes (array). */
|
||||
BezTriple *bezt = nullptr;
|
||||
/** 'baked/imported' motion samples (array). */
|
||||
FPoint *fpt = nullptr;
|
||||
/** Total number of points which define the curve (i.e. size of arrays in FPoints). */
|
||||
unsigned int totvert = 0;
|
||||
|
||||
/**
|
||||
* Index of active keyframe in #bezt for numerical editing in the interface. A value of
|
||||
* #FCURVE_ACTIVE_KEYFRAME_NONE indicates that the FCurve has no active keyframe.
|
||||
*
|
||||
* Do not access directly, use #BKE_fcurve_active_keyframe_index() and
|
||||
* #BKE_fcurve_active_keyframe_set() instead.
|
||||
*/
|
||||
int active_keyframe_index = 0;
|
||||
|
||||
/* value cache + settings */
|
||||
/** Value stored from last time curve was evaluated (not threadsafe, debug display only!). */
|
||||
float curval = 0;
|
||||
/** User-editable settings for this curve. */
|
||||
eFCurve_Flags flag = {};
|
||||
/** Value-extending mode for this curve (does not cover). */
|
||||
eFCurve_Extend extend = {};
|
||||
/** Auto-handle smoothing mode. */
|
||||
eFCurve_Smoothing auto_smoothing = {};
|
||||
|
||||
char _pad[3] = {};
|
||||
|
||||
/* RNA - data link */
|
||||
/**
|
||||
* When the RNA property from `rna_path` is an array, use this to access the array index.
|
||||
*
|
||||
* \note This may be negative (as it wasn't prevented in 2.91 and older).
|
||||
* Currently it silently fails to resolve the data-path in this case.
|
||||
*/
|
||||
int array_index = 0;
|
||||
/**
|
||||
* RNA-path to resolve data-access, see: #RNA_path_resolve_property.
|
||||
*
|
||||
* \note String look-ups for collection and custom-properties are escaped using #BLI_str_escape.
|
||||
*/
|
||||
char *rna_path = nullptr;
|
||||
|
||||
/* curve coloring (for editor) */
|
||||
/** Coloring method to use. */
|
||||
eFCurve_Coloring color_mode = {};
|
||||
/** The last-color this curve took. */
|
||||
float color[3] = {};
|
||||
|
||||
float prev_norm_factor = 0, prev_offset = 0;
|
||||
uint16_t local_view_bits = 0;
|
||||
char _pad2[6] = {};
|
||||
};
|
||||
|
||||
/* ************************************************ */
|
||||
/* 'Action' Data-types */
|
||||
|
||||
/* NOTE: Although these are part of the Animation System,
|
||||
* they are not stored here, see `DNA_action_types.h` instead. */
|
||||
|
||||
/* ************************************************ */
|
||||
/* NLA - Non-Linear Animation */
|
||||
|
||||
/* NLA Strips ------------------------------------- */
|
||||
|
||||
/**
|
||||
* NLA Strip (strip)
|
||||
*
|
||||
* A NLA Strip is a container for the reuse of Action data, defining parameters
|
||||
* to control the remapping of the Action data to some destination.
|
||||
*/
|
||||
struct NlaStrip {
|
||||
struct NlaStrip *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** 'Child' strips (used for 'meta' strips). */
|
||||
ListBaseT<NlaStrip> strips = {nullptr, nullptr};
|
||||
/**
|
||||
* Action that is referenced by this strip (strip is 'user' of the action).
|
||||
*
|
||||
* \note Most code should not write to this field directly, but use functions from
|
||||
* `animrig::nla` instead, see ANIM_nla.hh.
|
||||
*/
|
||||
bAction *act = nullptr;
|
||||
|
||||
/**
|
||||
* Slot Handle to determine which animation data to look at in `act`.
|
||||
*
|
||||
* An NLA strip is limited to using a single slot in the Action.
|
||||
*
|
||||
* \note Most code should not write to this field directly, but use functions from
|
||||
* `animrig::nla` instead, see ANIM_nla.hh.
|
||||
*/
|
||||
int32_t action_slot_handle = 0;
|
||||
/**
|
||||
* Slot name, primarily used for mapping to the right slot when assigning
|
||||
* another Action. Should be the same type as #ActionSlot::name.
|
||||
*
|
||||
* \see #ActionSlot::name
|
||||
*
|
||||
* \note Most code should not write to this field directly, but use functions from
|
||||
* `animrig::nla` instead, see ANIM_nla.hh.
|
||||
*/
|
||||
char last_slot_identifier[/*MAX_ID_NAME*/ 258] = "";
|
||||
char _pad0[2] = {};
|
||||
|
||||
/** F-Curves for controlling this strip's influence and timing */ /* TODO: move out? */
|
||||
ListBaseT<FCurve> fcurves = {nullptr, nullptr};
|
||||
/** F-Curve modifiers to be applied to the entire strip's referenced F-Curves. */
|
||||
ListBaseT<FModifier> modifiers = {nullptr, nullptr};
|
||||
|
||||
/** User-Visible Identifier for Strip. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** Influence of strip. */
|
||||
float influence = 0;
|
||||
/** Current 'time' within action being used (automatically evaluated, but can be overridden). */
|
||||
float strip_time = 0;
|
||||
|
||||
/** Extents of the strip. */
|
||||
float start = 0, end = 0;
|
||||
/** Range of the action to use. */
|
||||
float actstart = 0, actend = 0;
|
||||
|
||||
/** The number of times to repeat the action range (only when no F-Curves). */
|
||||
float repeat = 0;
|
||||
/** The amount the action range is scaled by (only when no F-Curves). */
|
||||
float scale = 0;
|
||||
|
||||
/** Strip blending length (only used when there are no F-Curves). */
|
||||
float blendin = 0, blendout = 0;
|
||||
/** Strip blending mode (layer-based mixing). */
|
||||
eNlaStrip_Blend_Mode blendmode = {};
|
||||
|
||||
/** Strip extrapolation mode (time-based mixing). */
|
||||
eNlaStrip_Extrapolate_Mode extendmode = {};
|
||||
char _pad1[2] = {};
|
||||
|
||||
/** Type of NLA strip. */
|
||||
eNlaStrip_Type type = {};
|
||||
|
||||
/** Settings. */
|
||||
eNlaStrip_Flag flag = {};
|
||||
char _pad2[4] = {};
|
||||
|
||||
/* Pointer to an original NLA strip. */
|
||||
struct NlaStrip *orig_strip = nullptr;
|
||||
|
||||
NlaStripRuntime *runtime = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
NlaStripRuntime &runtime_get();
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* Some static assertions that things that should have the same type actually do. */
|
||||
static_assert(
|
||||
std::is_same_v<decltype(ActionSlot::handle), decltype(NlaStrip::action_slot_handle)>);
|
||||
#endif
|
||||
|
||||
/* NLA Tracks ------------------------------------- */
|
||||
|
||||
/**
|
||||
* NLA Track (nlt)
|
||||
*
|
||||
* A track groups a bunch of 'strips', which should form a continuous set of
|
||||
* motion, on top of which other such groups can be layered. This should allow
|
||||
* for animators to work in a non-destructive manner, layering tweaks, etc. over
|
||||
* 'rough' blocks of their work.
|
||||
*/
|
||||
struct NlaTrack {
|
||||
struct NlaTrack *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** BActionStrips in this track. */
|
||||
ListBaseT<NlaStrip> strips = {nullptr, nullptr};
|
||||
|
||||
/** Settings for this track. */
|
||||
eNlaTrack_Flag flag = {};
|
||||
/** Index of the track in the stack
|
||||
* \note not really useful, but we need a '_pad' var anyways! */
|
||||
int index = 0;
|
||||
|
||||
/** Short user-description of this track. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
};
|
||||
|
||||
/* ************************************ */
|
||||
/* KeyingSet Data-types */
|
||||
|
||||
/**
|
||||
* Path for use in KeyingSet definitions (ksp)
|
||||
*
|
||||
* Paths may be either specific (specifying the exact sub-ID
|
||||
* dynamic data-block - such as PoseChannels - to act upon, ala
|
||||
* Maya's 'Character Sets' and XSI's 'Marking Sets'), or they may
|
||||
* be generic (using various placeholder template tags that will be
|
||||
* replaced with appropriate information from the context).
|
||||
*/
|
||||
struct KS_Path {
|
||||
struct KS_Path *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** ID block that keyframes are for. */
|
||||
ID *id = nullptr;
|
||||
/** Name of the group to add to. */
|
||||
char group[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** ID-type that path can be used on. */
|
||||
int idtype = 0;
|
||||
|
||||
/** Group naming. */
|
||||
eKSP_Grouping groupmode = {};
|
||||
/** Various settings, etc. */
|
||||
eKSP_Settings flag = {};
|
||||
|
||||
/** Dynamically (or statically in the case of predefined sets) path. */
|
||||
char *rna_path = nullptr;
|
||||
/** Index that path affects. */
|
||||
int array_index = 0;
|
||||
|
||||
/** Settings to supply insert-key() with. */
|
||||
eInsertKeyFlags keyingflag = {};
|
||||
/** For each flag set, the relevant keying-flag bit overrides the default. */
|
||||
eInsertKeyFlags keyingoverride = {};
|
||||
};
|
||||
|
||||
/* ---------------- */
|
||||
|
||||
/**
|
||||
* KeyingSet definition (ks)
|
||||
*
|
||||
* A KeyingSet defines a group of properties that should
|
||||
* be keyframed together, providing a convenient way for animators
|
||||
* to insert keyframes without resorting to Auto-Keyframing.
|
||||
*
|
||||
* A few 'generic' (non-absolute and dependent on templates) KeyingSets
|
||||
* are defined 'built-in' to facilitate easy animating for the casual
|
||||
* animator without the need to add extra steps to the rigging process.
|
||||
*/
|
||||
struct KeyingSet {
|
||||
struct KeyingSet *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** (KS_Path) paths to keyframe to. */
|
||||
ListBaseT<KS_Path> paths = {nullptr, nullptr};
|
||||
|
||||
/** Unique name (for search, etc.). */
|
||||
char idname[/*MAX_NAME*/ 64] = "";
|
||||
/** User-viewable name for KeyingSet (for menus, etc.). */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
/** (#RNA_DYN_DESCR_MAX) help text. */
|
||||
char description[1024] = "";
|
||||
/** Name of the typeinfo data used for the relative paths. */
|
||||
char typeinfo[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** Index of the active path. */
|
||||
int active_path = 0;
|
||||
|
||||
/** Settings for KeyingSet. */
|
||||
eKS_Settings flag = {};
|
||||
|
||||
/** Settings to supply insertkey() with. */
|
||||
eInsertKeyFlags keyingflag = {};
|
||||
/** For each flag set, the relevant keyingflag bit overrides the default. */
|
||||
eInsertKeyFlags keyingoverride = {};
|
||||
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
/* ************************************************ */
|
||||
/* Animation Data */
|
||||
|
||||
/* AnimOverride ------------------------------------- */
|
||||
|
||||
/**
|
||||
* Animation Override (aor)
|
||||
*
|
||||
* This is used to as temporary storage of values which have been changed by the user, but not
|
||||
* yet keyframed (thus, would get overwritten by the animation system before the user had a chance
|
||||
* to see the changes that were made).
|
||||
*
|
||||
* It is probably not needed for overriding keyframed values in most cases, as those will only get
|
||||
* evaluated on frame-change now. That situation may change in future.
|
||||
*/
|
||||
struct AnimOverride {
|
||||
struct AnimOverride *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** RNA-path to use to resolve data-access. */
|
||||
char *rna_path = nullptr;
|
||||
/** If applicable, the index of the RNA-array item to get. */
|
||||
int array_index = 0;
|
||||
|
||||
/** Value to override setting with. */
|
||||
float value = 0;
|
||||
};
|
||||
|
||||
/* AnimData ------------------------------------- */
|
||||
|
||||
/**
|
||||
* Animation data for some ID block (adt)
|
||||
*
|
||||
* This block of data is used to provide all of the necessary animation data for a data-block.
|
||||
* Currently, this data will not be reusable, as there shouldn't be any need to do so.
|
||||
*
|
||||
* This information should be made available for most if not all ID-blocks, which should
|
||||
* enable all of its settings to be animatable locally. Animation from 'higher-up' ID-AnimData
|
||||
* blocks may override local settings.
|
||||
*
|
||||
* This data-block should be placed immediately after the ID block where it is used, so that
|
||||
* the code which retrieves this data can do so in an easier manner.
|
||||
* See `blenkernel/intern/anim_sys.cc` for details.
|
||||
*/
|
||||
struct AnimData {
|
||||
/**
|
||||
* Active action - acts as the 'tweaking track' for the NLA.
|
||||
*
|
||||
* Never set this directly, use one of the assignment
|
||||
* functions in ANIM_action.hh instead.
|
||||
*/
|
||||
bAction *action = nullptr;
|
||||
|
||||
/**
|
||||
* Identifier for which ActionSlot of the above Action is actually animating this
|
||||
* data-block.
|
||||
*
|
||||
* Do not set this directly, use one of the assignment functions in ANIM_action.hh instead.
|
||||
*
|
||||
* This can be set to `animrig::Slot::unassigned` when no slot is assigned. Note that
|
||||
* this field being set to any other value does NOT guarantee that there is a slot with that
|
||||
* handle, as it might have been deleted from the Action.
|
||||
*/
|
||||
int32_t slot_handle = 0;
|
||||
/**
|
||||
* Slot name, primarily used for mapping to the right slot when assigning
|
||||
* another Action. Should be the same type as #ActionSlot::name.
|
||||
*
|
||||
* \see #ActionSlot::name
|
||||
*/
|
||||
char last_slot_identifier[/*MAX_ID_NAME*/ 258] = "";
|
||||
uint8_t _pad0[2] = {};
|
||||
|
||||
/**
|
||||
* Temp-storage for the 'real' active action + slot (i.e. the ones used before
|
||||
* NLA Tweak mode took over the Action to be edited in the Animation Editors).
|
||||
*/
|
||||
bAction *tmpact = nullptr;
|
||||
int32_t tmp_slot_handle = 0;
|
||||
char tmp_last_slot_identifier[/*MAX_ID_NAME*/ 258] = "";
|
||||
uint8_t _pad1[2] = {};
|
||||
|
||||
/* nla-tracks */
|
||||
ListBaseT<NlaTrack> nla_tracks = {nullptr, nullptr};
|
||||
/**
|
||||
* Active NLA-track
|
||||
* (only set/used during tweaking, so no need to worry about dangling pointers).
|
||||
*/
|
||||
NlaTrack *act_track = nullptr;
|
||||
/**
|
||||
* Active NLA-strip
|
||||
* (only set/used during tweaking, so no need to worry about dangling pointers).
|
||||
*/
|
||||
NlaStrip *actstrip = nullptr;
|
||||
|
||||
/* 'drivers' for this ID-block's settings - FCurves, but are completely
|
||||
* separate from those for animation data
|
||||
*/
|
||||
/** Standard user-created Drivers/Expressions (used as part of a rig). */
|
||||
ListBaseT<FCurve> drivers = {nullptr, nullptr};
|
||||
/** Temp storage (AnimOverride) of values for settings that are animated
|
||||
* (but the value hasn't been keyframed). */
|
||||
ListBaseT<AnimOverride> overrides = {nullptr, nullptr};
|
||||
|
||||
/** Runtime data, for depsgraph evaluation. */
|
||||
FCurve **driver_array = nullptr;
|
||||
|
||||
/* settings for animation evaluation */
|
||||
/** User-defined settings. */
|
||||
eAnimData_Flag flag = {};
|
||||
|
||||
/* settings for active action evaluation (based on NLA strip settings) */
|
||||
/** Accumulation mode for active action. */
|
||||
eNlaStrip_Blend_Mode act_blendmode = {};
|
||||
/** Extrapolation mode for active action. */
|
||||
eNlaStrip_Extrapolate_Mode act_extendmode = {};
|
||||
/** Influence for active action. */
|
||||
float act_influence = 0;
|
||||
|
||||
uint8_t _pad2[4] = {};
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* Some static assertions that things that should have the same type actually do. */
|
||||
static_assert(std::is_same_v<decltype(ActionSlot::handle), decltype(AnimData::slot_handle)>);
|
||||
static_assert(
|
||||
std::is_same_v<decltype(ActionSlot::identifier), decltype(AnimData::last_slot_identifier)>);
|
||||
#endif
|
||||
|
||||
/* Base Struct for Anim ------------------------------------- */
|
||||
|
||||
/**
|
||||
* Used for #BKE_animdata_from_id()
|
||||
* All ID-data-blocks which have their own 'local' AnimData
|
||||
* should have the same arrangement in their structs.
|
||||
*/
|
||||
struct IdAdtTemplate {
|
||||
ID id;
|
||||
AnimData *adt = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
605
blender-5.2.0/source/blender/makesdna/DNA_armature_types.h
Normal file
605
blender-5.2.0/source/blender/makesdna/DNA_armature_types.h
Normal file
@@ -0,0 +1,605 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_theme_types.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_span.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace animrig {
|
||||
class BoneColor;
|
||||
}
|
||||
|
||||
namespace bke {
|
||||
struct bArmature_Runtime;
|
||||
}
|
||||
|
||||
struct AnimData;
|
||||
struct BoneCollection;
|
||||
struct BoneCollectionMember;
|
||||
struct BoneCollectionReference;
|
||||
struct EditBone;
|
||||
|
||||
/* armature->flag */
|
||||
/* don't use bit 7, was saved in files to disable stuff */
|
||||
enum eArmature_Flag : int {
|
||||
ARM_RESTPOS = (1 << 0),
|
||||
/** XRAY is here only for backwards converting */
|
||||
ARM_FLAG_UNUSED_1 = (1 << 1), /* cleared */
|
||||
ARM_DRAWAXES = (1 << 2),
|
||||
ARM_DRAWNAMES = (1 << 3),
|
||||
/* ARM_POSEMODE = (1 << 4), Deprecated. */
|
||||
/** Position of the parent-child relation lines on the bone (cleared = drawn
|
||||
* from the tail, set = drawn from the head). Only controls the parent side of
|
||||
* the line; the child side is always drawn to the head of the bone. */
|
||||
ARM_DRAW_RELATION_FROM_HEAD = (1 << 5), /* Cleared in versioning of pre-2.80 files. */
|
||||
/**
|
||||
* Whether any bone collection is marked with the 'solo' flag.
|
||||
* When this is the case, bone collection visibility flags don't matter any more, and only ones
|
||||
* that have their 'solo' flag set will be visible.
|
||||
*
|
||||
* \see eBoneCollection_Flag::BONE_COLLECTION_SOLO */
|
||||
ARM_BCOLL_SOLO_ACTIVE = (1 << 6), /* Cleared in versioning of pre-2.80 files. */
|
||||
ARM_FLAG_UNUSED_7 = (1 << 7), /* cleared */
|
||||
ARM_MIRROR_EDIT = (1 << 8),
|
||||
ARM_FLAG_UNUSED_9 = (1 << 9),
|
||||
/** Made option negative, for backwards compatibility. */
|
||||
ARM_NO_CUSTOM = (1 << 10),
|
||||
/** Draw custom colors. */
|
||||
ARM_COL_CUSTOM = (1 << 11),
|
||||
/** When ghosting, only show selected bones (this should belong to ghostflag instead). */
|
||||
ARM_FLAG_UNUSED_12 = (1 << 12), /* cleared */
|
||||
/** Dope-sheet channel is expanded */
|
||||
ARM_DS_EXPAND = (1 << 13),
|
||||
/** Other objects are used for visualizing various states (hack for efficient updates). */
|
||||
ARM_HAS_VIZ_DEPS = (1 << 14),
|
||||
};
|
||||
ENUM_OPERATORS(eArmature_Flag);
|
||||
|
||||
/* armature->drawtype */
|
||||
enum eArmature_Drawtype : int {
|
||||
ARM_DRAW_TYPE_ARMATURE_DEFINED = -1, /* Use draw type from Armature (only used on Bones). */
|
||||
ARM_DRAW_TYPE_OCTA = 0,
|
||||
ARM_DRAW_TYPE_STICK = 1,
|
||||
ARM_DRAW_TYPE_B_BONE = 2,
|
||||
ARM_DRAW_TYPE_ENVELOPE = 3,
|
||||
ARM_DRAW_TYPE_WIRE = 4,
|
||||
};
|
||||
|
||||
/* armature->deformflag */
|
||||
enum eArmature_DeformFlag : short {
|
||||
ARM_DEF_VGROUP = (1 << 0),
|
||||
ARM_DEF_ENVELOPE = (1 << 1),
|
||||
ARM_DEF_QUATERNION = (1 << 2),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
ARM_DEF_B_BONE_REST = (1 << 3), /* deprecated */
|
||||
#endif
|
||||
ARM_DEF_INVERT_VGROUP = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eArmature_DeformFlag)
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW /* Old animation system (armature only viz). */
|
||||
/** #bArmature.pathflag */
|
||||
enum eArmature_PathFlag : short {
|
||||
ARM_PATH_FNUMS = (1 << 0),
|
||||
ARM_PATH_KFRAS = (1 << 1),
|
||||
ARM_PATH_HEADS = (1 << 2),
|
||||
ARM_PATH_ACFRA = (1 << 3),
|
||||
ARM_PATH_KFNOS = (1 << 4),
|
||||
};
|
||||
#endif
|
||||
|
||||
/* bone->flag */
|
||||
enum eBone_Flag : int {
|
||||
/**
|
||||
* Bone selection, must only be set when the bone is not hidden
|
||||
* (#BONE_HIDDEN_A / #BONE_HIDDEN_P flags must not be enabled as well).
|
||||
*
|
||||
* However the bone may not be visible to the user since the bones collection
|
||||
* may be hidden.
|
||||
* In most cases `animrig::bone_is_visible` or
|
||||
* `animrig::bone_is_visible` should be used to check if the bone is visible to
|
||||
* the user before operating on them.
|
||||
*/
|
||||
BONE_SELECTED = (1 << 0),
|
||||
BONE_ROOTSEL = (1 << 1),
|
||||
BONE_TIPSEL = (1 << 2),
|
||||
/** Used instead of BONE_SELECTED during transform (clear before use) */
|
||||
BONE_TRANSFORM = (1 << 3),
|
||||
/** When bone has a parent, connect head of bone to parent's tail. */
|
||||
BONE_CONNECTED = (1 << 4),
|
||||
/* 32 used to be quatrot, was always set in files, do not reuse unless you clear it always */
|
||||
/**
|
||||
* Hidden Bones when drawing PoseChannels.
|
||||
* When set #BONE_SELECTED must be cleared.
|
||||
*/
|
||||
BONE_HIDDEN_P = (1 << 6),
|
||||
/** For detecting cyclic dependencies */
|
||||
BONE_DONE = (1 << 7),
|
||||
/** active is on mouse clicks only - deprecated, ONLY USE FOR DRAWING */
|
||||
BONE_DRAW_ACTIVE = (1 << 8),
|
||||
/** No parent rotation or scale */
|
||||
BONE_HINGE = (1 << 9),
|
||||
/**
|
||||
* Hidden Bones when drawing Armature edit-mode.
|
||||
* When set, selection flags (#BONE_SELECTED, #BONE_ROOTSEL & BONE_TIPSEL) must be cleared.
|
||||
*/
|
||||
BONE_HIDDEN_A = (1 << 10),
|
||||
/** multiplies vgroup with envelope */
|
||||
BONE_MULT_VG_ENV = (1 << 11),
|
||||
/** bone doesn't deform geometry */
|
||||
BONE_NO_DEFORM = (1 << 12),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** set to prevent destruction of its unkeyframed pose (after transform) */
|
||||
BONE_UNKEYED = (1 << 13),
|
||||
/** set to prevent hinge child bones from influencing the transform center */
|
||||
BONE_HINGE_CHILD_TRANSFORM = (1 << 14),
|
||||
/** No parent scale */
|
||||
BONE_NO_SCALE = (1 << 15),
|
||||
#endif
|
||||
/** bone should be drawn as OB_WIRE, regardless of draw-types of view+armature */
|
||||
BONE_DRAWWIRE = (1 << 17),
|
||||
/** when no parent, bone will not get cyclic offset */
|
||||
BONE_NO_CYCLICOFFSET = (1 << 18),
|
||||
/** bone transforms are locked in EditMode */
|
||||
BONE_EDITMODE_LOCKED = (1 << 19),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** Indicates that a parent is also being transformed */
|
||||
BONE_TRANSFORM_CHILD = (1 << 20),
|
||||
#endif
|
||||
/** bone cannot be selected */
|
||||
BONE_UNSELECTABLE = (1 << 21),
|
||||
/** bone location is in armature space */
|
||||
BONE_NO_LOCAL_LOCATION = (1 << 22),
|
||||
/** object child will use relative transform (like deform) */
|
||||
BONE_RELATIVE_PARENTING = (1 << 23),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** it will add the parent end roll to the inroll */
|
||||
BONE_ADD_PARENT_END_ROLL = (1 << 24),
|
||||
#endif
|
||||
/** this bone was transformed by the mirror function */
|
||||
BONE_TRANSFORM_MIRROR = (1 << 25),
|
||||
/** this bone is associated with a locked vertex group, ONLY USE FOR DRAWING */
|
||||
BONE_DRAW_LOCKED_WEIGHT = (1 << 26),
|
||||
};
|
||||
ENUM_OPERATORS(eBone_Flag)
|
||||
|
||||
/* bone->inherit_scale_mode */
|
||||
enum eBone_InheritScaleMode : char {
|
||||
/* Inherit all scale and shear. */
|
||||
BONE_INHERIT_SCALE_FULL = 0,
|
||||
/* Inherit scale, but remove final shear. */
|
||||
BONE_INHERIT_SCALE_FIX_SHEAR = 1,
|
||||
/* Inherit average scale. */
|
||||
BONE_INHERIT_SCALE_AVERAGE = 2,
|
||||
/* Inherit no scale or shear. */
|
||||
BONE_INHERIT_SCALE_NONE = 3,
|
||||
/* Inherit effects of shear on parent (same as old disabled Inherit Scale). */
|
||||
BONE_INHERIT_SCALE_NONE_LEGACY = 4,
|
||||
/* Inherit parent X scale as child X scale etc. */
|
||||
BONE_INHERIT_SCALE_ALIGNED = 5,
|
||||
};
|
||||
|
||||
/* bone->bbone_prev_type, bbone_next_type */
|
||||
enum eBone_BBoneHandleType : char {
|
||||
BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
|
||||
BBONE_HANDLE_ABSOLUTE = 1, /* Custom handle in absolute position mode. */
|
||||
BBONE_HANDLE_RELATIVE = 2, /* Custom handle in relative position mode. */
|
||||
BBONE_HANDLE_TANGENT = 3, /* Custom handle in tangent mode (use direction, not location). */
|
||||
};
|
||||
|
||||
/* bone->bbone_mapping_mode */
|
||||
enum eBone_BBoneMappingMode : char {
|
||||
BBONE_MAPPING_STRAIGHT = 0, /* Default mode that ignores the rest pose curvature. */
|
||||
BBONE_MAPPING_CURVED = 1, /* Mode that takes the rest pose curvature into account. */
|
||||
};
|
||||
|
||||
/* bone->bbone_flag */
|
||||
enum eBone_BBoneFlag : int {
|
||||
/** Add the parent Out roll to the In roll. */
|
||||
BBONE_ADD_PARENT_END_ROLL = (1 << 0),
|
||||
/** Multiply B-Bone easing values with Scale Length. */
|
||||
BBONE_SCALE_EASING = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eBone_BBoneFlag)
|
||||
|
||||
/* bone->bbone_prev/next_flag */
|
||||
enum eBone_BBoneHandleFlag : short {
|
||||
/** Use handle bone scaling for scale X. */
|
||||
BBONE_HANDLE_SCALE_X = (1 << 0),
|
||||
/** Use handle bone scaling for scale Y (length). */
|
||||
BBONE_HANDLE_SCALE_Y = (1 << 1),
|
||||
/** Use handle bone scaling for scale Z. */
|
||||
BBONE_HANDLE_SCALE_Z = (1 << 2),
|
||||
/** Use handle bone scaling for easing. */
|
||||
BBONE_HANDLE_SCALE_EASE = (1 << 3),
|
||||
/** Is handle scale required? */
|
||||
BBONE_HANDLE_SCALE_ANY = BBONE_HANDLE_SCALE_X | BBONE_HANDLE_SCALE_Y | BBONE_HANDLE_SCALE_Z |
|
||||
BBONE_HANDLE_SCALE_EASE,
|
||||
};
|
||||
|
||||
#define MAXBONENAME 64
|
||||
|
||||
/** #BoneCollection.flag */
|
||||
enum eBoneCollection_Flag : uint8_t {
|
||||
BONE_COLLECTION_VISIBLE = (1 << 0), /* Visibility flag of this particular collection. */
|
||||
BONE_COLLECTION_SELECTABLE = (1 << 1), /* Intended to be implemented in the not-so-far future. */
|
||||
BONE_COLLECTION_OVERRIDE_LIBRARY_LOCAL = (1 << 2), /* Added by a local library override. */
|
||||
|
||||
/**
|
||||
* Set when all ancestors are visible.
|
||||
*
|
||||
* This would actually be a runtime flag, but bone collections don't have a
|
||||
* runtime struct yet, and the addition of one more flag doesn't seem worth
|
||||
* the effort. */
|
||||
BONE_COLLECTION_ANCESTORS_VISIBLE = (1 << 3),
|
||||
|
||||
/**
|
||||
* Whether this bone collection is marked as 'solo'.
|
||||
*
|
||||
* If no bone collections have this flag set, visibility is determined by
|
||||
* BONE_COLLECTION_VISIBLE.
|
||||
*
|
||||
* If there is any bone collection with the BONE_COLLECTION_SOLO flag enabled, all bone
|
||||
* collections are effectively hidden, except other collections with this flag enabled.
|
||||
*
|
||||
* \see eArmature_Flag::ARM_BCOLL_SOLO_ACTIVE
|
||||
*/
|
||||
BONE_COLLECTION_SOLO = (1 << 4),
|
||||
|
||||
BONE_COLLECTION_EXPANDED = (1 << 5), /* Expanded in the tree view. */
|
||||
};
|
||||
ENUM_OPERATORS(eBoneCollection_Flag)
|
||||
|
||||
/* The Armature system works on different transformation space levels:
|
||||
*
|
||||
* 1) Bone Space: In the orientation of the parent bone, position relative
|
||||
* to the parent's tail. Same as Armature Space for bones
|
||||
* without parent.
|
||||
* 2) Armature Space: The bone's rest transform in Object space. This is the
|
||||
* multiplication of the bone space matrices of the bone and
|
||||
* all its ancestors.
|
||||
* 3) Pose Space: The bone's posed transform in Object space. This is the
|
||||
* same space as Armature Space, except that it represents
|
||||
* the current bone transform instead of the rest pose.
|
||||
* See bPoseChannel::pose_mat
|
||||
* 4) Channel Space: The bone's local transform relative to its rest transform.
|
||||
* See bPoseChannel::chan_mat
|
||||
*/
|
||||
|
||||
struct BoneColor {
|
||||
/**
|
||||
* Index of color palette to use when drawing bones.
|
||||
* 0=default, >0 = predefined in theme, -1=custom color in #custom.
|
||||
*
|
||||
* For the predefined ones, see #rna_enum_color_sets_items in rna_armature.c.
|
||||
*/
|
||||
int8_t palette_index = 0;
|
||||
uint8_t _pad0[7] = {};
|
||||
ThemeWireColor custom = {};
|
||||
#ifdef __cplusplus
|
||||
animrig::BoneColor &wrap();
|
||||
const animrig::BoneColor &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct Bone_Runtime {
|
||||
ListBaseT<BoneCollectionReference> collections = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
struct Bone {
|
||||
DNA_DEFINE_CXX_METHODS(Bone)
|
||||
|
||||
/** Next/previous elements within this list. */
|
||||
struct Bone *next = nullptr, *prev = nullptr;
|
||||
/** User-Defined Properties on this Bone. */
|
||||
IDProperty *prop = nullptr;
|
||||
/** System-Defined Properties storage. */
|
||||
IDProperty *system_properties = nullptr;
|
||||
void *_pad0 = nullptr;
|
||||
/** Parent (IK parent if appropriate flag is set). */
|
||||
struct Bone *parent = nullptr;
|
||||
/** Children. */
|
||||
ListBaseT<Bone> childbase = {nullptr, nullptr};
|
||||
/** Name of the bone - must be unique within the armature. */
|
||||
char name[/*MAXBONENAME*/ 64] = "";
|
||||
|
||||
/** Roll is input for edit-mode, length calculated. */
|
||||
float roll = 0;
|
||||
/** Head position in Bone Space (see top of this file). */
|
||||
float head[3] = {};
|
||||
/** Tail position in Bone Space (see top of this file). */
|
||||
float tail[3] = {};
|
||||
/**
|
||||
* Bone matrix in Bone Space (see top of this file).
|
||||
*
|
||||
* bone.matrix in RNA. Computed in BKE_armature_where_is_bone(). */
|
||||
float bone_mat[3][3] = {};
|
||||
|
||||
eBone_Flag flag = {};
|
||||
int8_t drawtype = ARM_DRAW_TYPE_ARMATURE_DEFINED; /* eArmature_Drawtype */
|
||||
char _pad1[3] = {};
|
||||
BoneColor color; /* MUST be named the same as in bPoseChannel and EditBone structs. */
|
||||
|
||||
eBone_InheritScaleMode inherit_scale_mode = {};
|
||||
char _pad[3] = {};
|
||||
|
||||
/** Head position in armature space. So should be the same as head in edit mode. */
|
||||
float arm_head[3] = {};
|
||||
/** Tail position in armature space. So should be the same as tail in edit mode. */
|
||||
float arm_tail[3] = {};
|
||||
/** Matrix: `(bone_mat(b)+head(b))*arm_mat(b-1)`, rest pose in armature space. */
|
||||
float arm_mat[4][4] = {};
|
||||
/** Roll in Armature Space (rest pose). */
|
||||
float arm_roll = 0;
|
||||
|
||||
/** Envelope distance, added to rad_head / rad_tail. */
|
||||
float dist = 0;
|
||||
/** Weight: for non-deformgroup deforms. */
|
||||
float weight = 0;
|
||||
/**
|
||||
* The width for block bones. The final X/Z bone widths are double these values.
|
||||
*
|
||||
* \note keep in this order for transform code which stores a pointer to `xwidth`,
|
||||
* accessing length and `zwidth` as offsets.
|
||||
*/
|
||||
float xwidth = 0, length = 0, zwidth = 0;
|
||||
/**
|
||||
* Radius for head/tail sphere, defining deform as well,
|
||||
* `parent->rad_tip` overrides `rad_head`.
|
||||
*/
|
||||
float rad_head = 0, rad_tail = 0;
|
||||
|
||||
/** Curved bones settings - these define the "rest-pose" for a curved bone. */
|
||||
float roll1 = 0, roll2 = 0;
|
||||
float curve_in_x = 0, curve_in_z = 0;
|
||||
float curve_out_x = 0, curve_out_z = 0;
|
||||
/** Length of bezier handles. */
|
||||
float ease1 = 0, ease2 = 0;
|
||||
DNA_DEPRECATED float scale_in_x = 0;
|
||||
DNA_DEPRECATED float scale_in_z = 0;
|
||||
DNA_DEPRECATED float scale_out_x = 0;
|
||||
DNA_DEPRECATED float scale_out_z = 0;
|
||||
float scale_in[3] = {1.0f, 1.0f, 1.0f};
|
||||
float scale_out[3] = {1.0f, 1.0f, 1.0f};
|
||||
|
||||
/** Patch for upward compatibility, UNUSED! */
|
||||
float size[3] = {};
|
||||
/** Layers that bone appears on. */
|
||||
int layer = 0;
|
||||
/** For B-bones. */
|
||||
short segments = 0;
|
||||
/** Vertex to segment mapping mode. */
|
||||
eBone_BBoneMappingMode bbone_mapping_mode = {};
|
||||
char _pad2[7] = {};
|
||||
|
||||
/** Type of next/prev bone handles. */
|
||||
eBone_BBoneHandleType bbone_prev_type = {};
|
||||
eBone_BBoneHandleType bbone_next_type = {};
|
||||
/** B-Bone flags. */
|
||||
eBone_BBoneFlag bbone_flag = {};
|
||||
eBone_BBoneHandleFlag bbone_prev_flag = {};
|
||||
eBone_BBoneHandleFlag bbone_next_flag = {};
|
||||
/** Next/prev bones to use as handle references when calculating bbones (optional). */
|
||||
struct Bone *bbone_prev = nullptr;
|
||||
struct Bone *bbone_next = nullptr;
|
||||
|
||||
/* Keep last. */
|
||||
Bone_Runtime runtime;
|
||||
};
|
||||
|
||||
struct bArmature {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(bArmature)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_AR;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** Root bones. Children are listed in Bone::childbase. */
|
||||
ListBaseT<Bone> bonebase = {nullptr, nullptr};
|
||||
|
||||
/** Use a hash-table for quicker lookups of bones by name. */
|
||||
struct GHash *bonehash = nullptr;
|
||||
void *_pad1 = nullptr;
|
||||
|
||||
/** #EditBone list (use an allocated pointer so the state can be checked). */
|
||||
ListBaseT<EditBone> *edbo = nullptr;
|
||||
|
||||
/* active bones should work like active object where possible
|
||||
* - active and selection are unrelated
|
||||
* - active & hidden is not allowed
|
||||
* - from the user perspective active == last selected
|
||||
* - active should be ignored when not visible (hidden layer) */
|
||||
|
||||
/** Active bone. */
|
||||
Bone *act_bone = nullptr;
|
||||
/** Active edit-bone (in edit-mode). */
|
||||
struct EditBone *act_edbone = nullptr;
|
||||
|
||||
/** ID data is older than edit-mode data (TODO: move to edit-mode struct). */
|
||||
char needs_flush_to_id = 0;
|
||||
char _pad0[3] = {};
|
||||
|
||||
eArmature_Flag flag = ARM_COL_CUSTOM;
|
||||
eArmature_Drawtype drawtype = ARM_DRAW_TYPE_OCTA;
|
||||
|
||||
eArmature_DeformFlag deformflag = ARM_DEF_VGROUP | ARM_DEF_ENVELOPE;
|
||||
short pathflag = 0;
|
||||
|
||||
/** This is used only for reading/writing BoneCollections in blend
|
||||
* files, for forwards/backwards compatibility with Blender 4.0. It
|
||||
* should always be empty at runtime. Use collection_array for
|
||||
* everything other than file reading/writing.
|
||||
* TODO: remove this in Blender 5.0, and instead write the contents of
|
||||
* collection_array to blend files directly. */
|
||||
ListBaseT<BoneCollection> collections_legacy = {nullptr, nullptr};
|
||||
|
||||
struct BoneCollection **collection_array =
|
||||
nullptr; /* Array of `collection_array_num` BoneCollections. */
|
||||
int collection_array_num = 0;
|
||||
/**
|
||||
* Number of root bone collections.
|
||||
*
|
||||
* `collection_array[0:collection_root_count]` are the collections without a parent collection.
|
||||
*/
|
||||
int collection_root_count = 0;
|
||||
|
||||
/** Do not directly assign, use `ANIM_armature_bonecoll_active_set` instead.
|
||||
* This is stored as a string to make it possible for the library overrides system to understand
|
||||
* when it actually changed (compared to a BoneCollection*, which would change on every load).
|
||||
*/
|
||||
char active_collection_name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** For UI, to show which layers are there. */
|
||||
DNA_DEPRECATED unsigned int layer_used = 0;
|
||||
/** For buttons to work, both variables in this order together. */
|
||||
DNA_DEPRECATED unsigned int layer = 1;
|
||||
DNA_DEPRECATED unsigned int layer_protected = 0;
|
||||
|
||||
/** Relative position of the axes on the bone, from head (0.0f) to tail (1.0f). */
|
||||
float axes_position = 0;
|
||||
|
||||
/** Keep last, for consistency with the position of other DNA runtime structures. */
|
||||
bke::bArmature_Runtime *runtime = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* Collection array access for convenient for-loop iteration. */
|
||||
Span<const BoneCollection *> collections_span() const;
|
||||
Span<BoneCollection *> collections_span();
|
||||
|
||||
/* Span of all root collections. */
|
||||
Span<const BoneCollection *> collections_roots() const;
|
||||
Span<BoneCollection *> collections_roots();
|
||||
|
||||
/* Return the span of children of the given bone collection. */
|
||||
Span<const BoneCollection *> collection_children(const BoneCollection *parent) const;
|
||||
Span<BoneCollection *> collection_children(BoneCollection *parent);
|
||||
|
||||
const Bone *bone_get_indexed(int64_t bone_index) const;
|
||||
Bone *bone_get_indexed(int64_t bone_index);
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Collection of Bones within an Armature.
|
||||
*
|
||||
* BoneCollections are owned by their Armature, and cannot be shared between
|
||||
* different armatures.
|
||||
*
|
||||
* Bones can be in more than one collection at a time.
|
||||
*
|
||||
* Selectability and visibility of bones are determined by OR-ing the collection
|
||||
* flags.
|
||||
*/
|
||||
struct BoneCollection {
|
||||
struct BoneCollection *next = nullptr, *prev = nullptr;
|
||||
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
ListBaseT<BoneCollectionMember> bones = {nullptr, nullptr};
|
||||
|
||||
eBoneCollection_Flag flags = {};
|
||||
uint8_t _pad0[7] = {};
|
||||
|
||||
/*
|
||||
* Hierarchy information. The Armature has an array of BoneCollection pointers. These are ordered
|
||||
* such that siblings are always stored in consecutive array elements.
|
||||
*/
|
||||
/** Array index of the first child of this BoneCollection. */
|
||||
int child_index = 0;
|
||||
/** Number of children of this BoneCollection. */
|
||||
int child_count = 0;
|
||||
|
||||
/** Custom properties. */
|
||||
struct IDProperty *prop = nullptr;
|
||||
/** Custom system IDProperties. */
|
||||
struct IDProperty *system_properties = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/**
|
||||
* Return whether this collection is marked as 'visible'.
|
||||
*
|
||||
* Note that its effective visibility depends on the visibility of its ancestors as well.
|
||||
*
|
||||
* \see is_visible_with_ancestors
|
||||
* \see ANIM_bonecoll_show
|
||||
* \see ANIM_bonecoll_hide
|
||||
*/
|
||||
bool is_visible() const;
|
||||
|
||||
/**
|
||||
* Return whether this collection's ancestors are visible or not.
|
||||
*
|
||||
* \see is_visible_with_ancestors
|
||||
*/
|
||||
bool is_visible_ancestors() const;
|
||||
|
||||
/**
|
||||
* Return whether this collection is visible, taking into account the
|
||||
* visibility of its ancestors.
|
||||
*
|
||||
* \return true when this collection and all its ancestors are visible.
|
||||
*
|
||||
* \see is_visible
|
||||
*/
|
||||
bool is_visible_with_ancestors() const;
|
||||
|
||||
/**
|
||||
* Return whether this collection is marked as 'solo'.
|
||||
*/
|
||||
bool is_solo() const;
|
||||
/**
|
||||
* Whether or not this bone collection is expanded in the tree view.
|
||||
*
|
||||
* This corresponds to the #BONE_COLLECTION_EXPANDED flag.
|
||||
*/
|
||||
bool is_expanded() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/** Membership relation of a bone with a bone collection. */
|
||||
struct BoneCollectionMember {
|
||||
struct BoneCollectionMember *next = nullptr, *prev = nullptr;
|
||||
struct Bone *bone = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Membership relation of a bone with its collections.
|
||||
*
|
||||
* This is only bone-runtime data for easy lookups, the actual membership is
|
||||
* stored on the #bArmature in #BoneCollectionMember structs.
|
||||
*/
|
||||
struct BoneCollectionReference {
|
||||
struct BoneCollectionReference *next = nullptr, *prev = nullptr;
|
||||
struct BoneCollection *bcoll = nullptr;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline animrig::BoneColor &BoneColor::wrap()
|
||||
{
|
||||
return *reinterpret_cast<animrig::BoneColor *>(this);
|
||||
}
|
||||
inline const animrig::BoneColor &BoneColor::wrap() const
|
||||
{
|
||||
return *reinterpret_cast<const animrig::BoneColor *>(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace blender
|
||||
129
blender-5.2.0/source/blender/makesdna/DNA_array_utils.hh
Normal file
129
blender-5.2.0/source/blender/makesdna/DNA_array_utils.hh
Normal file
@@ -0,0 +1,129 @@
|
||||
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Contains functions that help dealing with arrays that are stored in DNA. Due to the constraints
|
||||
* of DNA, all structs are trivial from the language's point of view (`std::is_trivial_v`).
|
||||
* However, semantically, these types may have non-trivial copy-constructors and destructors.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_function_ref.hh"
|
||||
#include "BLI_index_range.hh"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
namespace blender::dna::array {
|
||||
|
||||
/**
|
||||
* Removes an element from the array and shifts the elements after it towards the front.
|
||||
*/
|
||||
template<typename T>
|
||||
inline void remove_index(
|
||||
T **items, int *items_num, int *active_index, const int index, void (*destruct_item)(T *))
|
||||
{
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
BLI_assert(index >= 0);
|
||||
BLI_assert(index < *items_num);
|
||||
|
||||
const int old_items_num = *items_num;
|
||||
const int new_items_num = old_items_num - 1;
|
||||
|
||||
T *old_items = *items;
|
||||
T *new_items = MEM_new_array<T>(new_items_num, __func__);
|
||||
|
||||
std::copy_n(old_items, index, new_items);
|
||||
std::copy_n(old_items + index + 1, old_items_num - index - 1, new_items + index);
|
||||
|
||||
destruct_item(&old_items[index]);
|
||||
MEM_delete(old_items);
|
||||
|
||||
*items = new_items;
|
||||
*items_num = new_items_num;
|
||||
|
||||
if (active_index) {
|
||||
const int old_active_index = active_index ? *active_index : 0;
|
||||
const int new_active_index = std::max(
|
||||
0, old_active_index == new_items_num ? new_items_num - 1 : old_active_index);
|
||||
*active_index = new_active_index;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all elements for which the predicate is true. The remaining ones stay in the order they
|
||||
* were in before.
|
||||
*/
|
||||
template<typename T>
|
||||
inline void remove_if(T **items,
|
||||
int *items_num,
|
||||
FunctionRef<bool(const T &)> predicate,
|
||||
void (*destruct_item)(T *))
|
||||
{
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
/* This sorts the items-to-remove to the back. */
|
||||
const int remaining = std::stable_partition(*items,
|
||||
*items + *items_num,
|
||||
[&](const T &value) { return !predicate(value); }) -
|
||||
*items;
|
||||
for (const int i : IndexRange::from_begin_end(remaining, *items_num)) {
|
||||
destruct_item(&(*items)[i]);
|
||||
}
|
||||
*items_num = remaining;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all elements from an array and frees it.
|
||||
*/
|
||||
template<typename T>
|
||||
inline void clear(T **items, int *items_num, int *active_index, void (*destruct_item)(T *))
|
||||
{
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
for (const int i : IndexRange(*items_num)) {
|
||||
destruct_item(&(*items)[i]);
|
||||
}
|
||||
MEM_SAFE_DELETE(*items);
|
||||
*items_num = 0;
|
||||
if (active_index) {
|
||||
*active_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves one element from one index to another, moving other elements if necessary.
|
||||
*/
|
||||
template<typename T>
|
||||
inline void move_index(T *items, const int items_num, const int from_index, const int to_index)
|
||||
{
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
BLI_assert(from_index >= 0);
|
||||
BLI_assert(from_index < items_num);
|
||||
BLI_assert(to_index >= 0);
|
||||
BLI_assert(to_index < items_num);
|
||||
UNUSED_VARS_NDEBUG(items_num);
|
||||
|
||||
if (from_index == to_index) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (from_index < to_index) {
|
||||
const T tmp = items[from_index];
|
||||
for (int i = from_index; i < to_index; i++) {
|
||||
items[i] = items[i + 1];
|
||||
}
|
||||
items[to_index] = tmp;
|
||||
}
|
||||
else if (from_index > to_index) {
|
||||
const T tmp = items[from_index];
|
||||
for (int i = from_index; i > to_index; i--) {
|
||||
items[i] = items[i - 1];
|
||||
}
|
||||
items[to_index] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace blender::dna::array
|
||||
234
blender-5.2.0/source/blender/makesdna/DNA_asset_types.h
Normal file
234
blender-5.2.0/source/blender/makesdna/DNA_asset_types.h
Normal file
@@ -0,0 +1,234 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_uuid_types.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace blender {
|
||||
|
||||
class StringRef;
|
||||
namespace asset_system {
|
||||
class AssetLibrary;
|
||||
} // namespace asset_system
|
||||
|
||||
enum eAssetLibraryType : short {
|
||||
/** Display assets from the current session (current "Main"). */
|
||||
ASSET_LIBRARY_LOCAL = 1,
|
||||
ASSET_LIBRARY_ALL = 2,
|
||||
/** Display assets bundled with Blender by default. */
|
||||
ASSET_LIBRARY_ESSENTIALS = 3,
|
||||
/** Additions to the essentials library that are stored online - displayed in the UI as part of
|
||||
* the normal essentials library. */
|
||||
ASSET_LIBRARY_ONLINE_ESSENTIALS = 4,
|
||||
|
||||
/** Display assets from custom asset libraries, as defined in the preferences
|
||||
* (#bUserAssetLibrary). The name will be taken from #FileSelectParams.asset_library_ref.idname
|
||||
* then.
|
||||
* In RNA, we add the index of the custom library to this to identify it by index. So keep
|
||||
* this last! */
|
||||
ASSET_LIBRARY_CUSTOM = 100,
|
||||
};
|
||||
|
||||
enum eAssetImportMethod : int {
|
||||
/** Regular data-block linking. */
|
||||
ASSET_IMPORT_LINK = 0,
|
||||
/** Regular data-block appending (basically linking + "Make Local"). */
|
||||
ASSET_IMPORT_APPEND = 1,
|
||||
/** Append data-block with the #BLO_LIBLINK_APPEND_LOCAL_ID_REUSE flag enabled. Some typically
|
||||
* heavy data dependencies (e.g. the image data-blocks of a material, the mesh of an object) may
|
||||
* be reused from an earlier append. */
|
||||
ASSET_IMPORT_APPEND_REUSE = 2,
|
||||
/** Link data-block, but also pack it as read-only data. */
|
||||
ASSET_IMPORT_PACK = 3,
|
||||
};
|
||||
|
||||
enum eAssetLibrary_Flag : int {
|
||||
ASSET_LIBRARY_RELATIVE_PATH = (1 << 0),
|
||||
ASSET_LIBRARY_DISABLED = (1 << 1),
|
||||
ASSET_LIBRARY_USE_REMOTE_URL = (1 << 2),
|
||||
};
|
||||
|
||||
enum class AssetAccess : int8_t {
|
||||
OnlineAndOffline = 0,
|
||||
OnlyOnline = 1,
|
||||
OnlyOffline = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief User defined tag.
|
||||
* Currently only used by assets, could be used more often at some point.
|
||||
* Maybe add a custom icon and color to these in future?
|
||||
*/
|
||||
struct AssetTag {
|
||||
struct AssetTag *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
};
|
||||
|
||||
enum AssetMetaDataFlag : int {
|
||||
/**
|
||||
* When the import method is set to "Follow Asset or Preferences", use the asset's own import
|
||||
* method instead of the one from the library. Not used often, but for some assets there's a
|
||||
* specific preferred import method. For example, base mesh objects may always want to use
|
||||
* appending, so they can be edited directly and independently from previous usages.
|
||||
*/
|
||||
ASSETDATA_USE_OWN_IMPORT_METHOD = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(AssetMetaDataFlag);
|
||||
|
||||
/**
|
||||
* \brief The meta-data of an asset.
|
||||
* By creating and giving this for a data-block (#ID.asset_data), the data-block becomes an asset.
|
||||
*
|
||||
* \note This struct must be readable without having to read anything but blocks from the ID it is
|
||||
* attached to! That way, asset information of a file can be read, without reading anything
|
||||
* more than that from the file. So pointers to other IDs or ID data are strictly forbidden.
|
||||
*/
|
||||
struct AssetMetaData {
|
||||
/** Runtime type, to reference event callbacks. Only valid for local assets. */
|
||||
struct AssetTypeInfo *local_type_info = nullptr;
|
||||
|
||||
/** Custom asset meta-data. Cannot store pointers to IDs (#STRUCT_NO_DATABLOCK_IDPROPERTIES)! */
|
||||
struct IDProperty *properties = nullptr;
|
||||
|
||||
/**
|
||||
* Asset Catalog identifier. Should not contain spaces.
|
||||
* Mapped to a path in the asset catalog hierarchy by an #AssetCatalogService.
|
||||
* Use #BKE_asset_metadata_catalog_id_set() to ensure a valid ID is set.
|
||||
*/
|
||||
struct bUUID catalog_id;
|
||||
/**
|
||||
* Short name of the asset's catalog. This is for debugging purposes only, to allow (partial)
|
||||
* reconstruction of asset catalogs in the unfortunate case that the mapping from catalog UUID to
|
||||
* catalog path is lost. The catalog's simple name is copied to #catalog_simple_name whenever
|
||||
* #catalog_id is updated. */
|
||||
char catalog_simple_name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** Optional name of the author for display in the UI. Dynamic length. */
|
||||
char *author = nullptr;
|
||||
|
||||
/** Optional description of this asset for display in the UI. Dynamic length. */
|
||||
char *description = nullptr;
|
||||
|
||||
/** Optional copyright of this asset for display in the UI. Dynamic length. */
|
||||
char *copyright = nullptr;
|
||||
|
||||
/** Optional license of this asset for display in the UI. Dynamic length. */
|
||||
char *license = nullptr;
|
||||
|
||||
/** User defined tags for this asset. The asset manager uses these for filtering, but how they
|
||||
* function exactly (e.g. how they are registered to provide a list of searchable available tags)
|
||||
* is up to the asset-engine. */
|
||||
ListBaseT<AssetTag> tags = {nullptr, nullptr};
|
||||
short active_tag = 0;
|
||||
/** Store the number of tags to avoid continuous counting. Could be turned into runtime data, we
|
||||
* can always reliably reconstruct it from the list. */
|
||||
short tot_tags = 0;
|
||||
|
||||
AssetMetaDataFlag flag = {};
|
||||
|
||||
/** The import method to use when "Follow Asset or Preferences" is used and
|
||||
* #AssetMetaDataFlag::ASSETDATA_USE_OWN_IMPORT_METHOD is set in the flags above. */
|
||||
eAssetImportMethod preferred_import_method = ASSET_IMPORT_APPEND;
|
||||
|
||||
char _pad[4] = {};
|
||||
|
||||
#if defined(__cplusplus) && !defined(DNA_NO_EXTERNAL_CONSTRUCTORS)
|
||||
AssetMetaData() = default;
|
||||
AssetMetaData(const AssetMetaData &other);
|
||||
AssetMetaData(AssetMetaData &&other);
|
||||
/** Enables use with `std::unique_ptr<AssetMetaData>`. */
|
||||
~AssetMetaData();
|
||||
#endif
|
||||
};
|
||||
|
||||
#
|
||||
#
|
||||
struct AssetImportSettings {
|
||||
eAssetImportMethod method = {};
|
||||
bool use_instance_collections = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information to identify an asset library. May be either one of the predefined types (current
|
||||
* 'Main', builtin library, project library), or a custom type as defined in the Preferences.
|
||||
*
|
||||
* If the type is set to #ASSET_LIBRARY_CUSTOM, `custom_library_index` must be set to identify the
|
||||
* custom library. Otherwise it is not used.
|
||||
*/
|
||||
struct AssetLibraryReference {
|
||||
eAssetLibraryType type = ASSET_LIBRARY_LOCAL;
|
||||
char _pad1[2] = {};
|
||||
/**
|
||||
* If showing a custom asset library (#ASSET_LIBRARY_CUSTOM), this is the index of the
|
||||
* #bUserAssetLibrary within #UserDef.asset_libraries.
|
||||
* Should be ignored otherwise (but better set to -1 then, for sanity and debugging).
|
||||
*/
|
||||
int custom_library_index = -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information to refer to an asset (may be stored in files) on a "best effort" basis. It should
|
||||
* work well enough for many common cases, but can break. For example when the location of the
|
||||
* asset changes, the available asset libraries in the Preferences change, an asset library is
|
||||
* renamed, or when a file storing this is opened on a different system (with different
|
||||
* Preferences).
|
||||
*
|
||||
* It has two main components:
|
||||
* - A reference to the asset library: The #eAssetLibraryType and if that is not enough to identify
|
||||
* the library, a library name (typically given by the user, but may change).
|
||||
* - An identifier for the asset within the library: A relative path currently, which can break if
|
||||
* the asset is moved. Could also be a unique key for a database for example.
|
||||
*
|
||||
* \note Needs freeing through the destructor, so either use a smart pointer or #MEM_delete() for
|
||||
* explicit freeing.
|
||||
*/
|
||||
struct AssetWeakReference {
|
||||
char _pad[6] = {};
|
||||
|
||||
eAssetLibraryType asset_library_type = {};
|
||||
/** If #asset_library_type is not enough to identify the asset library, this string can provide
|
||||
* further location info (allocated string). Null otherwise. */
|
||||
const char *asset_library_identifier = nullptr;
|
||||
|
||||
const char *relative_asset_identifier = nullptr;
|
||||
|
||||
#if defined(__cplusplus) && !defined(DNA_NO_EXTERNAL_CONSTRUCTORS)
|
||||
AssetWeakReference();
|
||||
AssetWeakReference(const AssetWeakReference &);
|
||||
AssetWeakReference(AssetWeakReference &&);
|
||||
AssetWeakReference &operator=(const AssetWeakReference &);
|
||||
AssetWeakReference &operator=(AssetWeakReference &&);
|
||||
~AssetWeakReference();
|
||||
|
||||
friend bool operator==(const AssetWeakReference &a, const AssetWeakReference &b);
|
||||
friend bool operator!=(const AssetWeakReference &a, const AssetWeakReference &b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
/**
|
||||
* See AssetRepresentation::make_weak_reference().
|
||||
*/
|
||||
static AssetWeakReference make_reference(const asset_system::AssetLibrary &library,
|
||||
StringRef library_relative_identifier);
|
||||
#endif
|
||||
};
|
||||
|
||||
struct AssetCatalogPathLink {
|
||||
struct AssetCatalogPathLink *next = nullptr, *prev = nullptr;
|
||||
char *path = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
74
blender-5.2.0/source/blender/makesdna/DNA_attribute_types.h
Normal file
74
blender-5.2.0/source/blender/makesdna/DNA_attribute_types.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "BLI_implicit_sharing.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
class AttributeStorage;
|
||||
class AttributeStorageRuntime;
|
||||
} // namespace bke
|
||||
|
||||
/** DNA data for bke::Attribute::ArrayData. */
|
||||
struct AttributeArray {
|
||||
void *data = nullptr;
|
||||
const ImplicitSharingInfoHandle *sharing_info = nullptr;
|
||||
/* The number of elements in the array. */
|
||||
int64_t size = 0;
|
||||
/**
|
||||
* Blender 5.0 (the first version to read #AttributeStorage) does not fully support single value
|
||||
* storage at runtime, even though it supports reading it from the file. The purpose of this
|
||||
* field is to let versions 5.1 and later detect that the storage is a single value, while still
|
||||
* being compatible with 5.0, which doesn't have this field and will just use array storage.
|
||||
*/
|
||||
int8_t is_single = 0;
|
||||
char _pad[7] = {};
|
||||
};
|
||||
|
||||
/** DNA data for bke::Attribute::SingleData. */
|
||||
struct AttributeSingle {
|
||||
void *data = nullptr;
|
||||
const ImplicitSharingInfoHandle *sharing_info = nullptr;
|
||||
};
|
||||
|
||||
/** DNA data for bke::Attribute. */
|
||||
struct Attribute {
|
||||
const char *name = nullptr;
|
||||
/* bke::AttrType. */
|
||||
int16_t data_type = 0;
|
||||
/* bke::AttrDomain. */
|
||||
int8_t domain = 0;
|
||||
/* bke::AttrStorageType */
|
||||
int8_t storage_type = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
/** Type depends on storage type. */
|
||||
void *data = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* The DNA type for storing attribute values. Logic at runtime is handled by the runtime struct.
|
||||
* The DNA data here is created just for file reading and writing.
|
||||
*/
|
||||
struct AttributeStorage {
|
||||
/* Array only used in files, otherwise #AttributeStorageRuntime::attributes is used. */
|
||||
struct Attribute *dna_attributes = nullptr;
|
||||
int dna_attributes_num = 0;
|
||||
|
||||
char _pad[4] = {};
|
||||
|
||||
bke::AttributeStorageRuntime *runtime = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
bke::AttributeStorage &wrap();
|
||||
const bke::AttributeStorage &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
173
blender-5.2.0/source/blender/makesdna/DNA_boid_types.h
Normal file
173
blender-5.2.0/source/blender/makesdna/DNA_boid_types.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/* SPDX-FileCopyrightText: 2009 by Janne Karhu. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
enum eBoidRuleType : int {
|
||||
eBoidRuleType_None = 0,
|
||||
/** go to goal assigned object or loudest assigned signal source */
|
||||
eBoidRuleType_Goal = 1,
|
||||
/** get away from assigned object or loudest assigned signal source */
|
||||
eBoidRuleType_Avoid = 2,
|
||||
/** Maneuver to avoid collisions with other boids and deflector object in near future. */
|
||||
eBoidRuleType_AvoidCollision = 3,
|
||||
/** keep from going through other boids */
|
||||
eBoidRuleType_Separate = 4,
|
||||
/** move to center of neighbors and match their velocity */
|
||||
eBoidRuleType_Flock = 5,
|
||||
/** follow a boid or assigned object */
|
||||
eBoidRuleType_FollowLeader = 6,
|
||||
/** Maintain speed, flight level or wander. */
|
||||
eBoidRuleType_AverageSpeed = 7,
|
||||
/** go to closest enemy and attack when in range */
|
||||
eBoidRuleType_Fight = 8,
|
||||
};
|
||||
|
||||
/* boidrule->flag */
|
||||
enum eBoidRule_Flag : int {
|
||||
BOIDRULE_CURRENT = 1 << 0,
|
||||
BOIDRULE_IN_AIR = 1 << 2,
|
||||
BOIDRULE_ON_LAND = 1 << 3,
|
||||
};
|
||||
ENUM_OPERATORS(eBoidRule_Flag)
|
||||
|
||||
#define BRULE_LEADER_IN_LINE (1 << 0)
|
||||
|
||||
#define BOIDSTATE_CURRENT 1
|
||||
|
||||
enum eBoidRuleGoalAvoid_Option : int {
|
||||
BRULE_GOAL_AVOID_PREDICT = 1 << 0,
|
||||
BRULE_GOAL_AVOID_ARRIVE = 1 << 1,
|
||||
BRULE_GOAL_AVOID_SIGNAL = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eBoidRuleGoalAvoid_Option)
|
||||
|
||||
enum eBoidRuleAvoidCollision_Option : int {
|
||||
BRULE_ACOLL_WITH_BOIDS = 1 << 0,
|
||||
BRULE_ACOLL_WITH_DEFLECTORS = 1 << 1,
|
||||
};
|
||||
ENUM_OPERATORS(eBoidRuleAvoidCollision_Option)
|
||||
|
||||
enum eBoidMode : short {
|
||||
eBoidMode_InAir = 0,
|
||||
eBoidMode_OnLand = 1,
|
||||
eBoidMode_Climbing = 2,
|
||||
eBoidMode_Falling = 3,
|
||||
eBoidMode_Liftoff = 4,
|
||||
};
|
||||
|
||||
enum eBoidRulesetType : int {
|
||||
eBoidRulesetType_Fuzzy = 0,
|
||||
eBoidRulesetType_Random = 1,
|
||||
eBoidRulesetType_Average = 2,
|
||||
};
|
||||
|
||||
/** #BoidSettings::options */
|
||||
enum eBoid_Option : int {
|
||||
BOID_ALLOW_FLIGHT = 1 << 0,
|
||||
BOID_ALLOW_LAND = 1 << 1,
|
||||
BOID_ALLOW_CLIMB = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eBoid_Option)
|
||||
|
||||
struct BoidRule {
|
||||
struct BoidRule *next = nullptr, *prev = nullptr;
|
||||
eBoidRuleType type = eBoidRuleType_None;
|
||||
eBoidRule_Flag flag = {};
|
||||
char name[32] = "";
|
||||
};
|
||||
|
||||
struct BoidRuleGoalAvoid {
|
||||
BoidRule rule;
|
||||
struct Object *ob = nullptr;
|
||||
eBoidRuleGoalAvoid_Option options = {};
|
||||
float fear_factor = 0;
|
||||
|
||||
/* signals */
|
||||
int signal_id = 0, channels = 0;
|
||||
};
|
||||
|
||||
struct BoidRuleAvoidCollision {
|
||||
BoidRule rule;
|
||||
eBoidRuleAvoidCollision_Option options = {};
|
||||
float look_ahead = 0;
|
||||
};
|
||||
|
||||
struct BoidRuleFollowLeader {
|
||||
BoidRule rule;
|
||||
struct Object *ob = nullptr;
|
||||
float loc[3] = {}, oloc[3] = {};
|
||||
float cfra = 0, distance = 0;
|
||||
eBoidRuleGoalAvoid_Option options = {};
|
||||
int queue_size = 0;
|
||||
};
|
||||
|
||||
struct BoidRuleAverageSpeed {
|
||||
BoidRule rule;
|
||||
float wander = 0, level = 0, speed = 0;
|
||||
char _pad0[4] = {};
|
||||
};
|
||||
|
||||
struct BoidRuleFight {
|
||||
BoidRule rule;
|
||||
float distance = 0, flee_distance = 0;
|
||||
};
|
||||
|
||||
struct BoidData {
|
||||
float health = 0, acc[3] = {};
|
||||
short state_id = 0;
|
||||
eBoidMode mode = eBoidMode_InAir;
|
||||
};
|
||||
|
||||
struct BoidState {
|
||||
struct BoidState *next = nullptr, *prev = nullptr;
|
||||
ListBaseT<BoidRule> rules = {nullptr, nullptr};
|
||||
ListBase conditions = {nullptr, nullptr};
|
||||
ListBase actions = {nullptr, nullptr};
|
||||
char name[32] = "";
|
||||
int id = 0, flag = 0;
|
||||
|
||||
/* rules */
|
||||
eBoidRulesetType ruleset_type = eBoidRulesetType_Fuzzy;
|
||||
float rule_fuzziness = 0;
|
||||
|
||||
/* signal */
|
||||
int signal_id = 0, channels = 0;
|
||||
float volume = 0, falloff = 0;
|
||||
};
|
||||
|
||||
struct BoidSettings {
|
||||
eBoid_Option options = {};
|
||||
int last_state_id = 0;
|
||||
|
||||
float landing_smoothness = 0, height = 0;
|
||||
float banking = 0, pitch = 0;
|
||||
|
||||
float health = 0, aggression = 0;
|
||||
float strength = 0, accuracy = 0, range = 0;
|
||||
|
||||
/* flying related */
|
||||
float air_min_speed = 0, air_max_speed = 0;
|
||||
float air_max_acc = 0, air_max_ave = 0;
|
||||
float air_personal_space = 0;
|
||||
|
||||
/* walk/run related */
|
||||
float land_jump_speed = 0, land_max_speed = 0;
|
||||
float land_max_acc = 0, land_max_ave = 0;
|
||||
float land_personal_space = 0;
|
||||
float land_stick_force = 0;
|
||||
|
||||
ListBaseT<BoidState> states = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
615
blender-5.2.0/source/blender/makesdna/DNA_brush_enums.h
Normal file
615
blender-5.2.0/source/blender/makesdna/DNA_brush_enums.h
Normal file
@@ -0,0 +1,615 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* BrushGpencilSettings->flag */
|
||||
enum eGPDbrush_Flag : int {
|
||||
/* brush use pressure */
|
||||
GP_BRUSH_USE_PRESSURE = (1 << 0),
|
||||
/* brush use pressure for alpha factor */
|
||||
GP_BRUSH_USE_STRENGTH_PRESSURE = (1 << 1),
|
||||
/* brush use pressure for alpha factor */
|
||||
GP_BRUSH_USE_JITTER_PRESSURE = (1 << 2),
|
||||
/* Disable automatic zoom for filling. */
|
||||
GP_BRUSH_FILL_FIT_DISABLE = (1 << 3),
|
||||
/* Show extend fill help lines. */
|
||||
GP_BRUSH_FILL_SHOW_EXTENDLINES = (1 << 4),
|
||||
/* fill hide transparent */
|
||||
GP_BRUSH_FILL_HIDE = (1 << 6),
|
||||
/* show fill help lines */
|
||||
GP_BRUSH_FILL_SHOW_HELPLINES = (1 << 7),
|
||||
/* lazy mouse */
|
||||
GP_BRUSH_STABILIZE_MOUSE = (1 << 8),
|
||||
/* lazy mouse override (internal only) */
|
||||
GP_BRUSH_STABILIZE_MOUSE_TEMP = (1 << 9),
|
||||
/* deprecated, was default eraser brush for quick switch */
|
||||
GP_BRUSH_DEPRECATED1 = (1 << 10),
|
||||
/* settings group */
|
||||
GP_BRUSH_GROUP_SETTINGS = (1 << 11),
|
||||
/* Random settings group */
|
||||
GP_BRUSH_GROUP_RANDOM = (1 << 12),
|
||||
/* Keep material assigned to brush */
|
||||
GP_BRUSH_MATERIAL_PINNED = (1 << 13),
|
||||
/* Do not show fill color while drawing (no lasso mode) */
|
||||
GP_BRUSH_DISSABLE_LASSO = (1 << 14),
|
||||
/* Do not erase strokes occluded. */
|
||||
GP_BRUSH_OCCLUDE_ERASER = (1 << 15),
|
||||
/* Post process trim stroke */
|
||||
GP_BRUSH_TRIM_STROKE = (1 << 16),
|
||||
/* Post process convert to outline stroke */
|
||||
GP_BRUSH_OUTLINE_STROKE = (1 << 17),
|
||||
/* Collide with stroke. */
|
||||
GP_BRUSH_FILL_STROKE_COLLIDE = (1 << 18),
|
||||
/* Keep the caps as they are when erasing. Otherwise flatten the caps. */
|
||||
GP_BRUSH_ERASER_KEEP_CAPS = (1 << 19),
|
||||
/* Affect only the drawing in the active layer.
|
||||
* Otherwise affect all editable drawings in the object. */
|
||||
GP_BRUSH_ACTIVE_LAYER_ONLY = (1 << 20),
|
||||
/* Automatically remove fill guides created with fill tool. */
|
||||
GP_BRUSH_FILL_AUTO_REMOVE_FILL_GUIDES = (1 << 21),
|
||||
/* Fill Tool create internal gaps. */
|
||||
GP_BRUSH_FILL_INTERNAL_GAPS = (1 << 22),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDbrush_Flag)
|
||||
|
||||
enum eGPDbrush_Flag2 : int {
|
||||
/* DEPRECATED: replaced with BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE */
|
||||
/* Brush use random Hue at stroke level */
|
||||
GP_BRUSH_USE_HUE_AT_STROKE = (1 << 0),
|
||||
/* DEPRECATED: replaced with BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE */
|
||||
/* Brush use random Saturation at stroke level */
|
||||
GP_BRUSH_USE_SAT_AT_STROKE = (1 << 1),
|
||||
/* DEPRECATED: replaced with BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE */
|
||||
/* Brush use random Value at stroke level */
|
||||
GP_BRUSH_USE_VAL_AT_STROKE = (1 << 2),
|
||||
/* Brush use random Pressure at stroke level */
|
||||
GP_BRUSH_USE_PRESS_AT_STROKE = (1 << 3),
|
||||
/* Brush use random Strength at stroke level */
|
||||
GP_BRUSH_USE_STRENGTH_AT_STROKE = (1 << 4),
|
||||
/* Brush use random UV at stroke level */
|
||||
GP_BRUSH_USE_UV_AT_STROKE = (1 << 5),
|
||||
/* DEPRECATED: replaced with BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS */
|
||||
/* Brush use Hue random pressure */
|
||||
GP_BRUSH_USE_HUE_RAND_PRESS = (1 << 6),
|
||||
/* DEPRECATED: replaced with BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS */
|
||||
/* Brush use Saturation random pressure */
|
||||
GP_BRUSH_USE_SAT_RAND_PRESS = (1 << 7),
|
||||
/* DEPRECATED: replaced with BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS */
|
||||
/* Brush use Value random pressure */
|
||||
GP_BRUSH_USE_VAL_RAND_PRESS = (1 << 8),
|
||||
/* Brush use Pressure random pressure */
|
||||
GP_BRUSH_USE_PRESSURE_RAND_PRESS = (1 << 9),
|
||||
/* Brush use Strength random pressure */
|
||||
GP_BRUSH_USE_STRENGTH_RAND_PRESS = (1 << 10),
|
||||
/* Brush use UV random pressure */
|
||||
GP_BRUSH_USE_UV_RAND_PRESS = (1 << 11),
|
||||
/* Brush creates curves that use the stroke. */
|
||||
GP_BRUSH_USE_STROKE = (1 << 12),
|
||||
/* Brush creates curves that use the fill. */
|
||||
GP_BRUSH_USE_FILL = (1 << 13),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDbrush_Flag2)
|
||||
|
||||
/* BrushGpencilSettings->fill_draw_mode */
|
||||
enum eGP_FillDrawModes : int {
|
||||
GP_FILL_DMODE_BOTH = 0,
|
||||
GP_FILL_DMODE_STROKE = 1,
|
||||
GP_FILL_DMODE_CONTROL = 2,
|
||||
};
|
||||
|
||||
/* BrushGpencilSettings->fill_extend_mode */
|
||||
enum eGP_FillExtendModes : int {
|
||||
GP_FILL_EMODE_EXTEND = 0,
|
||||
GP_FILL_EMODE_RADIUS = 1,
|
||||
};
|
||||
|
||||
/* BrushGpencilSettings->fill_layer_mode */
|
||||
enum eGP_FillLayerModes : short {
|
||||
GP_FILL_GPLMODE_VISIBLE = 0,
|
||||
GP_FILL_GPLMODE_ACTIVE = 1,
|
||||
GP_FILL_GPLMODE_ALL_ABOVE = 2,
|
||||
GP_FILL_GPLMODE_ALL_BELOW = 3,
|
||||
GP_FILL_GPLMODE_ABOVE = 4,
|
||||
GP_FILL_GPLMODE_BELOW = 5,
|
||||
};
|
||||
|
||||
/* BrushGpencilSettings->fill_solver */
|
||||
enum eGP_FillSolver {
|
||||
GP_FILL_SOLVER_DELAUNAY = 0,
|
||||
GP_FILL_SOLVER_PIXEL = 1,
|
||||
};
|
||||
|
||||
/* BrushGpencilSettings->gp_eraser_mode */
|
||||
enum eGP_BrushEraserMode : int {
|
||||
GP_BRUSH_ERASER_SOFT = 0,
|
||||
GP_BRUSH_ERASER_HARD = 1,
|
||||
GP_BRUSH_ERASER_STROKE = 2,
|
||||
};
|
||||
|
||||
/* BrushGpencilSettings->brush_draw_mode */
|
||||
enum eGP_BrushMode : short {
|
||||
GP_BRUSH_MODE_ACTIVE = 0,
|
||||
GP_BRUSH_MODE_MATERIAL = 1,
|
||||
GP_BRUSH_MODE_VERTEXCOLOR = 2,
|
||||
};
|
||||
|
||||
/* Brush.curve_preset */
|
||||
enum eBrushCurvePreset : int {
|
||||
BRUSH_CURVE_CUSTOM = 0,
|
||||
/** Corresponds to CURVE_PRESET_SMOOTH */
|
||||
BRUSH_CURVE_SMOOTH = 1,
|
||||
/** Corresponds to CURVE_PRESET_ROUND */
|
||||
BRUSH_CURVE_SPHERE = 2,
|
||||
/** Corresponds to CURVE_PRESET_ROOT */
|
||||
BRUSH_CURVE_ROOT = 3,
|
||||
/** Corresponds to CURVE_PRESET_SHARP */
|
||||
BRUSH_CURVE_SHARP = 4,
|
||||
/** Corresponds to CURVE_PRESET_LINE */
|
||||
BRUSH_CURVE_LIN = 5,
|
||||
/** No corresponding CurveMapping.preset */
|
||||
BRUSH_CURVE_POW4 = 6,
|
||||
/** No corresponding CurveMapping.preset */
|
||||
BRUSH_CURVE_INVSQUARE = 7,
|
||||
/** Corresponds to CURVE_PRESET_MAX */
|
||||
BRUSH_CURVE_CONSTANT = 8,
|
||||
/** No corresponding CurveMapping.preset */
|
||||
BRUSH_CURVE_SMOOTHER = 9,
|
||||
};
|
||||
|
||||
enum eBrushDeformTarget : int {
|
||||
BRUSH_DEFORM_TARGET_GEOMETRY = 0,
|
||||
BRUSH_DEFORM_TARGET_CLOTH_SIM = 1,
|
||||
};
|
||||
|
||||
enum eBrushElasticDeformType : int {
|
||||
BRUSH_ELASTIC_DEFORM_GRAB = 0,
|
||||
BRUSH_ELASTIC_DEFORM_GRAB_BISCALE = 1,
|
||||
BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE = 2,
|
||||
BRUSH_ELASTIC_DEFORM_SCALE = 3,
|
||||
BRUSH_ELASTIC_DEFORM_TWIST = 4,
|
||||
};
|
||||
|
||||
enum eBrushClothDeformType : int {
|
||||
BRUSH_CLOTH_DEFORM_DRAG = 0,
|
||||
BRUSH_CLOTH_DEFORM_PUSH = 1,
|
||||
BRUSH_CLOTH_DEFORM_GRAB = 2,
|
||||
BRUSH_CLOTH_DEFORM_PINCH_POINT = 3,
|
||||
BRUSH_CLOTH_DEFORM_PINCH_PERPENDICULAR = 4,
|
||||
BRUSH_CLOTH_DEFORM_INFLATE = 5,
|
||||
BRUSH_CLOTH_DEFORM_EXPAND = 6,
|
||||
BRUSH_CLOTH_DEFORM_SNAKE_HOOK = 7,
|
||||
};
|
||||
|
||||
enum eBrushSmoothDeformType : int {
|
||||
BRUSH_SMOOTH_DEFORM_LAPLACIAN = 0,
|
||||
BRUSH_SMOOTH_DEFORM_SURFACE = 1,
|
||||
};
|
||||
|
||||
enum eBrushClothForceFalloffType : int {
|
||||
BRUSH_CLOTH_FORCE_FALLOFF_RADIAL = 0,
|
||||
BRUSH_CLOTH_FORCE_FALLOFF_PLANE = 1,
|
||||
};
|
||||
|
||||
enum eBrushClothSimulationAreaType : int {
|
||||
BRUSH_CLOTH_SIMULATION_AREA_LOCAL = 0,
|
||||
BRUSH_CLOTH_SIMULATION_AREA_GLOBAL = 1,
|
||||
BRUSH_CLOTH_SIMULATION_AREA_DYNAMIC = 2,
|
||||
};
|
||||
|
||||
enum eBrushPoseDeformType : int {
|
||||
BRUSH_POSE_DEFORM_ROTATE_TWIST = 0,
|
||||
BRUSH_POSE_DEFORM_SCALE_TRANSLATE = 1,
|
||||
BRUSH_POSE_DEFORM_SQUASH_STRETCH = 2,
|
||||
};
|
||||
|
||||
enum eBrushPoseOriginType : int {
|
||||
BRUSH_POSE_ORIGIN_TOPOLOGY = 0,
|
||||
BRUSH_POSE_ORIGIN_FACE_SETS = 1,
|
||||
BRUSH_POSE_ORIGIN_FACE_SETS_FK = 2,
|
||||
};
|
||||
|
||||
enum eBrushSmearDeformType : int {
|
||||
BRUSH_SMEAR_DEFORM_DRAG = 0,
|
||||
BRUSH_SMEAR_DEFORM_PINCH = 1,
|
||||
BRUSH_SMEAR_DEFORM_EXPAND = 2,
|
||||
};
|
||||
|
||||
enum eBrushSlideDeformType : int {
|
||||
BRUSH_SLIDE_DEFORM_DRAG = 0,
|
||||
BRUSH_SLIDE_DEFORM_PINCH = 1,
|
||||
BRUSH_SLIDE_DEFORM_EXPAND = 2,
|
||||
};
|
||||
|
||||
enum eBrushBoundaryDeformType : int {
|
||||
BRUSH_BOUNDARY_DEFORM_BEND = 0,
|
||||
BRUSH_BOUNDARY_DEFORM_EXPAND = 1,
|
||||
BRUSH_BOUNDARY_DEFORM_INFLATE = 2,
|
||||
BRUSH_BOUNDARY_DEFORM_GRAB = 3,
|
||||
BRUSH_BOUNDARY_DEFORM_TWIST = 4,
|
||||
BRUSH_BOUNDARY_DEFORM_SMOOTH = 5,
|
||||
};
|
||||
|
||||
enum eBrushBoundaryFalloffType : int {
|
||||
BRUSH_BOUNDARY_FALLOFF_CONSTANT = 0,
|
||||
BRUSH_BOUNDARY_FALLOFF_RADIUS = 1,
|
||||
BRUSH_BOUNDARY_FALLOFF_LOOP = 2,
|
||||
BRUSH_BOUNDARY_FALLOFF_LOOP_INVERT = 3,
|
||||
};
|
||||
|
||||
enum eBrushSnakeHookDeformType : int {
|
||||
BRUSH_SNAKE_HOOK_DEFORM_FALLOFF = 0,
|
||||
BRUSH_SNAKE_HOOK_DEFORM_ELASTIC = 1,
|
||||
};
|
||||
|
||||
enum eBrushPlaneInversionMode : int {
|
||||
BRUSH_PLANE_INVERT_DISPLACEMENT = 0,
|
||||
BRUSH_PLANE_SWAP_HEIGHT_AND_DEPTH = 1,
|
||||
};
|
||||
|
||||
enum eBrushProjectRayDirection : int8_t {
|
||||
BRUSH_PROJECT_RAY_DIRECTION_VIEW_NORMAL = 0,
|
||||
BRUSH_PROJECT_RAY_DIRECTION_PLANE_NORMAL = 1,
|
||||
};
|
||||
|
||||
/** #Gpencilsettings.Vertex_mode */
|
||||
enum eGp_Vertex_Mode : int {
|
||||
/* Affect to Stroke only. */
|
||||
GPPAINT_MODE_STROKE = 0,
|
||||
/* Affect to Fill only. */
|
||||
GPPAINT_MODE_FILL = 1,
|
||||
/* Affect to both. */
|
||||
GPPAINT_MODE_BOTH = 2,
|
||||
};
|
||||
|
||||
/* sculpt_flag */
|
||||
enum eGP_Sculpt_Flag : int {
|
||||
/* invert the effect of the brush */
|
||||
GP_SCULPT_FLAG_INVERT = (1 << 0),
|
||||
/* temporary invert action */
|
||||
GP_SCULPT_FLAG_TMP_INVERT = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eGP_Sculpt_Flag)
|
||||
|
||||
/* sculpt_mode_flag */
|
||||
enum eGP_Sculpt_Mode_Flag : int {
|
||||
/* apply brush to position */
|
||||
GP_SCULPT_FLAGMODE_APPLY_POSITION = (1 << 0),
|
||||
/* apply brush to strength */
|
||||
GP_SCULPT_FLAGMODE_APPLY_STRENGTH = (1 << 1),
|
||||
/* apply brush to thickness */
|
||||
GP_SCULPT_FLAGMODE_APPLY_THICKNESS = (1 << 2),
|
||||
/* apply brush to uv data */
|
||||
GP_SCULPT_FLAGMODE_APPLY_UV = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eGP_Sculpt_Mode_Flag)
|
||||
|
||||
enum eAutomasking_flag : int {
|
||||
BRUSH_AUTOMASKING_TOPOLOGY = (1 << 0),
|
||||
BRUSH_AUTOMASKING_FACE_SETS = (1 << 1),
|
||||
BRUSH_AUTOMASKING_BOUNDARY_EDGES = (1 << 2),
|
||||
BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS = (1 << 3),
|
||||
BRUSH_AUTOMASKING_CAVITY_NORMAL = (1 << 4),
|
||||
|
||||
/* NOTE: normal and inverted are mutually exclusive,
|
||||
* inverted has priority if both bits are set. */
|
||||
BRUSH_AUTOMASKING_CAVITY_INVERTED = (1 << 5),
|
||||
BRUSH_AUTOMASKING_CAVITY_ALL = (1 << 4) | (1 << 5),
|
||||
BRUSH_AUTOMASKING_CAVITY_USE_CURVE = (1 << 6),
|
||||
/* (1 << 7) - unused. */
|
||||
BRUSH_AUTOMASKING_BRUSH_NORMAL = (1 << 8),
|
||||
BRUSH_AUTOMASKING_VIEW_NORMAL = (1 << 9),
|
||||
BRUSH_AUTOMASKING_VIEW_OCCLUSION = (1 << 10),
|
||||
};
|
||||
ENUM_OPERATORS(eAutomasking_flag)
|
||||
|
||||
enum ePaintBrush_flag : int {
|
||||
BRUSH_PAINT_HARDNESS_PRESSURE = (1 << 0),
|
||||
BRUSH_PAINT_HARDNESS_PRESSURE_INVERT = (1 << 1),
|
||||
BRUSH_PAINT_FLOW_PRESSURE = (1 << 2),
|
||||
BRUSH_PAINT_FLOW_PRESSURE_INVERT = (1 << 3),
|
||||
BRUSH_PAINT_WET_MIX_PRESSURE = (1 << 4),
|
||||
BRUSH_PAINT_WET_MIX_PRESSURE_INVERT = (1 << 5),
|
||||
BRUSH_PAINT_WET_PERSISTENCE_PRESSURE = (1 << 6),
|
||||
BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT = (1 << 7),
|
||||
BRUSH_PAINT_DENSITY_PRESSURE = (1 << 8),
|
||||
BRUSH_PAINT_DENSITY_PRESSURE_INVERT = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(ePaintBrush_flag)
|
||||
|
||||
/** #Brush.gradient_source */
|
||||
enum eBrushGradientSourceStroke : char {
|
||||
BRUSH_GRADIENT_PRESSURE = 0, /* gradient from pressure */
|
||||
BRUSH_GRADIENT_SPACING_REPEAT = 1, /* gradient from spacing */
|
||||
BRUSH_GRADIENT_SPACING_CLAMP = 2, /* gradient from spacing */
|
||||
};
|
||||
|
||||
enum eBrushGradientSourceFill : char {
|
||||
BRUSH_GRADIENT_LINEAR = 0, /* gradient from pressure */
|
||||
BRUSH_GRADIENT_RADIAL = 1, /* gradient from spacing */
|
||||
};
|
||||
|
||||
/** #Brush.stroke_method */
|
||||
enum eBrushStrokeType : int8_t {
|
||||
BRUSH_STROKE_DOTS = 0,
|
||||
BRUSH_STROKE_AIRBRUSH = 1,
|
||||
BRUSH_STROKE_ANCHORED = 2,
|
||||
BRUSH_STROKE_SPACE = 3,
|
||||
BRUSH_STROKE_DRAG_DOT = 4,
|
||||
BRUSH_STROKE_LINE = 5,
|
||||
BRUSH_STROKE_CURVE = 6,
|
||||
};
|
||||
|
||||
/** #Brush.flag */
|
||||
enum eBrushFlags : uint32_t {
|
||||
BRUSH_UNUSED_1 = (1 << 0),
|
||||
BRUSH_INVERT_TO_SCRAPE_FILL = (1 << 1),
|
||||
BRUSH_ALPHA_PRESSURE = (1 << 2),
|
||||
BRUSH_SIZE_PRESSURE = (1 << 3),
|
||||
BRUSH_JITTER_PRESSURE = (1 << 4),
|
||||
BRUSH_SPACING_PRESSURE = (1 << 5),
|
||||
BRUSH_ORIGINAL_PLANE = (1 << 6),
|
||||
BRUSH_GRAB_ACTIVE_VERTEX = (1 << 7),
|
||||
BRUSH_UNUSED_2 = (1 << 8),
|
||||
BRUSH_DIR_IN = (1 << 9),
|
||||
BRUSH_UNUSED_3 = (1 << 10),
|
||||
BRUSH_SMOOTH_STROKE = (1 << 11),
|
||||
BRUSH_PERSISTENT = (1 << 12),
|
||||
BRUSH_ACCUMULATE = (1 << 13),
|
||||
BRUSH_LOCK_ALPHA = (1 << 14),
|
||||
BRUSH_ORIGINAL_NORMAL = (1 << 15),
|
||||
BRUSH_OFFSET_PRESSURE = (1 << 16),
|
||||
BRUSH_SCENE_SPACING = (1 << 17),
|
||||
BRUSH_SPACE_ATTEN = (1 << 18),
|
||||
BRUSH_ADAPTIVE_SPACE = (1 << 19),
|
||||
BRUSH_LOCK_SIZE = (1 << 20),
|
||||
BRUSH_USE_GRADIENT = (1 << 21),
|
||||
BRUSH_EDGE_TO_EDGE = (1 << 22),
|
||||
BRUSH_UNUSED_4 = (1 << 23),
|
||||
BRUSH_INVERSE_SMOOTH_PRESSURE = (1 << 24),
|
||||
BRUSH_FRONTFACE_FALLOFF = (1 << 25),
|
||||
BRUSH_PLANE_TRIM = (1 << 26),
|
||||
BRUSH_FRONTFACE = (1 << 27),
|
||||
/* BRUSH_CUSTOM_ICON = (1 << 28), */
|
||||
BRUSH_UNUSED_5 = (1 << 29),
|
||||
BRUSH_ABSOLUTE_JITTER = (1 << 30),
|
||||
BRUSH_UNUSED_6 = (1u << 31),
|
||||
};
|
||||
ENUM_OPERATORS(eBrushFlags)
|
||||
|
||||
/** #Brush.sampling_flag */
|
||||
enum eBrushSamplingFlags : int {
|
||||
BRUSH_PAINT_ANTIALIASING = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eBrushSamplingFlags)
|
||||
|
||||
/** #Brush.flag2 */
|
||||
enum eBrushFlags2 : int {
|
||||
BRUSH_MULTIPLANE_SCRAPE_DYNAMIC = (1 << 0),
|
||||
BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW = (1 << 1),
|
||||
BRUSH_POSE_IK_ANCHORED = (1 << 2),
|
||||
BRUSH_USE_CONNECTED_ONLY = (1 << 3),
|
||||
BRUSH_CLOTH_PIN_SIMULATION_BOUNDARY = (1 << 4),
|
||||
BRUSH_POSE_USE_LOCK_ROTATION = (1 << 5),
|
||||
BRUSH_CLOTH_USE_COLLISION = (1 << 6),
|
||||
BRUSH_AREA_RADIUS_PRESSURE = (1 << 7),
|
||||
BRUSH_GRAB_SILHOUETTE = (1 << 8),
|
||||
BRUSH_USE_COLOR_AS_DISPLACEMENT = (1 << 9),
|
||||
BRUSH_JITTER_COLOR = (1 << 10),
|
||||
BRUSH_PROJECT_USE_BIDIRECTIONAL = (1 << 11),
|
||||
};
|
||||
ENUM_OPERATORS(eBrushFlags2)
|
||||
|
||||
enum BrushMaskPressureFlags : int {
|
||||
BRUSH_MASK_PRESSURE_RAMP = (1 << 1),
|
||||
BRUSH_MASK_PRESSURE_CUTOFF = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(BrushMaskPressureFlags)
|
||||
|
||||
/** #Brush.overlay_flags */
|
||||
enum eOverlayFlags : int {
|
||||
BRUSH_OVERLAY_CURSOR = (1),
|
||||
BRUSH_OVERLAY_PRIMARY = (1 << 1),
|
||||
BRUSH_OVERLAY_SECONDARY = (1 << 2),
|
||||
BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE = (1 << 3),
|
||||
BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE = (1 << 4),
|
||||
BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eOverlayFlags)
|
||||
|
||||
#define BRUSH_OVERLAY_OVERRIDE_MASK \
|
||||
(BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE | BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE | \
|
||||
BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE)
|
||||
|
||||
/** #Brush.sculpt_brush_type */
|
||||
enum eBrushSculptType : char {
|
||||
SCULPT_BRUSH_TYPE_DRAW = 1,
|
||||
SCULPT_BRUSH_TYPE_SMOOTH = 2,
|
||||
SCULPT_BRUSH_TYPE_PINCH = 3,
|
||||
SCULPT_BRUSH_TYPE_INFLATE = 4,
|
||||
SCULPT_BRUSH_TYPE_GRAB = 5,
|
||||
SCULPT_BRUSH_TYPE_LAYER = 6,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
SCULPT_BRUSH_TYPE_FLATTEN = 7,
|
||||
#endif
|
||||
SCULPT_BRUSH_TYPE_CLAY = 8,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
SCULPT_BRUSH_TYPE_FILL = 9,
|
||||
SCULPT_BRUSH_TYPE_SCRAPE = 10,
|
||||
#endif
|
||||
SCULPT_BRUSH_TYPE_NUDGE = 11,
|
||||
SCULPT_BRUSH_TYPE_THUMB = 12,
|
||||
SCULPT_BRUSH_TYPE_SNAKE_HOOK = 13,
|
||||
SCULPT_BRUSH_TYPE_ROTATE = 14,
|
||||
SCULPT_BRUSH_TYPE_SIMPLIFY = 15,
|
||||
SCULPT_BRUSH_TYPE_CREASE = 16,
|
||||
SCULPT_BRUSH_TYPE_BLOB = 17,
|
||||
SCULPT_BRUSH_TYPE_CLAY_STRIPS = 18,
|
||||
SCULPT_BRUSH_TYPE_MASK = 19,
|
||||
SCULPT_BRUSH_TYPE_DRAW_SHARP = 20,
|
||||
SCULPT_BRUSH_TYPE_ELASTIC_DEFORM = 21,
|
||||
SCULPT_BRUSH_TYPE_POSE = 22,
|
||||
SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE = 23,
|
||||
SCULPT_BRUSH_TYPE_SLIDE_RELAX = 24,
|
||||
SCULPT_BRUSH_TYPE_CLAY_THUMB = 25,
|
||||
SCULPT_BRUSH_TYPE_CLOTH = 26,
|
||||
SCULPT_BRUSH_TYPE_DRAW_FACE_SETS = 27,
|
||||
SCULPT_BRUSH_TYPE_PAINT = 28,
|
||||
SCULPT_BRUSH_TYPE_SMEAR = 29,
|
||||
SCULPT_BRUSH_TYPE_BOUNDARY = 30,
|
||||
SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER = 31,
|
||||
SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR = 32,
|
||||
SCULPT_BRUSH_TYPE_PLANE = 33,
|
||||
SCULPT_BRUSH_TYPE_BLUR = 34,
|
||||
SCULPT_BRUSH_TYPE_SCENE_PROJECT = 35,
|
||||
};
|
||||
|
||||
/* Brush.curves_sculpt_brush_type. */
|
||||
enum eBrushCurvesSculptType : char {
|
||||
CURVES_SCULPT_BRUSH_TYPE_COMB = 0,
|
||||
CURVES_SCULPT_BRUSH_TYPE_DELETE = 1,
|
||||
CURVES_SCULPT_BRUSH_TYPE_SNAKE_HOOK = 2,
|
||||
CURVES_SCULPT_BRUSH_TYPE_ADD = 3,
|
||||
CURVES_SCULPT_BRUSH_TYPE_GROW_SHRINK = 4,
|
||||
CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT = 5,
|
||||
CURVES_SCULPT_BRUSH_TYPE_PINCH = 6,
|
||||
CURVES_SCULPT_BRUSH_TYPE_SMOOTH = 7,
|
||||
CURVES_SCULPT_BRUSH_TYPE_PUFF = 8,
|
||||
CURVES_SCULPT_BRUSH_TYPE_DENSITY = 9,
|
||||
CURVES_SCULPT_BRUSH_TYPE_SLIDE = 10,
|
||||
};
|
||||
|
||||
/** #Brush.image_brush_type */
|
||||
enum eBrushImagePaintType : char {
|
||||
IMAGE_PAINT_BRUSH_TYPE_DRAW = 0,
|
||||
IMAGE_PAINT_BRUSH_TYPE_SOFTEN = 1,
|
||||
IMAGE_PAINT_BRUSH_TYPE_SMEAR = 2,
|
||||
IMAGE_PAINT_BRUSH_TYPE_CLONE = 3,
|
||||
IMAGE_PAINT_BRUSH_TYPE_FILL = 4,
|
||||
IMAGE_PAINT_BRUSH_TYPE_MASK = 5,
|
||||
};
|
||||
|
||||
/* The enums here should be kept in sync with the weight paint brush type.
|
||||
* This is because #smooth_brush_toggle_on and #smooth_brush_toggle_off
|
||||
* assumes that the blur brush has the same enum value. */
|
||||
/** #Brush.vertex_brush_type */
|
||||
enum eBrushVertexPaintType : char {
|
||||
VPAINT_BRUSH_TYPE_DRAW = 0,
|
||||
VPAINT_BRUSH_TYPE_BLUR = 1,
|
||||
VPAINT_BRUSH_TYPE_AVERAGE = 2,
|
||||
VPAINT_BRUSH_TYPE_SMEAR = 3,
|
||||
};
|
||||
|
||||
/* See #eBrushVertexPaintType when changing this definition. */
|
||||
/** #Brush.weight_brush_type */
|
||||
enum eBrushWeightPaintType : char {
|
||||
WPAINT_BRUSH_TYPE_DRAW = 0,
|
||||
WPAINT_BRUSH_TYPE_BLUR = 1,
|
||||
WPAINT_BRUSH_TYPE_AVERAGE = 2,
|
||||
WPAINT_BRUSH_TYPE_SMEAR = 3,
|
||||
};
|
||||
|
||||
/** #Brush.gpencil_brush_type */
|
||||
enum eBrushGPaintType : char {
|
||||
GPAINT_BRUSH_TYPE_DRAW = 0,
|
||||
GPAINT_BRUSH_TYPE_FILL = 1,
|
||||
GPAINT_BRUSH_TYPE_ERASE = 2,
|
||||
GPAINT_BRUSH_TYPE_TINT = 3,
|
||||
};
|
||||
|
||||
/** #Brush.gpencil_vertex_brush_type */
|
||||
enum eBrushGPVertexType : char {
|
||||
GPVERTEX_BRUSH_TYPE_DRAW = 0,
|
||||
GPVERTEX_BRUSH_TYPE_BLUR = 1,
|
||||
GPVERTEX_BRUSH_TYPE_AVERAGE = 2,
|
||||
GPVERTEX_BRUSH_TYPE_TINT = 3,
|
||||
GPVERTEX_BRUSH_TYPE_SMEAR = 4,
|
||||
GPVERTEX_BRUSH_TYPE_REPLACE = 5,
|
||||
};
|
||||
|
||||
/** #Brush.gpencil_sculpt_brush_type */
|
||||
enum eBrushGPSculptType : char {
|
||||
GPSCULPT_BRUSH_TYPE_SMOOTH = 0,
|
||||
GPSCULPT_BRUSH_TYPE_THICKNESS = 1,
|
||||
GPSCULPT_BRUSH_TYPE_STRENGTH = 2,
|
||||
GPSCULPT_BRUSH_TYPE_GRAB = 3,
|
||||
GPSCULPT_BRUSH_TYPE_PUSH = 4,
|
||||
GPSCULPT_BRUSH_TYPE_TWIST = 5,
|
||||
GPSCULPT_BRUSH_TYPE_PINCH = 6,
|
||||
GPSCULPT_BRUSH_TYPE_RANDOMIZE = 7,
|
||||
GPSCULPT_BRUSH_TYPE_CLONE = 8,
|
||||
};
|
||||
|
||||
/** #Brush.gpencil_weight_brush_type */
|
||||
enum eBrushGPWeightType : char {
|
||||
GPWEIGHT_BRUSH_TYPE_DRAW = 0,
|
||||
GPWEIGHT_BRUSH_TYPE_BLUR = 1,
|
||||
GPWEIGHT_BRUSH_TYPE_AVERAGE = 2,
|
||||
GPWEIGHT_BRUSH_TYPE_SMEAR = 3,
|
||||
};
|
||||
|
||||
/* direction that the brush displaces along */
|
||||
enum eBrushSculpt_DispDir : int {
|
||||
SCULPT_DISP_DIR_AREA = 0,
|
||||
SCULPT_DISP_DIR_VIEW = 1,
|
||||
SCULPT_DISP_DIR_X = 2,
|
||||
SCULPT_DISP_DIR_Y = 3,
|
||||
SCULPT_DISP_DIR_Z = 4,
|
||||
};
|
||||
|
||||
enum BrushMaskTool : char {
|
||||
BRUSH_MASK_DRAW = 0,
|
||||
BRUSH_MASK_SMOOTH = 1,
|
||||
};
|
||||
|
||||
/* blur kernel types, Brush.blur_mode */
|
||||
enum eBlurKernelType : int {
|
||||
KERNEL_GAUSSIAN = 0,
|
||||
KERNEL_BOX = 1,
|
||||
};
|
||||
|
||||
/** #Brush.falloff_shape */
|
||||
enum eBrushFalloffShape : char {
|
||||
PAINT_FALLOFF_SHAPE_SPHERE = 0,
|
||||
PAINT_FALLOFF_SHAPE_TUBE = 1,
|
||||
};
|
||||
|
||||
enum eBrushCurvesSculptFlag : uint32_t {
|
||||
BRUSH_CURVES_SCULPT_FLAG_SCALE_UNIFORM = (1 << 0),
|
||||
BRUSH_CURVES_SCULPT_FLAG_GROW_SHRINK_INVERT = (1 << 1),
|
||||
BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH = (1 << 2),
|
||||
BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_SHAPE = (1 << 3),
|
||||
BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_POINT_COUNT = (1 << 4),
|
||||
BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eBrushCurvesSculptFlag)
|
||||
|
||||
enum eBrushCurvesSculptDensityMode : uint8_t {
|
||||
BRUSH_CURVES_SCULPT_DENSITY_MODE_AUTO = 0,
|
||||
BRUSH_CURVES_SCULPT_DENSITY_MODE_ADD = 1,
|
||||
BRUSH_CURVES_SCULPT_DENSITY_MODE_REMOVE = 2,
|
||||
};
|
||||
|
||||
enum eBrushColorJitterSettings_Flag : int {
|
||||
BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE = (1 << 0),
|
||||
BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE = (1 << 1),
|
||||
BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE = (1 << 2),
|
||||
BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS = (1 << 3),
|
||||
BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS = (1 << 4),
|
||||
BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eBrushColorJitterSettings_Flag)
|
||||
|
||||
#define MAX_BRUSH_PIXEL_RADIUS 500
|
||||
#define MAX_BRUSH_PIXEL_DIAMETER 1000
|
||||
|
||||
} // namespace blender
|
||||
501
blender-5.2.0/source/blender/makesdna/DNA_brush_types.h
Normal file
501
blender-5.2.0/source/blender/makesdna/DNA_brush_types.h
Normal file
@@ -0,0 +1,501 @@
|
||||
/* SPDX-FileCopyrightText: 2005 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_brush_enums.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_object_enums.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_texture_types.h" /* for MTex */
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct CurveMapping;
|
||||
struct Image;
|
||||
struct MTex;
|
||||
struct Material;
|
||||
|
||||
struct BrushGpencilSettings {
|
||||
DNA_DEFINE_CXX_METHODS(BrushGpencilSettings)
|
||||
|
||||
/** Amount of smoothing to apply to newly created strokes. */
|
||||
float draw_smoothfac = 0;
|
||||
/** Fill zoom factor */
|
||||
float fill_factor = 0;
|
||||
/** Amount of alpha strength to apply to newly created strokes. */
|
||||
float draw_strength = 0;
|
||||
/** Amount of jitter to apply to newly created strokes. */
|
||||
float draw_jitter = 0;
|
||||
/** Angle when the brush has full thickness. */
|
||||
float draw_angle = 0;
|
||||
/** Factor to apply when angle change (only 90 degrees). */
|
||||
float draw_angle_factor = 0;
|
||||
/** Factor of randomness for pressure. */
|
||||
float draw_random_press = 0;
|
||||
/** Factor of strength for strength. */
|
||||
float draw_random_strength = 0;
|
||||
/** Number of times to apply smooth factor to new strokes. */
|
||||
short draw_smoothlvl = 0;
|
||||
/** Number of times to subdivide new strokes. */
|
||||
short draw_subdivide = 0;
|
||||
/** Layers used for fill. */
|
||||
eGP_FillLayerModes fill_layer_mode = GP_FILL_GPLMODE_VISIBLE;
|
||||
short fill_direction = 0;
|
||||
|
||||
/** Factor for transparency. */
|
||||
float fill_threshold = 0;
|
||||
short fill_solver = 0;
|
||||
/* Type of caps: eGPDstroke_Caps. */
|
||||
int8_t caps_type = 0;
|
||||
char _pad1[1] = {};
|
||||
|
||||
eGPDbrush_Flag2 flag2 = {};
|
||||
|
||||
/** Number of simplify steps. */
|
||||
int fill_simplylvl = 0;
|
||||
/** Type of control lines drawing mode. */
|
||||
eGP_FillDrawModes fill_draw_mode = GP_FILL_DMODE_BOTH;
|
||||
/** Type of gap filling extension to use. */
|
||||
eGP_FillExtendModes fill_extend_mode = GP_FILL_EMODE_EXTEND;
|
||||
|
||||
/** Maximum distance before generate new point for very fast mouse movements. */
|
||||
int input_samples = 0;
|
||||
/** Random factor for UV rotation. */
|
||||
float uv_random = 0;
|
||||
/** Moved to 'Brush.gpencil_brush_type'. */
|
||||
DNA_DEPRECATED int brush_type = 0;
|
||||
/** Soft, hard or stroke. */
|
||||
eGP_BrushEraserMode eraser_mode = GP_BRUSH_ERASER_SOFT;
|
||||
/** Smooth while drawing factor. */
|
||||
float active_smooth = 0;
|
||||
/** Factor to apply to strength for soft eraser. */
|
||||
float era_strength_f = 0;
|
||||
/** Factor to apply to thickness for soft eraser. */
|
||||
float era_thickness_f = 0;
|
||||
/** Internal grease pencil drawing flags. */
|
||||
eGPDbrush_Flag flag = {};
|
||||
|
||||
/** gradient control along y for color */
|
||||
float hardness = 0;
|
||||
/** factor xy of shape for dots gradients */
|
||||
float aspect_ratio[2] = {};
|
||||
/** Simplify adaptive factor */
|
||||
float simplify_f = 0;
|
||||
|
||||
/** Mix color-factor. */
|
||||
float vertex_factor = 0;
|
||||
eGp_Vertex_Mode vertex_mode = GPPAINT_MODE_STROKE;
|
||||
|
||||
eGP_Sculpt_Flag sculpt_flag = {};
|
||||
eGP_Sculpt_Mode_Flag sculpt_mode_flag = {};
|
||||
char _pad2[2] = {};
|
||||
/** Brush preselected mode (Active/Material/Vertex-color). */
|
||||
eGP_BrushMode brush_draw_mode = GP_BRUSH_MODE_ACTIVE;
|
||||
|
||||
/** Randomness for Hue. */
|
||||
float random_hue = 0;
|
||||
/** Randomness for Saturation. */
|
||||
float random_saturation = 0;
|
||||
/** Randomness for Value. */
|
||||
float random_value = 0;
|
||||
|
||||
eBrushColorJitterSettings_Flag color_jitter_flag = {};
|
||||
char _pad3[4] = {};
|
||||
|
||||
/** Factor to extend stroke extremes using fill tool. */
|
||||
float fill_extend_fac = 0;
|
||||
/** Number of pixels to dilate fill area. */
|
||||
int dilate_pixels = 0;
|
||||
|
||||
struct CurveMapping *curve_sensitivity = nullptr;
|
||||
struct CurveMapping *curve_strength = nullptr;
|
||||
struct CurveMapping *curve_jitter = nullptr;
|
||||
struct CurveMapping *curve_rand_pressure = nullptr;
|
||||
struct CurveMapping *curve_rand_strength = nullptr;
|
||||
struct CurveMapping *curve_rand_uv = nullptr;
|
||||
struct CurveMapping *curve_rand_hue = nullptr;
|
||||
struct CurveMapping *curve_rand_saturation = nullptr;
|
||||
struct CurveMapping *curve_rand_value = nullptr;
|
||||
|
||||
/** Factor for external line thickness conversion to outline. */
|
||||
float outline_fac = 0;
|
||||
/** Screen space simplify threshold. Points within this margin are treated as a straight line. */
|
||||
float simplify_px = 0;
|
||||
/** Threshold distance for converting curve types. */
|
||||
float conversion_threshold = 0;
|
||||
/* #CurveType Used for converting. */
|
||||
int8_t curve_type = 0;
|
||||
char _pad4[3] = {};
|
||||
/* Fill Tool gap detection factor. */
|
||||
float fill_gap_factor = 0;
|
||||
char _pad5[4] = {};
|
||||
|
||||
/* optional link of material to replace default in context */
|
||||
/** Material. */
|
||||
struct Material *material = nullptr;
|
||||
/** Material Alternative for secondary operations. */
|
||||
struct Material *material_alt = nullptr;
|
||||
};
|
||||
|
||||
struct BrushCurvesSculptSettings {
|
||||
/** Number of curves added by the add brush. */
|
||||
int add_amount = 0;
|
||||
/** Number of control points in new curves added by the add brush. */
|
||||
int points_per_curve = 0;
|
||||
eBrushCurvesSculptFlag flag = {};
|
||||
/** When shrinking curves, they shouldn't become shorter than this length. */
|
||||
float minimum_length = 0;
|
||||
/** Length of newly added curves when it is not interpolated from other curves. */
|
||||
float curve_length = 0;
|
||||
/** Minimum distance between curve root points used by the Density brush. */
|
||||
float minimum_distance = 0;
|
||||
/** The initial radius of curve. */
|
||||
float curve_radius = 0;
|
||||
/** How often the Density brush tries to add a new curve. */
|
||||
int density_add_attempts = 0;
|
||||
eBrushCurvesSculptDensityMode density_mode = BRUSH_CURVES_SCULPT_DENSITY_MODE_AUTO;
|
||||
char _pad[7] = {};
|
||||
struct CurveMapping *curve_parameter_falloff = nullptr;
|
||||
};
|
||||
|
||||
/** Max number of propagation steps for automasking settings. */
|
||||
#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS 20
|
||||
/**
|
||||
* \note Any change to members that is user visible and that may make the brush differ from the one
|
||||
* saved in the asset library should be followed by a #BKE_brush_tag_unsaved_changes() call.
|
||||
*/
|
||||
struct Brush {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Brush)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_BR;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
struct CurveMapping *curve_distance_falloff = nullptr;
|
||||
struct MTex mtex;
|
||||
struct MTex mask_mtex;
|
||||
|
||||
PreviewImage *preview = nullptr;
|
||||
/** Color gradient. */
|
||||
struct ColorBand *gradient = nullptr;
|
||||
struct PaintCurve *paint_curve = nullptr;
|
||||
|
||||
float normal_weight = 0.0f;
|
||||
/** Rake actual data (not texture), used for sculpt. */
|
||||
float rake_factor = 0;
|
||||
|
||||
/** Blend mode. */
|
||||
short blend = 0;
|
||||
/** #eObjectMode: to see if the brush is compatible, use for display only. */
|
||||
short ob_mode = OB_MODE_ALL_PAINT;
|
||||
/** Brush weight. */
|
||||
float weight = 1.0f; /* weight of brush 0 - 1.0 */
|
||||
/** Brush diameter. */
|
||||
int size = 70; /* diameter of the brush in pixels */
|
||||
/** General purpose flags. */
|
||||
eBrushFlags flag = BRUSH_ALPHA_PRESSURE | BRUSH_SPACE_ATTEN;
|
||||
eBrushFlags2 flag2 = {};
|
||||
eBrushSamplingFlags sampling_flag = BRUSH_PAINT_ANTIALIASING;
|
||||
|
||||
/**
|
||||
* How the stroke behaves when used via the modal operators.
|
||||
*/
|
||||
eBrushStrokeType stroke_method = BRUSH_STROKE_SPACE;
|
||||
char _pad[7] = {};
|
||||
/** Number of samples used to smooth the stroke. */
|
||||
int input_samples = 1;
|
||||
|
||||
/** Pressure influence for mask. */
|
||||
BrushMaskPressureFlags mask_pressure = {};
|
||||
/** Jitter the position of the brush. */
|
||||
float jitter = 0.0f;
|
||||
/** Absolute jitter in pixels. */
|
||||
int jitter_absolute = 0;
|
||||
eOverlayFlags overlay_flags = {};
|
||||
/** Spacing of paint operations. */
|
||||
int spacing = 10;
|
||||
/** Turning radius (in pixels) for smooth stroke. */
|
||||
int smooth_stroke_radius = 75;
|
||||
/** Higher values limit fast changes in the stroke direction. */
|
||||
float smooth_stroke_factor = 0.9f;
|
||||
/** Paint operations / second (airbrush). */
|
||||
float rate = 0.1f;
|
||||
|
||||
/** Color. */
|
||||
float color[3] = {1.0f, 1.0f, 1.0f};
|
||||
eBrushColorJitterSettings_Flag color_jitter_flag = {};
|
||||
float hsv_jitter[3] = {};
|
||||
|
||||
/** Color jitter pressure curves. */
|
||||
struct CurveMapping *curve_rand_hue = nullptr;
|
||||
struct CurveMapping *curve_rand_saturation = nullptr;
|
||||
struct CurveMapping *curve_rand_value = nullptr;
|
||||
|
||||
struct CurveMapping *curve_size = nullptr;
|
||||
struct CurveMapping *curve_strength = nullptr;
|
||||
struct CurveMapping *curve_jitter = nullptr;
|
||||
|
||||
/** Opacity. */
|
||||
float alpha = 1.0f; /* brush strength/intensity probably variable should be renamed? */
|
||||
/** Hardness */
|
||||
float hardness = 0.0f;
|
||||
/** Flow */
|
||||
float flow = 0;
|
||||
/** Wet Mix */
|
||||
float wet_mix = 0;
|
||||
float wet_persistence = 0;
|
||||
/** Density */
|
||||
float density = 0;
|
||||
ePaintBrush_flag paint_flags = {};
|
||||
|
||||
/** Tip Shape */
|
||||
/* Factor that controls the shape of the brush tip by rounding the corners of a square. */
|
||||
/* 0.0 value produces a square, 1.0 produces a circle. */
|
||||
float tip_roundness = 1.0f;
|
||||
float tip_scale_x = 1.0f;
|
||||
|
||||
/** Background color. */
|
||||
float secondary_color[3] = {0, 0, 0};
|
||||
|
||||
/* Deprecated sRGB color for forward compatibility. */
|
||||
DNA_DEPRECATED float rgb[3] = {1.0f, 1.0f, 1.0f};
|
||||
DNA_DEPRECATED float secondary_rgb[3] = {0, 0, 0};
|
||||
|
||||
/** Rate */
|
||||
float dash_ratio = 1.0f;
|
||||
int dash_samples = 20;
|
||||
|
||||
/** The direction of movement for sculpt vertices. */
|
||||
eBrushSculpt_DispDir sculpt_plane = SCULPT_DISP_DIR_AREA;
|
||||
|
||||
/** Offset for plane brushes (clay, flatten, fill, scrape). */
|
||||
float plane_offset = 0.0f;
|
||||
|
||||
int gradient_spacing = 0;
|
||||
/** Source for stroke color gradient application. */
|
||||
eBrushGradientSourceStroke gradient_stroke_mode = BRUSH_GRADIENT_PRESSURE;
|
||||
/** Source for fill brush color gradient application. */
|
||||
eBrushGradientSourceFill gradient_fill_mode = BRUSH_GRADIENT_LINEAR;
|
||||
|
||||
/**
|
||||
* Tag to indicate to the user that the brush has been changed since being imported. Only set for
|
||||
* brushes that are actually imported (must have #ID.lib set). Runtime only.
|
||||
*/
|
||||
char has_unsaved_changes = 0;
|
||||
|
||||
/** Projection shape (sphere, circle). */
|
||||
eBrushFalloffShape falloff_shape = PAINT_FALLOFF_SHAPE_SPHERE;
|
||||
float falloff_angle = 0;
|
||||
|
||||
/** Active sculpt brush type. */
|
||||
eBrushSculptType sculpt_brush_type = SCULPT_BRUSH_TYPE_DRAW;
|
||||
/** Active vertex paint. */
|
||||
eBrushVertexPaintType vertex_brush_type = VPAINT_BRUSH_TYPE_DRAW;
|
||||
/** Active weight paint. */
|
||||
eBrushWeightPaintType weight_brush_type = WPAINT_BRUSH_TYPE_DRAW;
|
||||
/** Active image paint brush type. */
|
||||
eBrushImagePaintType image_brush_type = IMAGE_PAINT_BRUSH_TYPE_DRAW;
|
||||
/** Enum eBrushMaskTool, only used if sculpt_brush_type is SCULPT_BRUSH_TYPE_MASK. */
|
||||
BrushMaskTool mask_tool = BRUSH_MASK_DRAW;
|
||||
/** Active grease pencil brush type. */
|
||||
eBrushGPaintType gpencil_brush_type = GPAINT_BRUSH_TYPE_DRAW;
|
||||
/** Active grease pencil vertex brush type. */
|
||||
eBrushGPVertexType gpencil_vertex_brush_type = GPVERTEX_BRUSH_TYPE_DRAW;
|
||||
/** Active grease pencil sculpt brush type. */
|
||||
eBrushGPSculptType gpencil_sculpt_brush_type = GPSCULPT_BRUSH_TYPE_SMOOTH;
|
||||
/** Active grease pencil weight brush type. */
|
||||
eBrushGPWeightType gpencil_weight_brush_type = GPWEIGHT_BRUSH_TYPE_DRAW;
|
||||
/** Active curves sculpt brush type. */
|
||||
eBrushCurvesSculptType curves_sculpt_brush_type = CURVES_SCULPT_BRUSH_TYPE_COMB;
|
||||
|
||||
char _pad1[2] = {};
|
||||
|
||||
float autosmooth_factor = 0.0f;
|
||||
|
||||
float tilt_strength_factor = 0;
|
||||
|
||||
float topology_rake_factor = 0.0f;
|
||||
|
||||
float crease_pinch_factor = 0.5f;
|
||||
|
||||
float normal_radius_factor = 0.5f;
|
||||
float area_radius_factor = 0.5f;
|
||||
float wet_paint_radius_factor = 0.5f;
|
||||
|
||||
float plane_trim = 0.5f;
|
||||
/** Affectable height of brush (layer height for layer tool, i.e.). */
|
||||
float height = 0;
|
||||
|
||||
/* Plane Brush */
|
||||
float plane_height = 0;
|
||||
float plane_depth = 0;
|
||||
float stabilize_normal = 0;
|
||||
float stabilize_plane = 0;
|
||||
eBrushPlaneInversionMode plane_inversion_mode = BRUSH_PLANE_INVERT_DISPLACEMENT;
|
||||
|
||||
float texture_sample_bias = 0; /* value to added to texture samples */
|
||||
|
||||
/**
|
||||
* This preset is used to specify an exact function used for the distance falloff instead
|
||||
* of doing a Bezier spline evaluation via CurveMapping for performance reasons.
|
||||
* \see #eBrushCurvePreset and #eCurveMappingPreset
|
||||
*/
|
||||
eBrushCurvePreset curve_distance_falloff_preset = BRUSH_CURVE_CUSTOM;
|
||||
|
||||
/* Maximum distance to search fake neighbors from a vertex. */
|
||||
float disconnected_distance_max = 0.1f;
|
||||
|
||||
eBrushDeformTarget deform_target = BRUSH_DEFORM_TARGET_GEOMETRY;
|
||||
|
||||
/* automasking */
|
||||
DNA_DEPRECATED int automasking_flags = 0;
|
||||
DNA_DEPRECATED int automasking_boundary_edges_propagation_steps = 1;
|
||||
|
||||
DNA_DEPRECATED float automasking_start_normal_limit = 0.34906585f; /* 20 degrees */
|
||||
DNA_DEPRECATED float automasking_start_normal_falloff = 0.25f;
|
||||
DNA_DEPRECATED float automasking_view_normal_limit = 1.570796; /* 90 degrees */
|
||||
DNA_DEPRECATED float automasking_view_normal_falloff = 0.25f;
|
||||
|
||||
eBrushElasticDeformType elastic_deform_type = BRUSH_ELASTIC_DEFORM_GRAB;
|
||||
float elastic_deform_volume_preservation = 0;
|
||||
|
||||
/* snake hook */
|
||||
eBrushSnakeHookDeformType snake_hook_deform_type = BRUSH_SNAKE_HOOK_DEFORM_FALLOFF;
|
||||
|
||||
/* pose */
|
||||
eBrushPoseDeformType pose_deform_type = BRUSH_POSE_DEFORM_ROTATE_TWIST;
|
||||
float pose_offset = 0;
|
||||
int pose_smooth_iterations = 4;
|
||||
int pose_ik_segments = 1;
|
||||
eBrushPoseOriginType pose_origin_type = BRUSH_POSE_ORIGIN_TOPOLOGY;
|
||||
|
||||
/* boundary */
|
||||
eBrushBoundaryDeformType boundary_deform_type = BRUSH_BOUNDARY_DEFORM_BEND;
|
||||
eBrushBoundaryFalloffType boundary_falloff_type = BRUSH_BOUNDARY_FALLOFF_CONSTANT;
|
||||
float boundary_offset = 0;
|
||||
|
||||
/* cloth */
|
||||
eBrushClothDeformType cloth_deform_type = BRUSH_CLOTH_DEFORM_DRAG;
|
||||
eBrushClothForceFalloffType cloth_force_falloff_type = BRUSH_CLOTH_FORCE_FALLOFF_RADIAL;
|
||||
eBrushClothSimulationAreaType cloth_simulation_area_type = BRUSH_CLOTH_SIMULATION_AREA_LOCAL;
|
||||
|
||||
float cloth_mass = 1;
|
||||
float cloth_damping = 0.01;
|
||||
|
||||
float cloth_sim_limit = 2.5f;
|
||||
float cloth_sim_falloff = 0.75f;
|
||||
|
||||
float cloth_constraint_softbody_strength = 0;
|
||||
|
||||
/* smooth */
|
||||
eBrushSmoothDeformType smooth_deform_type = BRUSH_SMOOTH_DEFORM_LAPLACIAN;
|
||||
float surface_smooth_shape_preservation = 0;
|
||||
float surface_smooth_current_vertex = 0;
|
||||
int surface_smooth_iterations = 0;
|
||||
|
||||
/* multiplane scrape */
|
||||
float multiplane_scrape_angle = 0;
|
||||
|
||||
/* smear */
|
||||
eBrushSmearDeformType smear_deform_type = BRUSH_SMEAR_DEFORM_DRAG;
|
||||
|
||||
/* slide/relax */
|
||||
eBrushSlideDeformType slide_deform_type = BRUSH_SLIDE_DEFORM_DRAG;
|
||||
|
||||
/* Scene Project brush */
|
||||
eBrushProjectRayDirection project_ray_direction_type = BRUSH_PROJECT_RAY_DIRECTION_VIEW_NORMAL;
|
||||
char _pad2[3] = {};
|
||||
float minimum_distance = 0.0f;
|
||||
|
||||
/* overlay */
|
||||
int texture_overlay_alpha = 33;
|
||||
int mask_overlay_alpha = 33;
|
||||
int cursor_overlay_alpha = 33;
|
||||
|
||||
float unprojected_size = 0.10f; /* diameter of the brush in Blender units */
|
||||
|
||||
/* soften/sharpen */
|
||||
float sharp_threshold = 0;
|
||||
int blur_kernel_radius = 2;
|
||||
eBlurKernelType blur_mode = KERNEL_GAUSSIAN;
|
||||
|
||||
/* fill tool */
|
||||
float fill_threshold = 0.2f;
|
||||
|
||||
float add_col[4] = {1.0, 0.39, 0.39, 0.9};
|
||||
float sub_col[4] = {0.39, 0.39, 1.0, 0.9};
|
||||
|
||||
float stencil_pos[2] = {256, 256};
|
||||
float stencil_dimension[2] = {256, 256};
|
||||
|
||||
float mask_stencil_pos[2] = {256, 256};
|
||||
float mask_stencil_dimension[2] = {256, 256};
|
||||
|
||||
struct BrushGpencilSettings *gpencil_settings = nullptr;
|
||||
struct BrushCurvesSculptSettings *curves_sculpt_settings = nullptr;
|
||||
|
||||
DNA_DEPRECATED int automasking_cavity_blur_steps = 0;
|
||||
DNA_DEPRECATED float automasking_cavity_factor = 1.0f;
|
||||
|
||||
DNA_DEPRECATED struct CurveMapping *automasking_cavity_curve = nullptr;
|
||||
struct MeshAutomaskingSettings *mesh_automasking_settings = nullptr;
|
||||
};
|
||||
|
||||
struct PaletteColor {
|
||||
struct PaletteColor *next = nullptr, *prev = nullptr;
|
||||
/* Two values, one to store color, other to store values for sculpt/weight. */
|
||||
float color[3] = {};
|
||||
float value = 0;
|
||||
|
||||
/* For forward compatibility. */
|
||||
DNA_DEPRECATED float rgb[3] = {};
|
||||
float _pad = {};
|
||||
};
|
||||
|
||||
struct Palette {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_PAL;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
/** Pointer to individual colors. */
|
||||
ListBaseT<PaletteColor> colors = {nullptr, nullptr};
|
||||
|
||||
int active_color = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct PaintCurvePoint {
|
||||
/** Bezier handle. */
|
||||
BezTriple bez = {};
|
||||
/** Pressure on that point. */
|
||||
float pressure = 0;
|
||||
};
|
||||
|
||||
struct PaintCurve {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_PC;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Points of curve. */
|
||||
PaintCurvePoint *points = nullptr;
|
||||
int tot_points = 0;
|
||||
/** Index where next point will be added. */
|
||||
int add_index = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
122
blender-5.2.0/source/blender/makesdna/DNA_cachefile_types.h
Normal file
122
blender-5.2.0/source/blender/makesdna/DNA_cachefile_types.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/* SPDX-FileCopyrightText: 2016 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_set.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* CacheFile::type */
|
||||
enum eCacheFileType : char {
|
||||
CACHEFILE_TYPE_ALEMBIC = 1,
|
||||
CACHEFILE_TYPE_USD = 2,
|
||||
CACHE_FILE_TYPE_INVALID = 0,
|
||||
};
|
||||
|
||||
/* CacheFile::flag */
|
||||
enum eCacheFile_Flag : short {
|
||||
CACHEFILE_DS_EXPAND = (1 << 0),
|
||||
CACHEFILE_UNUSED_0 = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eCacheFile_Flag)
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
/* CacheFile::draw_flag */
|
||||
enum eCacheFile_DrawFlag : short {
|
||||
CACHEFILE_KEYFRAME_DRAWN = (1 << 0),
|
||||
};
|
||||
#endif
|
||||
|
||||
/* CacheFileLayer::flag */
|
||||
enum eCacheFileLayer_Flag : int {
|
||||
CACHEFILE_LAYER_HIDDEN = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eCacheFileLayer_Flag)
|
||||
|
||||
/* CacheFile::velocity_unit
|
||||
* Determines what temporal unit is used to interpret velocity vectors for motion blur effects. */
|
||||
enum eCacheFile_VelocityUnit : char {
|
||||
CACHEFILE_VELOCITY_UNIT_FRAME = 0,
|
||||
CACHEFILE_VELOCITY_UNIT_SECOND = 1,
|
||||
};
|
||||
|
||||
/* Representation of an object's path inside the archive.
|
||||
* Note that this is not a file path. */
|
||||
struct CacheObjectPath {
|
||||
struct CacheObjectPath *next = nullptr, *prev = nullptr;
|
||||
|
||||
char path[/*PATH_MAX*/ 4096] = "";
|
||||
};
|
||||
|
||||
struct CacheFileLayer {
|
||||
struct CacheFileLayer *next = nullptr, *prev = nullptr;
|
||||
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
eCacheFileLayer_Flag flag = {};
|
||||
int _pad = {};
|
||||
};
|
||||
|
||||
struct CacheReader;
|
||||
using CacheFileHandleReaderSet = Set<CacheReader **>;
|
||||
|
||||
struct CacheFile {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_CF;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** Paths of the objects inside of the archive referenced by this CacheFile. */
|
||||
ListBaseT<CacheObjectPath> object_paths = {nullptr, nullptr};
|
||||
|
||||
ListBaseT<CacheFileLayer> layers = {nullptr, nullptr};
|
||||
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
char is_sequence = false;
|
||||
char forward_axis = 0;
|
||||
char up_axis = 0;
|
||||
char override_frame = false;
|
||||
|
||||
float scale = 1.0f;
|
||||
/** The frame/time to lookup in the cache file. */
|
||||
float frame = 0.0f;
|
||||
/** The frame offset to subtract. */
|
||||
float frame_offset = 0;
|
||||
|
||||
/** Animation flag. */
|
||||
eCacheFile_Flag flag = {};
|
||||
|
||||
eCacheFileType type = CACHE_FILE_TYPE_INVALID;
|
||||
|
||||
char _pad1[1] = {};
|
||||
|
||||
/** Index of the currently selected layer in the UI, starts at 1. */
|
||||
int active_layer = 0;
|
||||
|
||||
char _pad2[3] = {};
|
||||
|
||||
eCacheFile_VelocityUnit velocity_unit = {};
|
||||
/* Name of the velocity property in the archive. */
|
||||
char velocity_name[64] = "";
|
||||
|
||||
char _pad3[4] = {};
|
||||
|
||||
/* Runtime */
|
||||
struct CacheArchiveHandle *handle = nullptr;
|
||||
char handle_filepath[/*FILE_MAX*/ 1024] = "";
|
||||
CacheFileHandleReaderSet *handle_readers = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
276
blender-5.2.0/source/blender/makesdna/DNA_camera_types.h
Normal file
276
blender-5.2.0/source/blender/makesdna/DNA_camera_types.h
Normal file
@@ -0,0 +1,276 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_constants.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_gpu_types.h"
|
||||
#include "DNA_image_types.h"
|
||||
#include "DNA_movieclip_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct Object;
|
||||
|
||||
/* type */
|
||||
enum eCamera_Type : char {
|
||||
CAM_PERSP = 0,
|
||||
CAM_ORTHO = 1,
|
||||
CAM_PANO = 2,
|
||||
CAM_CUSTOM = 3,
|
||||
};
|
||||
|
||||
/* panorama_type */
|
||||
enum eCamera_PanoType : char {
|
||||
CAM_PANORAMA_EQUIRECTANGULAR = 0,
|
||||
CAM_PANORAMA_FISHEYE_EQUIDISTANT = 1,
|
||||
CAM_PANORAMA_FISHEYE_EQUISOLID = 2,
|
||||
CAM_PANORAMA_MIRRORBALL = 3,
|
||||
CAM_PANORAMA_FISHEYE_LENS_POLYNOMIAL = 4,
|
||||
CAM_PANORAMA_EQUIANGULAR_CUBEMAP_FACE = 5,
|
||||
CAM_PANORAMA_CENTRAL_CYLINDRICAL = 6,
|
||||
};
|
||||
|
||||
/* custom_mode */
|
||||
enum eCamera_CustomMode : int {
|
||||
CAM_CUSTOM_SHADER_INTERNAL = 0,
|
||||
CAM_CUSTOM_SHADER_EXTERNAL = 1,
|
||||
};
|
||||
|
||||
/* Composition Guides */
|
||||
enum eCompositionGuideFlags : short {
|
||||
COMPOSITION_GUIDES_CENTER = (1 << 0),
|
||||
COMPOSITION_GUIDES_CENTER_DIAG = (1 << 1),
|
||||
COMPOSITION_GUIDES_THIRDS = (1 << 2),
|
||||
COMPOSITION_GUIDES_GOLDEN = (1 << 3),
|
||||
COMPOSITION_GUIDES_GOLDEN_TRI_A = (1 << 4),
|
||||
COMPOSITION_GUIDES_GOLDEN_TRI_B = (1 << 5),
|
||||
COMPOSITION_GUIDES_HARMONY_TRI_A = (1 << 6),
|
||||
COMPOSITION_GUIDES_HARMONY_TRI_B = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eCompositionGuideFlags)
|
||||
|
||||
/* flag */
|
||||
enum eCamera_Flag : short {
|
||||
CAM_SHOWLIMITS = (1 << 0),
|
||||
CAM_SHOWMIST = (1 << 1),
|
||||
CAM_SHOWPASSEPARTOUT = (1 << 2),
|
||||
CAM_SHOW_SAFE_MARGINS = (1 << 3),
|
||||
CAM_SHOWNAME = (1 << 4),
|
||||
CAM_ANGLETOGGLE = (1 << 5),
|
||||
CAM_DS_EXPAND = (1 << 6),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CAM_PANORAMA = (1 << 7), /* deprecated */
|
||||
#endif
|
||||
CAM_SHOWSENSOR = (1 << 8),
|
||||
CAM_SHOW_SAFE_CENTER = (1 << 9),
|
||||
CAM_SHOW_BG_IMAGE = (1 << 10),
|
||||
};
|
||||
ENUM_OPERATORS(eCamera_Flag)
|
||||
|
||||
/* Sensor fit */
|
||||
enum eCamera_SensorFit : char {
|
||||
CAMERA_SENSOR_FIT_AUTO = 0,
|
||||
CAMERA_SENSOR_FIT_HOR = 1,
|
||||
CAMERA_SENSOR_FIT_VERT = 2,
|
||||
};
|
||||
|
||||
#define DEFAULT_SENSOR_WIDTH 36.0f
|
||||
#define DEFAULT_SENSOR_HEIGHT 24.0f
|
||||
|
||||
/* stereo->convergence_mode */
|
||||
enum eCamera_Stereo_ConvergenceMode : short {
|
||||
CAM_S3D_OFFAXIS = 0,
|
||||
CAM_S3D_PARALLEL = 1,
|
||||
CAM_S3D_TOE = 2,
|
||||
};
|
||||
|
||||
/* stereo->pivot */
|
||||
enum eCamera_Stereo_Pivot : short {
|
||||
CAM_S3D_PIVOT_LEFT = 0,
|
||||
CAM_S3D_PIVOT_RIGHT = 1,
|
||||
CAM_S3D_PIVOT_CENTER = 2,
|
||||
};
|
||||
|
||||
/* stereo->flag */
|
||||
enum eCamera_Stereo_Flag : short {
|
||||
CAM_S3D_SPHERICAL = (1 << 0),
|
||||
CAM_S3D_POLE_MERGE = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eCamera_Stereo_Flag)
|
||||
|
||||
/* CameraBGImage->flag */
|
||||
/* may want to use 1 for select ? */
|
||||
enum eCamera_BGImage_Flag : short {
|
||||
CAM_BGIMG_FLAG_EXPANDED = (1 << 1),
|
||||
CAM_BGIMG_FLAG_CAMERACLIP = (1 << 2),
|
||||
CAM_BGIMG_FLAG_DISABLED = (1 << 3),
|
||||
CAM_BGIMG_FLAG_FOREGROUND = (1 << 4),
|
||||
|
||||
/* Camera framing options */
|
||||
/** Don't stretch to fit the camera view. */
|
||||
CAM_BGIMG_FLAG_CAMERA_ASPECT = (1 << 5),
|
||||
/** Crop out the image. */
|
||||
CAM_BGIMG_FLAG_CAMERA_CROP = (1 << 6),
|
||||
|
||||
/* Axis flip options */
|
||||
CAM_BGIMG_FLAG_FLIP_X = (1 << 7),
|
||||
CAM_BGIMG_FLAG_FLIP_Y = (1 << 8),
|
||||
|
||||
/* That background image has been inserted in local override (i.e. it can be fully edited!). */
|
||||
CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(eCamera_BGImage_Flag)
|
||||
|
||||
/* CameraBGImage->source */
|
||||
/* may want to use 1 for select? */
|
||||
enum eCamera_BGImage_Source : short {
|
||||
CAM_BGIMG_SOURCE_IMAGE = 0,
|
||||
CAM_BGIMG_SOURCE_MOVIE = 1,
|
||||
};
|
||||
|
||||
/* CameraDOFSettings->flag */
|
||||
enum eCamera_DOF_Flag : short {
|
||||
CAM_DOF_ENABLED = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eCamera_DOF_Flag)
|
||||
|
||||
/* ------------------------------------------- */
|
||||
/* Stereo Settings */
|
||||
struct CameraStereoSettings {
|
||||
float interocular_distance = 0.065f;
|
||||
float convergence_distance = 30.0f * 0.065f;
|
||||
eCamera_Stereo_ConvergenceMode convergence_mode = {};
|
||||
eCamera_Stereo_Pivot pivot = {};
|
||||
eCamera_Stereo_Flag flag = {};
|
||||
char _pad[2] = {};
|
||||
/* Cut-off angle at which interocular distance start to fade down. */
|
||||
float pole_merge_angle_from = DEG2RADF(60.0f);
|
||||
/* Cut-off angle at which interocular distance stops to fade down. */
|
||||
float pole_merge_angle_to = DEG2RADF(75.0f);
|
||||
};
|
||||
|
||||
/* Background Picture */
|
||||
struct CameraBGImage {
|
||||
struct CameraBGImage *next = nullptr, *prev = nullptr;
|
||||
|
||||
struct Image *ima = nullptr;
|
||||
struct ImageUser iuser;
|
||||
struct MovieClip *clip = nullptr;
|
||||
struct MovieClipUser cuser;
|
||||
float offset[2] = {}, scale = 0, rotation = 0;
|
||||
float alpha = 0;
|
||||
eCamera_BGImage_Flag flag = {};
|
||||
eCamera_BGImage_Source source = {};
|
||||
};
|
||||
|
||||
/** Properties for dof effect. */
|
||||
struct CameraDOFSettings {
|
||||
/** Focal distance for depth of field. */
|
||||
struct Object *focus_object = nullptr;
|
||||
char focus_subtarget[64] = "";
|
||||
float focus_distance = 10.0f;
|
||||
float aperture_fstop = 2.8f;
|
||||
float aperture_rotation = 0;
|
||||
float aperture_ratio = 1.0f;
|
||||
int aperture_blades = 0;
|
||||
eCamera_DOF_Flag flag = {};
|
||||
char _pad[2] = {};
|
||||
};
|
||||
|
||||
struct Camera_Runtime {
|
||||
/* For draw manager. */
|
||||
float drw_corners[2][4][2] = {};
|
||||
float drw_tria[2][2] = {};
|
||||
float drw_depth[2] = {};
|
||||
float drw_focusmat[4][4] = {};
|
||||
float drw_normalmat[4][4] = {};
|
||||
};
|
||||
|
||||
struct Camera {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_CA;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** CAM_PERSP, CAM_ORTHO, CAM_PANO or CAM_CUSTOM. */
|
||||
eCamera_Type type = {};
|
||||
char _pad0[1] = {};
|
||||
/** Composition Guide Flags. */
|
||||
eCompositionGuideFlags composition_guide_flags = {};
|
||||
eCamera_Flag flag = CAM_SHOWPASSEPARTOUT;
|
||||
char _pad1[2] = {};
|
||||
float passepartalpha = 0.5f;
|
||||
float clip_start = 0.1f, clip_end = 1000.0f;
|
||||
float lens = 50.0f, ortho_scale = 6.0, drawsize = 1.0f;
|
||||
float sensor_x = DEFAULT_SENSOR_WIDTH, sensor_y = DEFAULT_SENSOR_HEIGHT;
|
||||
float shiftx = 0, shifty = 0;
|
||||
DNA_DEPRECATED float dof_distance = 0;
|
||||
|
||||
eCamera_SensorFit sensor_fit = {};
|
||||
eCamera_PanoType panorama_type = CAM_PANORAMA_FISHEYE_EQUISOLID;
|
||||
char _pad2[6] = {};
|
||||
|
||||
/* Fish-eye properties. */
|
||||
float fisheye_fov = M_PI;
|
||||
float fisheye_lens = 10.5f;
|
||||
float latitude_min = -0.5f * float(M_PI), latitude_max = 0.5f * float(M_PI);
|
||||
float longitude_min = -M_PI, longitude_max = M_PI;
|
||||
float fisheye_polynomial_k0 = -1.1735143712967577e-05f;
|
||||
float fisheye_polynomial_k1 = -0.019988736953434998f;
|
||||
float fisheye_polynomial_k2 = -3.3525322965709175e-06f;
|
||||
float fisheye_polynomial_k3 = 3.099275275886036e-06f;
|
||||
float fisheye_polynomial_k4 = -2.6064646454854524e-08f;
|
||||
|
||||
/* Central cylindrical range properties. */
|
||||
float central_cylindrical_range_u_min = DEG2RADF(-180.0f);
|
||||
float central_cylindrical_range_u_max = DEG2RADF(180.0f);
|
||||
float central_cylindrical_range_v_min = -1.0f;
|
||||
float central_cylindrical_range_v_max = 1.0f;
|
||||
float central_cylindrical_radius = 1.0f;
|
||||
float _pad3 = {};
|
||||
|
||||
/* Custom Camera properties. */
|
||||
struct Text *custom_shader = nullptr;
|
||||
|
||||
char custom_filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
char custom_bytecode_hash[64] = "";
|
||||
char *custom_bytecode = nullptr;
|
||||
eCamera_CustomMode custom_mode = {};
|
||||
int _pad4 = {};
|
||||
|
||||
DNA_DEPRECATED struct Object *dof_ob = nullptr;
|
||||
DNA_DEPRECATED struct GPUDOFSettings gpu_dof;
|
||||
struct CameraDOFSettings dof;
|
||||
|
||||
/* CameraBGImage reference images */
|
||||
ListBaseT<CameraBGImage> bg_images = {nullptr, nullptr};
|
||||
|
||||
/* Stereo settings */
|
||||
struct CameraStereoSettings stereo;
|
||||
|
||||
/* Compositional guide overlay color */
|
||||
float composition_guide_color[4] = {0.5f, 0.5f, 0.5f, 1.0f};
|
||||
|
||||
/** Runtime data (keep last). */
|
||||
Camera_Runtime runtime;
|
||||
};
|
||||
|
||||
/* **************** CAMERA ********************* */
|
||||
|
||||
} // namespace blender
|
||||
252
blender-5.2.0/source/blender/makesdna/DNA_cloth_types.h
Normal file
252
blender-5.2.0/source/blender/makesdna/DNA_cloth_types.h
Normal file
@@ -0,0 +1,252 @@
|
||||
/* SPDX-FileCopyrightText: 2006 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_constants.h"
|
||||
|
||||
#include "DNA_defs.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* SIMULATION FLAGS: goal flags, etc. */
|
||||
/* These are the bits used in SimSettings.flags. */
|
||||
enum CLOTH_SIMSETTINGS_FLAGS : int {
|
||||
/** Object is only collision object, no cloth simulation is done. */
|
||||
CLOTH_SIMSETTINGS_FLAG_COLLOBJ = (1 << 2),
|
||||
/** DEPRECATED, for versioning only. */
|
||||
CLOTH_SIMSETTINGS_FLAG_GOAL = (1 << 3),
|
||||
/** True if tearing is enabled. */
|
||||
CLOTH_SIMSETTINGS_FLAG_TEARING = (1 << 4),
|
||||
/** True if pressure sim is enabled. */
|
||||
CLOTH_SIMSETTINGS_FLAG_PRESSURE = (1 << 5),
|
||||
/** Use the user defined target volume. */
|
||||
CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL = (1 << 6),
|
||||
/** True if internal spring generation is enabled. */
|
||||
CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS = (1 << 7),
|
||||
/** DEPRECATED, for versioning only. */
|
||||
CLOTH_SIMSETTINGS_FLAG_SCALING = (1 << 8),
|
||||
/** Require internal springs to be created between points with opposite normals. */
|
||||
CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS_NORMAL = (1 << 9),
|
||||
/** Edit cache in edit-mode. */
|
||||
/* CLOTH_SIMSETTINGS_FLAG_CCACHE_EDIT = (1 << 12), */ /* UNUSED */
|
||||
/** Don't allow spring compression. */
|
||||
CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS = (1 << 13),
|
||||
/** Pull ends of loose edges together. */
|
||||
CLOTH_SIMSETTINGS_FLAG_SEW = (1 << 14),
|
||||
/** Make simulation respect deformations in the base object. */
|
||||
CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH = (1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(CLOTH_SIMSETTINGS_FLAGS)
|
||||
|
||||
/* ClothSimSettings.bending_model. */
|
||||
enum CLOTH_BENDING_MODEL : short {
|
||||
CLOTH_BENDING_LINEAR = 0,
|
||||
CLOTH_BENDING_ANGULAR = 1,
|
||||
};
|
||||
|
||||
/* COLLISION FLAGS */
|
||||
enum CLOTH_COLLISIONSETTINGS_FLAGS : int {
|
||||
CLOTH_COLLSETTINGS_FLAG_ENABLED = (1 << 1), /* enables cloth - object collisions */
|
||||
CLOTH_COLLSETTINGS_FLAG_SELF = (1 << 2), /* enables selfcollisions */
|
||||
};
|
||||
ENUM_OPERATORS(CLOTH_COLLISIONSETTINGS_FLAGS)
|
||||
|
||||
/**
|
||||
* This struct contains all the global data required to run a simulation.
|
||||
* At the time of this writing, this structure contains data appropriate
|
||||
* to run a simulation as described in Deformation Constraints in a
|
||||
* 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
|
||||
* variables with different names to minimize confusion.
|
||||
*/
|
||||
struct ClothSimSettings {
|
||||
DNA_DEFINE_CXX_METHODS(ClothSimSettings)
|
||||
|
||||
/** UNUSED. */
|
||||
struct LinkNode *cache = nullptr;
|
||||
/** See SB. */
|
||||
float mingoal = 0.0f;
|
||||
/** Mechanical damping of springs. */
|
||||
DNA_DEPRECATED float Cdis = {};
|
||||
/** Viscous/fluid damping. */
|
||||
float Cvi = 1.0f;
|
||||
/** Gravity/external force vector. */
|
||||
float gravity[3] = {0.0f, 0.0f, -9.81f};
|
||||
/** This is the duration of our time step, computed. */
|
||||
float dt = 0.0f;
|
||||
/** The mass of the entire cloth. */
|
||||
float mass = 0.3f;
|
||||
/** Structural spring stiffness. */
|
||||
DNA_DEPRECATED float structural = 0;
|
||||
/** Shear spring stiffness. */
|
||||
float shear = 5.0f;
|
||||
/** Flexion spring stiffness. */
|
||||
float bending = 0.5f;
|
||||
/** Max bending scaling value, min is "bending". */
|
||||
float max_bend = 0.5f;
|
||||
/** Max structural scaling value, min is "structural". */
|
||||
DNA_DEPRECATED float max_struct = 0;
|
||||
/** Max shear scaling value. */
|
||||
float max_shear = 5.0f;
|
||||
/** Max sewing force. */
|
||||
float max_sewing = 0.0f;
|
||||
/** Used for normalized springs. */
|
||||
float avg_spring_len = 0.0f;
|
||||
/** Parameter how fast cloth runs. */
|
||||
float timescale = 1.0f;
|
||||
/** Multiplies cloth speed. */
|
||||
float time_scale = 1.0f;
|
||||
/** See SB. */
|
||||
float maxgoal = 1.0f;
|
||||
/** Scaling of effector forces (see #softbody_calc_forces). */
|
||||
float eff_force_scale = 1000.0f;
|
||||
/** Scaling of effector wind (see #softbody_calc_forces). */
|
||||
float eff_wind_scale = 250.0f;
|
||||
float sim_time_old = 0.0f;
|
||||
float defgoal = 0.0f;
|
||||
float goalspring = 1.0f;
|
||||
float goalfrict = 0.0f;
|
||||
/** Smoothing of velocities for hair. */
|
||||
float velocity_smooth = 0.0f;
|
||||
/** Minimum density for hair. */
|
||||
float density_target = 0.0f;
|
||||
/** Influence of hair density. */
|
||||
float density_strength = 0.0f;
|
||||
/** Friction with colliders. */
|
||||
float collider_friction = 0.0f;
|
||||
/** Damp the velocity to speed up getting to the resting position. */
|
||||
DNA_DEPRECATED float vel_damping = 0;
|
||||
/** Min amount to shrink cloth by 0.0f (no shrink), 1.0f (shrink to nothing), -1.0f (double the
|
||||
* edge length). */
|
||||
float shrink_min = 0.0f;
|
||||
/** Max amount to shrink cloth by 0.0f (no shrink), 1.0f (shrink to nothing), -1.0f (double the
|
||||
* edge length). */
|
||||
float shrink_max = 0.0f;
|
||||
|
||||
/* Air pressure */
|
||||
/** The uniform pressure that is constantly applied to the mesh. Can be negative. */
|
||||
float uniform_pressure_force = 0.0f;
|
||||
/** User set volume. This is the volume the mesh wants to expand to (the equilibrium volume). */
|
||||
float target_volume = 0.0f;
|
||||
/**
|
||||
* The scaling factor to apply to the actual pressure.
|
||||
* `pressure = ((current_volume/target_volume) - 1 + uniform_pressure_force) * pressure_factor`
|
||||
*/
|
||||
float pressure_factor = 1.0f;
|
||||
/**
|
||||
* Density of the fluid inside or outside the object
|
||||
* for use in the hydro-static pressure gradient.
|
||||
*/
|
||||
float fluid_density = 0.0f;
|
||||
short vgroup_pressure = 0;
|
||||
char _pad7[6] = {};
|
||||
|
||||
/* XXX various hair stuff
|
||||
* should really be separate, this struct is a horrible mess already
|
||||
*/
|
||||
/** Damping of bending springs. */
|
||||
float bending_damping = 0.5f;
|
||||
/** Size of voxel grid cells for continuum dynamics. */
|
||||
float voxel_cell_size = 0.1f;
|
||||
|
||||
/** Number of time steps per frame. */
|
||||
int stepsPerFrame = 5;
|
||||
/** Flags. */
|
||||
CLOTH_SIMSETTINGS_FLAGS flags = CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS_NORMAL;
|
||||
/** How many frames of simulation to do before we start. */
|
||||
DNA_DEPRECATED int preroll = 0;
|
||||
/** In percent!; if tearing enabled, a spring will get cut. */
|
||||
int maxspringlen = 10;
|
||||
/** Which solver should be used? txold. */
|
||||
short solver_type = 0;
|
||||
/** Vertex group for scaling bending stiffness. */
|
||||
short vgroup_bend = 0;
|
||||
/** Optional vertexgroup name for assigning weight. */
|
||||
short vgroup_mass = 0;
|
||||
/** Vertex group for scaling structural stiffness. */
|
||||
short vgroup_struct = 0;
|
||||
/** Vertex group for shrinking cloth. */
|
||||
short vgroup_shrink = 0;
|
||||
/** Vertex group for scaling structural stiffness. */
|
||||
short shapekey_rest = 0;
|
||||
/** Used for presets on GUI. */
|
||||
short presets = 2;
|
||||
short reset = 0;
|
||||
|
||||
struct EffectorWeights *effector_weights = nullptr;
|
||||
|
||||
CLOTH_BENDING_MODEL bending_model = CLOTH_BENDING_ANGULAR;
|
||||
/** Vertex group for scaling structural stiffness. */
|
||||
short vgroup_shear = 0;
|
||||
float tension = 15.0f;
|
||||
float compression = 15.0f;
|
||||
float max_tension = 15.0f;
|
||||
float max_compression = 15.0f;
|
||||
/** Mechanical damping of tension springs. */
|
||||
float tension_damp = 5.0f;
|
||||
/** Mechanical damping of compression springs. */
|
||||
float compression_damp = 5.0f;
|
||||
/** Mechanical damping of shear springs. */
|
||||
float shear_damp = 5.0f;
|
||||
|
||||
/** The maximum length an internal spring can have during creation. */
|
||||
float internal_spring_max_length = 0.0f;
|
||||
/** How much the internal spring can diverge from the vertex normal during creation. */
|
||||
float internal_spring_max_diversion = M_PI_4;
|
||||
/** Vertex group for scaling structural stiffness. */
|
||||
short vgroup_intern = 0;
|
||||
char _pad1[2] = {};
|
||||
float internal_tension = 15.0f;
|
||||
float internal_compression = 15.0f;
|
||||
float max_internal_tension = 15.0f;
|
||||
float max_internal_compression = 15.0f;
|
||||
char _pad0[4] = {};
|
||||
};
|
||||
|
||||
struct ClothCollSettings {
|
||||
DNA_DEFINE_CXX_METHODS(ClothCollSettings)
|
||||
|
||||
/** E.g. pointer to temp memory for collisions. */
|
||||
struct LinkNode *collision_list = nullptr;
|
||||
/** Min distance for collisions. */
|
||||
float epsilon = 0.015f;
|
||||
/** Fiction/damping with self contact. */
|
||||
float self_friction = 5.0f;
|
||||
/** Friction/damping applied on contact with other object. */
|
||||
float friction = 5.0f;
|
||||
/** Collision restitution on contact with other object. */
|
||||
float damping = 0.0f;
|
||||
/** For selfcollision. */
|
||||
float selfepsilon = 0.015f;
|
||||
DNA_DEPRECATED float repel_force = 0;
|
||||
DNA_DEPRECATED float distance_repel = 0;
|
||||
CLOTH_COLLISIONSETTINGS_FLAGS flags = CLOTH_COLLSETTINGS_FLAG_ENABLED;
|
||||
/** How many iterations for the selfcollision loop. */
|
||||
DNA_DEPRECATED short self_loop_count = 0;
|
||||
/** How many iterations for the collision loop. */
|
||||
short loop_count = 2;
|
||||
char _pad[4] = {};
|
||||
/** Only use colliders from this group of objects. */
|
||||
struct Collection *group = nullptr;
|
||||
/** Vgroup to paint which vertices are not used for self collisions. */
|
||||
short vgroup_selfcol = 0;
|
||||
/** Vgroup to paint which vertices are not used for object collisions. */
|
||||
short vgroup_objcol = 0;
|
||||
char _pad2[4] = {};
|
||||
/** Impulse clamp for object collisions. */
|
||||
float clamp = 0.0f;
|
||||
/** Impulse clamp for self collisions. */
|
||||
float self_clamp = 0.0f;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
207
blender-5.2.0/source/blender/makesdna/DNA_collection_types.h
Normal file
207
blender-5.2.0/source/blender/makesdna/DNA_collection_types.h
Normal file
@@ -0,0 +1,207 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* \brief Object groups, one object can be in many groups at once.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
struct CollectionRuntime;
|
||||
} // namespace bke
|
||||
|
||||
struct Collection;
|
||||
struct Object;
|
||||
struct GHash;
|
||||
struct LayoutPanelState;
|
||||
|
||||
enum IOHandlerPanelFlag : int {
|
||||
IO_HANDLER_PANEL_OPEN = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(IOHandlerPanelFlag)
|
||||
|
||||
/* Light linking state of object or collection: defines how they react to the emitters in the
|
||||
* scene. See the comment for the link_state in the CollectionLightLinking for the details. */
|
||||
enum eCollectionLightLinkingState : uint8_t {
|
||||
COLLECTION_LIGHT_LINKING_STATE_INCLUDE = 0,
|
||||
COLLECTION_LIGHT_LINKING_STATE_EXCLUDE = 1,
|
||||
};
|
||||
|
||||
enum eCollectionLineArt_Usage : uint8_t {
|
||||
COLLECTION_LRT_INCLUDE = 0,
|
||||
COLLECTION_LRT_OCCLUSION_ONLY = (1 << 0),
|
||||
COLLECTION_LRT_EXCLUDE = (1 << 1),
|
||||
COLLECTION_LRT_INTERSECTION_ONLY = (1 << 2),
|
||||
COLLECTION_LRT_NO_INTERSECTION = (1 << 3),
|
||||
COLLECTION_LRT_FORCE_INTERSECTION = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eCollectionLineArt_Usage)
|
||||
|
||||
enum eCollectionLineArt_Flags : uint8_t {
|
||||
COLLECTION_LRT_USE_INTERSECTION_MASK = (1 << 0),
|
||||
COLLECTION_LRT_USE_INTERSECTION_PRIORITY = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eCollectionLineArt_Flags)
|
||||
|
||||
/** #Collection.flag */
|
||||
enum eCollection_Flag : uint8_t {
|
||||
/** Disable in viewports. */
|
||||
COLLECTION_HIDE_VIEWPORT = (1 << 0),
|
||||
/** Not selectable in viewport. */
|
||||
COLLECTION_HIDE_SELECT = (1 << 1),
|
||||
// COLLECTION_DISABLED_DEPRECATED = (1 << 2), /* DIRTY */
|
||||
/** Disable in renders. */
|
||||
COLLECTION_HIDE_RENDER = (1 << 3),
|
||||
/** Runtime: object_cache is populated. */
|
||||
COLLECTION_HAS_OBJECT_CACHE = (1 << 4),
|
||||
/** Is master collection embedded in the scene. */
|
||||
COLLECTION_IS_MASTER = (1 << 5),
|
||||
/** for object_cache_instanced. */
|
||||
COLLECTION_HAS_OBJECT_CACHE_INSTANCED = (1 << 6),
|
||||
};
|
||||
ENUM_OPERATORS(eCollection_Flag)
|
||||
|
||||
#define COLLECTION_FLAG_ALL_RUNTIME \
|
||||
(COLLECTION_HAS_OBJECT_CACHE | COLLECTION_HAS_OBJECT_CACHE_INSTANCED)
|
||||
|
||||
/** #Collection.color_tag */
|
||||
enum CollectionColorTag : int8_t {
|
||||
COLLECTION_COLOR_NONE = -1,
|
||||
COLLECTION_COLOR_01,
|
||||
COLLECTION_COLOR_02,
|
||||
COLLECTION_COLOR_03,
|
||||
COLLECTION_COLOR_04,
|
||||
COLLECTION_COLOR_05,
|
||||
COLLECTION_COLOR_06,
|
||||
COLLECTION_COLOR_07,
|
||||
COLLECTION_COLOR_08,
|
||||
|
||||
COLLECTION_COLOR_TOT,
|
||||
};
|
||||
|
||||
/* Light linking relation of a collection or an object. */
|
||||
struct CollectionLightLinking {
|
||||
/* Light and shadow linking configuration, an enumerator of eCollectionLightLinkingState.
|
||||
* The meaning depends on whether the collection is specified as a light or shadow linking on the
|
||||
* Object's LightLinking.
|
||||
*
|
||||
* For the light linking collection:
|
||||
*
|
||||
* - INCLUDE: the receiver is included into the light linking and is only receiving lights from
|
||||
* emitters which include it in their light linking collections. The receiver is not affected
|
||||
* by regular scene lights.
|
||||
*
|
||||
* - EXCLUDE: the receiver does not receive light from this emitter, but is lit by regular
|
||||
* lights in the scene or by emitters which are linked to it via INCLUDE on their
|
||||
* light_state.
|
||||
*
|
||||
* For the shadow linking collection:
|
||||
*
|
||||
* - INCLUDE: the collection or object casts shadows from the emitter. It does not cast shadow
|
||||
* from light sources which do not have INCLUDE on their light linking configuration for it.
|
||||
*
|
||||
* - EXCLUDE: the collection or object does not cast shadow when lit by this emitter, but does
|
||||
* for other light sources in the scene. */
|
||||
eCollectionLightLinkingState link_state = COLLECTION_LIGHT_LINKING_STATE_INCLUDE;
|
||||
|
||||
uint8_t _pad[3] = {};
|
||||
};
|
||||
|
||||
struct CollectionObject {
|
||||
struct CollectionObject *next = nullptr, *prev = nullptr;
|
||||
struct Object *ob = nullptr;
|
||||
|
||||
CollectionLightLinking light_linking;
|
||||
int _pad = {};
|
||||
};
|
||||
|
||||
struct CollectionChild {
|
||||
struct CollectionChild *next = nullptr, *prev = nullptr;
|
||||
struct Collection *collection = nullptr;
|
||||
|
||||
CollectionLightLinking light_linking;
|
||||
int _pad = {};
|
||||
};
|
||||
|
||||
/* Collection IO property storage and access. */
|
||||
typedef struct CollectionImport {
|
||||
/** Identifier that matches the #FileHandlerType.idname. */
|
||||
char fh_idname[64] = "";
|
||||
|
||||
IDProperty *import_properties = nullptr;
|
||||
uint32_t flag = 0;
|
||||
|
||||
uint32_t _pad0 = {};
|
||||
} CollectionImport;
|
||||
|
||||
struct CollectionExport {
|
||||
struct CollectionExport *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Identifier that matches the #FileHandlerType.idname. */
|
||||
char fh_idname[64] = "";
|
||||
char name[64] = "";
|
||||
|
||||
IDProperty *export_properties = nullptr;
|
||||
uint32_t flag = 0;
|
||||
|
||||
uint32_t _pad0 = {};
|
||||
|
||||
ListBaseT<LayoutPanelState> layout_panel_states = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
struct Collection {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_GR;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
/** The ID owning this collection, in case it is an embedded one. */
|
||||
ID *owner_id = nullptr;
|
||||
|
||||
/** CollectionObject. */
|
||||
ListBaseT<CollectionObject> gobject = {nullptr, nullptr};
|
||||
/** CollectionChild. */
|
||||
ListBaseT<CollectionChild> children = {nullptr, nullptr};
|
||||
|
||||
char _pad0[4] = {};
|
||||
|
||||
int active_exporter_index = 0;
|
||||
ListBaseT<CollectionExport> exporters = {nullptr, nullptr};
|
||||
CollectionImport *importer = nullptr;
|
||||
|
||||
struct PreviewImage *preview = nullptr;
|
||||
|
||||
DNA_DEPRECATED unsigned int layer = 0;
|
||||
float instance_offset[3] = {};
|
||||
|
||||
eCollection_Flag flag = {};
|
||||
CollectionColorTag color_tag = COLLECTION_COLOR_NONE;
|
||||
|
||||
char _pad1[2] = {};
|
||||
|
||||
eCollectionLineArt_Usage lineart_usage = COLLECTION_LRT_INCLUDE;
|
||||
eCollectionLineArt_Flags lineart_flags = {};
|
||||
uint8_t lineart_intersection_mask = 0;
|
||||
uint8_t lineart_intersection_priority = 0;
|
||||
|
||||
DNA_DEPRECATED struct ViewLayer *view_layer = nullptr;
|
||||
|
||||
/* Keep last. */
|
||||
bke::CollectionRuntime *runtime = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
251
blender-5.2.0/source/blender/makesdna/DNA_color_types.h
Normal file
251
blender-5.2.0/source/blender/makesdna/DNA_color_types.h
Normal file
@@ -0,0 +1,251 @@
|
||||
/* SPDX-FileCopyrightText: 2006 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_vec_types.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* general defines for kernel functions */
|
||||
#define CM_RESOL 32
|
||||
#define CM_TABLE 256
|
||||
#define CM_TABLEDIV (1.0f / 256.0f)
|
||||
|
||||
#define CM_TOT 4
|
||||
|
||||
#define GPU_SKY_WIDTH 512
|
||||
#define GPU_SKY_HEIGHT 256
|
||||
|
||||
/** #CurveMapPoint.flag */
|
||||
enum eCurveMapPoint_Flag : short {
|
||||
CUMA_SELECT = (1 << 0),
|
||||
CUMA_HANDLE_VECTOR = (1 << 1),
|
||||
CUMA_HANDLE_AUTO_ANIM = (1 << 2),
|
||||
/** Temporary tag for point deletion. */
|
||||
CUMA_REMOVE = (1 << 3),
|
||||
/** Active point in selection. */
|
||||
CUMA_ACTIVE = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eCurveMapPoint_Flag)
|
||||
|
||||
/** #CurveMapping.flag */
|
||||
enum eCurveMappingFlags : int {
|
||||
CUMA_DO_CLIP = (1 << 0),
|
||||
CUMA_PREMULLED = (1 << 1),
|
||||
CUMA_DRAW_CFRA = (1 << 2),
|
||||
CUMA_DRAW_SAMPLE = (1 << 3),
|
||||
|
||||
/** The curve is extended by extrapolation. When not set the curve is extended horizontally. */
|
||||
CUMA_EXTEND_EXTRAPOLATE = (1 << 4),
|
||||
CUMA_USE_WRAPPING = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eCurveMappingFlags)
|
||||
|
||||
/** #CurveMapping.preset */
|
||||
enum eCurveMappingPreset : int {
|
||||
CURVE_PRESET_LINE = 0,
|
||||
CURVE_PRESET_SHARP = 1,
|
||||
CURVE_PRESET_SMOOTH = 2,
|
||||
CURVE_PRESET_MAX = 3,
|
||||
CURVE_PRESET_MID8 = 4,
|
||||
CURVE_PRESET_ROUND = 5,
|
||||
CURVE_PRESET_ROOT = 6,
|
||||
CURVE_PRESET_GAUSS = 7,
|
||||
CURVE_PRESET_BELL = 8,
|
||||
CURVE_PRESET_CONSTANT_MEDIAN = 9,
|
||||
};
|
||||
|
||||
/** #CurveMapping.tone */
|
||||
enum eCurveMappingTone : short {
|
||||
CURVE_TONE_STANDARD = 0,
|
||||
CURVE_TONE_FILMLIKE = 2,
|
||||
};
|
||||
|
||||
/** #Histogram.mode */
|
||||
enum eHistogram_Mode : short {
|
||||
HISTO_MODE_LUMA = 0,
|
||||
HISTO_MODE_RGB = 1,
|
||||
HISTO_MODE_R = 2,
|
||||
HISTO_MODE_G = 3,
|
||||
HISTO_MODE_B = 4,
|
||||
HISTO_MODE_ALPHA = 5,
|
||||
};
|
||||
|
||||
/** #Histogram.flag */
|
||||
enum eHistogram_Flag : short {
|
||||
HISTO_FLAG_LINE = (1 << 0),
|
||||
HISTO_FLAG_SAMPLELINE = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eHistogram_Flag)
|
||||
|
||||
/** #Scopes.wavefrm_mode */
|
||||
enum eScopes_WaveformMode : int {
|
||||
SCOPES_WAVEFRM_LUMA = 0,
|
||||
SCOPES_WAVEFRM_RGB_PARADE = 1,
|
||||
SCOPES_WAVEFRM_YCC_601 = 2,
|
||||
SCOPES_WAVEFRM_YCC_709 = 3,
|
||||
SCOPES_WAVEFRM_YCC_JPEG = 4,
|
||||
SCOPES_WAVEFRM_RGB = 5,
|
||||
};
|
||||
|
||||
/** #Scopes.vecscope_mode */
|
||||
enum eScopes_VecscopeMode : int {
|
||||
SCOPES_VECSCOPE_RGB = 0,
|
||||
SCOPES_VECSCOPE_LUMA = 1,
|
||||
};
|
||||
|
||||
/** #ColorManagedDisplaySettings.emulation */
|
||||
enum eColorManageDisplay_Emulation : char {
|
||||
COLORMANAGE_DISPLAY_EMULATION_AUTO = 0,
|
||||
COLORMANAGE_DISPLAY_EMULATION_OFF = 1,
|
||||
};
|
||||
|
||||
/** #ColorManagedViewSettings.flag */
|
||||
enum eColorManageView_Flag : int {
|
||||
COLORMANAGE_VIEW_USE_CURVES = (1 << 0),
|
||||
COLORMANAGE_VIEW_USE_DEPRECATED = (1 << 1),
|
||||
COLORMANAGE_VIEW_USE_WHITE_BALANCE = (1 << 2),
|
||||
/* Only work as pure view transform and look, no other settings.
|
||||
* Not user editable, but fixed depending on where settings are stored. */
|
||||
COLORMANAGE_VIEW_ONLY_VIEW_LOOK = (1 << 3)
|
||||
};
|
||||
ENUM_OPERATORS(eColorManageView_Flag)
|
||||
|
||||
struct CurveMapPoint {
|
||||
float x = 0, y = 0;
|
||||
/** Shorty for result lookup. */
|
||||
eCurveMapPoint_Flag flag = {};
|
||||
short shorty = 0;
|
||||
};
|
||||
|
||||
struct CurveMap {
|
||||
DNA_DEFINE_CXX_METHODS(CurveMap)
|
||||
|
||||
short totpoint = 0;
|
||||
DNA_DEPRECATED short flag = 0;
|
||||
|
||||
/** Quick multiply value for reading table. */
|
||||
float range = 0;
|
||||
/** The x-axis range for the table. */
|
||||
float mintable = 0, maxtable = 0;
|
||||
/** For extrapolated curves, the direction vector. */
|
||||
float ext_in[2] = {}, ext_out[2] = {};
|
||||
/** Actual curve. */
|
||||
CurveMapPoint *curve = nullptr;
|
||||
/** Display and evaluate table. */
|
||||
CurveMapPoint *table = nullptr;
|
||||
|
||||
/** For RGB curves, pre-multiplied table. */
|
||||
CurveMapPoint *premultable = nullptr;
|
||||
/** For RGB curves, pre-multiplied extrapolation vector. */
|
||||
float premul_ext_in[2] = {};
|
||||
float premul_ext_out[2] = {};
|
||||
eCurveMapPoint_Flag default_handle_type = {};
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
struct CurveMapping {
|
||||
DNA_DEFINE_CXX_METHODS(CurveMapping)
|
||||
|
||||
/** Cur; for buttons, to show active curve. */
|
||||
eCurveMappingFlags flag = {};
|
||||
int cur = 0;
|
||||
eCurveMappingPreset preset = CURVE_PRESET_LINE;
|
||||
int changed_timestamp = 0;
|
||||
|
||||
/** Current rect, clip rect (is default rect too). */
|
||||
rctf curr = {}, clipr = {};
|
||||
|
||||
/** Max 4 builtin curves per mapping struct now. */
|
||||
CurveMap cm[4];
|
||||
/** Black/white point (black[0] abused for current frame). */
|
||||
float black[3] = {}, white[3] = {};
|
||||
/** Black/white point multiply value, for speed. */
|
||||
float bwmul[3] = {};
|
||||
|
||||
/** Sample values, if flag set it draws line and intersection. */
|
||||
float sample[3] = {};
|
||||
|
||||
eCurveMappingTone tone = CURVE_TONE_STANDARD;
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
struct Histogram {
|
||||
int channels = 0;
|
||||
int x_resolution = 0;
|
||||
float data_luma[256] = {};
|
||||
float data_r[256] = {};
|
||||
float data_g[256] = {};
|
||||
float data_b[256] = {};
|
||||
float data_a[256] = {};
|
||||
float xmax = 0, ymax = 0;
|
||||
eHistogram_Mode mode = {};
|
||||
eHistogram_Flag flag = {};
|
||||
int height = 0;
|
||||
|
||||
/** Sample line only (image coords: source -> destination). */
|
||||
float co[2][2] = {};
|
||||
};
|
||||
|
||||
struct Scopes {
|
||||
int ok = 0;
|
||||
int sample_full = 0;
|
||||
int sample_lines = 0;
|
||||
eScopes_WaveformMode wavefrm_mode = {};
|
||||
eScopes_VecscopeMode vecscope_mode = {};
|
||||
int wavefrm_height = 0;
|
||||
int vecscope_height = 0;
|
||||
int waveform_tot = 0;
|
||||
float accuracy = 0;
|
||||
float wavefrm_alpha = 0;
|
||||
float wavefrm_yfac = 0;
|
||||
float vecscope_alpha = 0;
|
||||
float minmax[3][2] = {};
|
||||
struct Histogram hist;
|
||||
float *waveform_1 = nullptr;
|
||||
float *waveform_2 = nullptr;
|
||||
float *waveform_3 = nullptr;
|
||||
float *vecscope = nullptr;
|
||||
float *vecscope_rgb = nullptr;
|
||||
};
|
||||
|
||||
struct ColorManagedViewSettings {
|
||||
eColorManageView_Flag flag = {};
|
||||
char _pad[4] = {};
|
||||
/** Look which is being applied when displaying buffer on the screen
|
||||
* (prior to view transform). */
|
||||
char look[64] = "";
|
||||
/** View transform which is being applied when displaying buffer on the screen. */
|
||||
char view_transform[64] = "";
|
||||
/** F-stop exposure. */
|
||||
float exposure = 0;
|
||||
/** Post-display gamma transform. */
|
||||
float gamma = 0;
|
||||
/** White balance parameters. */
|
||||
float temperature = 0;
|
||||
float tint = 0;
|
||||
/** Pre-display RGB curves transform. */
|
||||
struct CurveMapping *curve_mapping = nullptr;
|
||||
void *_pad2 = nullptr;
|
||||
};
|
||||
|
||||
struct ColorManagedDisplaySettings {
|
||||
char display_device[64] = "";
|
||||
eColorManageDisplay_Emulation emulation = {};
|
||||
char _pad[7] = {};
|
||||
};
|
||||
|
||||
struct ColorManagedColorspaceSettings {
|
||||
char name[/*MAX_COLORSPACE_NAME*/ 64] = "";
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
80
blender-5.2.0/source/blender/makesdna/DNA_colorband_types.h
Normal file
80
blender-5.2.0/source/blender/makesdna/DNA_colorband_types.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_defs.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #ColorBand Types
|
||||
* \{ */
|
||||
|
||||
/** #ColorBand::color_mode. */
|
||||
enum eColorBand_ColorMode : char {
|
||||
COLBAND_BLEND_RGB = 0,
|
||||
COLBAND_BLEND_HSV = 1,
|
||||
COLBAND_BLEND_HSL = 2,
|
||||
};
|
||||
|
||||
/** #ColorBand::ipotype (interpolation). */
|
||||
enum eColorBand_Interp : char {
|
||||
COLBAND_INTERP_LINEAR = 0,
|
||||
COLBAND_INTERP_EASE = 1,
|
||||
COLBAND_INTERP_B_SPLINE = 2,
|
||||
COLBAND_INTERP_CARDINAL = 3,
|
||||
COLBAND_INTERP_CONSTANT = 4,
|
||||
};
|
||||
|
||||
/** #ColorBand::ipotype_hue (hue interpolation). */
|
||||
enum eColorBand_HueInterp : char {
|
||||
COLBAND_HUE_NEAR = 0,
|
||||
COLBAND_HUE_FAR = 1,
|
||||
COLBAND_HUE_CW = 2,
|
||||
COLBAND_HUE_CCW = 3,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #ColorBand
|
||||
* \{ */
|
||||
|
||||
#ifndef DNA_USHORT_FIX
|
||||
# define DNA_USHORT_FIX
|
||||
/**
|
||||
* \deprecated This typedef serves to avoid badly typed functions when
|
||||
* \deprecated compiling while delivering a proper dna.c. Do not use
|
||||
* \deprecated it in any case.
|
||||
*/
|
||||
typedef unsigned short dna_ushort_fix;
|
||||
#endif
|
||||
|
||||
struct CBData {
|
||||
float r = 0, g = 0, b = 0, a = 0, pos = 0;
|
||||
int cur = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* 32 = #MAXCOLORBAND
|
||||
* \note that this has to remain a single struct, for UserDef.
|
||||
*/
|
||||
struct ColorBand {
|
||||
short tot = 0, cur = 0;
|
||||
eColorBand_Interp ipotype = COLBAND_INTERP_LINEAR;
|
||||
eColorBand_HueInterp ipotype_hue = COLBAND_HUE_NEAR;
|
||||
eColorBand_ColorMode color_mode = COLBAND_BLEND_RGB;
|
||||
char _pad[1] = {};
|
||||
|
||||
CBData data[32];
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
} // namespace blender
|
||||
1204
blender-5.2.0/source/blender/makesdna/DNA_constraint_types.h
Normal file
1204
blender-5.2.0/source/blender/makesdna/DNA_constraint_types.h
Normal file
File diff suppressed because it is too large
Load Diff
271
blender-5.2.0/source/blender/makesdna/DNA_curve_enums.h
Normal file
271
blender-5.2.0/source/blender/makesdna/DNA_curve_enums.h
Normal file
@@ -0,0 +1,271 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** Used in `readfile.cc` and `editfont.cc`. */
|
||||
#define MAXTEXTBOX 256
|
||||
|
||||
/* **************** CURVE ********************* */
|
||||
|
||||
/** #Curve.texspace_flag */
|
||||
enum eCurveTexspaceFlag : char {
|
||||
CU_TEXSPACE_FLAG_AUTO = 1 << 0,
|
||||
CU_TEXSPACE_FLAG_AUTO_EVALUATED = 1 << 1,
|
||||
};
|
||||
ENUM_OPERATORS(eCurveTexspaceFlag)
|
||||
|
||||
/** #Curve.flag */
|
||||
enum eCurveFlag : int {
|
||||
CU_3D = 1 << 0,
|
||||
CU_FRONT = 1 << 1,
|
||||
CU_BACK = 1 << 2,
|
||||
CU_PATH = 1 << 3,
|
||||
CU_FOLLOW = 1 << 4,
|
||||
CU_PATH_CLAMP = 1 << 5,
|
||||
CU_DEFORM_BOUNDS_OFF = 1 << 6,
|
||||
CU_STRETCH = 1 << 7,
|
||||
/* CU_OFFS_PATHDIST = 1 << 8, */ /* DEPRECATED */
|
||||
CU_FAST = 1 << 9, /* Font: no filling inside editmode */
|
||||
/* CU_RETOPO = 1 << 10, */ /* DEPRECATED */
|
||||
CU_DS_EXPAND = 1 << 11,
|
||||
/** make use of the path radius if this is enabled (default for new curves) */
|
||||
CU_PATH_RADIUS = 1 << 12,
|
||||
/* CU_DEFORM_FILL = 1 << 13, */ /* DEPRECATED */
|
||||
/** fill bevel caps */
|
||||
CU_FILL_CAPS = 1 << 14,
|
||||
/** map taper object to beveled area */
|
||||
CU_MAP_TAPER = 1 << 15,
|
||||
};
|
||||
ENUM_OPERATORS(eCurveFlag)
|
||||
|
||||
/** #Curve.twist_mode */
|
||||
enum eCurveTwistMode : short {
|
||||
CU_TWIST_Z_UP = 0,
|
||||
/* CU_TWIST_Y_UP = 1, */ /* not used yet */
|
||||
/* CU_TWIST_X_UP = 2, */
|
||||
CU_TWIST_MINIMUM = 3,
|
||||
CU_TWIST_TANGENT = 4,
|
||||
};
|
||||
|
||||
/* Curve.bevfac1_mapping, Curve.bevfac2_mapping, bevel factor mapping */
|
||||
enum eCurveBevfacMapping : char {
|
||||
CU_BEVFAC_MAP_RESOLU = 0,
|
||||
CU_BEVFAC_MAP_SEGMENT = 1,
|
||||
CU_BEVFAC_MAP_SPLINE = 2,
|
||||
};
|
||||
|
||||
/** #Curve.spacemode */
|
||||
enum eCurveSpaceMode : char {
|
||||
CU_ALIGN_X_LEFT = 0,
|
||||
CU_ALIGN_X_MIDDLE = 1,
|
||||
CU_ALIGN_X_RIGHT = 2,
|
||||
CU_ALIGN_X_JUSTIFY = 3,
|
||||
CU_ALIGN_X_FLUSH = 4,
|
||||
};
|
||||
|
||||
/** #Curve.align_y */
|
||||
enum eCurveAlignY : char {
|
||||
CU_ALIGN_Y_TOP_BASELINE = 0,
|
||||
CU_ALIGN_Y_TOP = 1,
|
||||
CU_ALIGN_Y_CENTER = 2,
|
||||
CU_ALIGN_Y_BOTTOM_BASELINE = 3,
|
||||
CU_ALIGN_Y_BOTTOM = 4,
|
||||
};
|
||||
|
||||
/** #Curve.bevel_mode */
|
||||
enum eCurveBevelMode : char {
|
||||
CU_BEV_MODE_ROUND = 0,
|
||||
CU_BEV_MODE_OBJECT = 1,
|
||||
CU_BEV_MODE_CURVE_PROFILE = 2,
|
||||
};
|
||||
|
||||
/** #Curve.taper_radius_mode */
|
||||
enum eCurveTaperRadiusMode : char {
|
||||
/** Override the radius of the bevel point with the taper radius. */
|
||||
CU_TAPER_RADIUS_OVERRIDE = 0,
|
||||
/** Multiply the radius of the bevel point by the taper radius. */
|
||||
CU_TAPER_RADIUS_MULTIPLY = 1,
|
||||
/** Add the radius of the bevel point to the taper radius. */
|
||||
CU_TAPER_RADIUS_ADD = 2,
|
||||
};
|
||||
|
||||
/** #Curve.fill_solver */
|
||||
enum CurveFillSolverType : char {
|
||||
/**
|
||||
* Fast filling without support for self-intersections.
|
||||
* Uses `BLI_scanfill`.
|
||||
*/
|
||||
CU_FILL_SOLVER_SWEEP_LINE = 0,
|
||||
/**
|
||||
* Constrained Delaunay Triangulation with self-intersection and fill rule support.
|
||||
*/
|
||||
CU_FILL_SOLVER_CDT = 1,
|
||||
};
|
||||
|
||||
/** #Curve.fill_rule */
|
||||
enum CurveFillRuleType : char {
|
||||
CU_FILL_RULE_EVEN_ODD = 0,
|
||||
CU_FILL_RULE_NONZERO = 1,
|
||||
};
|
||||
|
||||
/* Curve.overflow. */
|
||||
enum eCurveOverflow : char {
|
||||
CU_OVERFLOW_NONE = 0,
|
||||
CU_OVERFLOW_SCALE = 1,
|
||||
CU_OVERFLOW_TRUNCATE = 2,
|
||||
};
|
||||
|
||||
/** #Nurb.flag */
|
||||
enum eNurbFlag : short {
|
||||
CU_SMOOTH = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eNurbFlag)
|
||||
|
||||
/** #Nurb.type */
|
||||
enum eNurbType : short {
|
||||
CU_POLY = 0,
|
||||
CU_BEZIER = 1,
|
||||
CU_NURBS = 4,
|
||||
CU_TYPE = (CU_POLY | CU_BEZIER | CU_NURBS),
|
||||
|
||||
/* only for adding */
|
||||
CU_PRIMITIVE = 0xF00,
|
||||
|
||||
/* 2 or 4 points */
|
||||
CU_PRIM_CURVE = 0x100,
|
||||
/* 8 points circle */
|
||||
CU_PRIM_CIRCLE = 0x200,
|
||||
/* 4x4 patch NURB. */
|
||||
CU_PRIM_PATCH = 0x300,
|
||||
CU_PRIM_TUBE = 0x400,
|
||||
CU_PRIM_SPHERE = 0x500,
|
||||
CU_PRIM_DONUT = 0x600,
|
||||
/* 5 points, 5th order straight line (for anim path) */
|
||||
CU_PRIM_PATH = 0x700,
|
||||
};
|
||||
|
||||
/* Nurb.flagu, Nurb.flagv */
|
||||
enum eNurbKnotFlag : short {
|
||||
CU_NURB_CYCLIC = 1 << 0,
|
||||
CU_NURB_ENDPOINT = 1 << 1,
|
||||
CU_NURB_BEZIER = 1 << 2,
|
||||
CU_NURB_CUSTOM = 1 << 3,
|
||||
};
|
||||
ENUM_OPERATORS(eNurbKnotFlag)
|
||||
|
||||
#define CU_ACT_NONE -1
|
||||
|
||||
/* *************** BEZTRIPLE **************** */
|
||||
|
||||
/** #BezTriple.f1, #BezTriple.f2, #BezTriple.f3. */
|
||||
enum eBezTriple_Flag : uint8_t {
|
||||
BEZT_FLAG_SELECT = (1 << 0),
|
||||
BEZT_FLAG_TEMP_TAG = (1 << 1), /* always clear. */
|
||||
/* Can be used to ignore keyframe points for certain operations. */
|
||||
BEZT_FLAG_IGNORE_TAG = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eBezTriple_Flag)
|
||||
|
||||
/* h1 h2 (beztriple) */
|
||||
enum eBezTriple_Handle : uint8_t {
|
||||
HD_FREE = 0,
|
||||
HD_AUTO = 1,
|
||||
HD_VECT = 2,
|
||||
HD_ALIGN = 3,
|
||||
HD_AUTO_ANIM = 4, /* auto-clamped handles for animation */
|
||||
HD_ALIGN_DOUBLESIDE = 5, /* align handles, displayed both of them. used for masks */
|
||||
};
|
||||
|
||||
/* auto_handle_type (beztriple) */
|
||||
enum eBezTriple_Auto_Type : char {
|
||||
/* Normal automatic handle that can be refined further. */
|
||||
HD_AUTOTYPE_NORMAL = 0,
|
||||
/* Handle locked horizontal due to being an Auto Clamped local
|
||||
* extreme or a curve endpoint with Constant extrapolation.
|
||||
* Further smoothing is disabled. */
|
||||
HD_AUTOTYPE_LOCKED_FINAL = 1,
|
||||
};
|
||||
|
||||
/* interpolation modes (used only for BezTriple->ipo) */
|
||||
enum eBezTriple_Interpolation : char {
|
||||
/* traditional interpolation */
|
||||
BEZT_IPO_CONST = 0, /* constant interpolation */
|
||||
BEZT_IPO_LIN = 1, /* linear interpolation */
|
||||
BEZT_IPO_BEZ = 2, /* bezier interpolation */
|
||||
|
||||
/* easing equations */
|
||||
BEZT_IPO_BACK = 3,
|
||||
BEZT_IPO_BOUNCE = 4,
|
||||
BEZT_IPO_CIRC = 5,
|
||||
BEZT_IPO_CUBIC = 6,
|
||||
BEZT_IPO_ELASTIC = 7,
|
||||
BEZT_IPO_EXPO = 8,
|
||||
BEZT_IPO_QUAD = 9,
|
||||
BEZT_IPO_QUART = 10,
|
||||
BEZT_IPO_QUINT = 11,
|
||||
BEZT_IPO_SINE = 12,
|
||||
};
|
||||
|
||||
/* easing modes (used only for Keyframes - BezTriple->easing) */
|
||||
enum eBezTriple_Easing : char {
|
||||
BEZT_IPO_EASE_AUTO = 0,
|
||||
|
||||
BEZT_IPO_EASE_IN = 1,
|
||||
BEZT_IPO_EASE_OUT = 2,
|
||||
BEZT_IPO_EASE_IN_OUT = 3,
|
||||
};
|
||||
|
||||
/* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
|
||||
enum eBezTriple_KeyframeType : char {
|
||||
BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */
|
||||
BEZT_KEYTYPE_EXTREME = 1, /* 'extreme' keyframe */
|
||||
BEZT_KEYTYPE_BREAKDOWN = 2, /* 'breakdown' keyframe */
|
||||
BEZT_KEYTYPE_JITTER = 3, /* 'jitter' keyframe (for adding 'filler' secondary motion) */
|
||||
BEZT_KEYTYPE_MOVEHOLD = 4, /* one end of a 'moving hold' */
|
||||
/**
|
||||
* Key set by some automatic helper tool, marking that this key can be erased
|
||||
* and the tool re-run.
|
||||
*/
|
||||
BEZT_KEYTYPE_GENERATED = 5,
|
||||
};
|
||||
|
||||
/* *************** CHARINFO **************** */
|
||||
|
||||
/**
|
||||
* #CharInfo.flag
|
||||
*
|
||||
* \note This must *not* be used for run-time / evaluation flags.
|
||||
* If this is needed, see: #CharTrans.
|
||||
*/
|
||||
enum eCharInfoFlag : char {
|
||||
CU_CHINFO_BOLD = 1 << 0,
|
||||
CU_CHINFO_ITALIC = 1 << 1,
|
||||
CU_CHINFO_UNDERLINE = 1 << 2,
|
||||
CU_CHINFO_UNUSED_3 = 1 << 3, /* Dirty. */
|
||||
CU_CHINFO_SMALLCAPS = 1 << 4,
|
||||
CU_CHINFO_UNUSED_5 = 1 << 5, /* Dirty. */
|
||||
CU_CHINFO_UNUSED_6 = 1 << 6, /* Dirty. */
|
||||
};
|
||||
ENUM_OPERATORS(eCharInfoFlag)
|
||||
|
||||
/** User adjustable as styles (not relating to run-time layout calculation). */
|
||||
#define CU_CHINFO_STYLE_ALL \
|
||||
(CU_CHINFO_BOLD | CU_CHINFO_ITALIC | CU_CHINFO_UNDERLINE | CU_CHINFO_SMALLCAPS)
|
||||
|
||||
/* mixed with KEY_LINEAR but define here since only curve supports */
|
||||
#define KEY_CU_EASE 3
|
||||
|
||||
/* indicates point has been seen during surface duplication */
|
||||
#define SURF_SEEN (1 << 2)
|
||||
|
||||
} // namespace blender
|
||||
430
blender-5.2.0/source/blender/makesdna/DNA_curve_types.h
Normal file
430
blender-5.2.0/source/blender/makesdna/DNA_curve_types.h
Normal file
@@ -0,0 +1,430 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_curve_enums.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BLI_map.hh"
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct Curves;
|
||||
struct CurveProfile;
|
||||
struct EditFont;
|
||||
struct GHash;
|
||||
struct Key;
|
||||
struct Material;
|
||||
struct Object;
|
||||
struct VFont;
|
||||
|
||||
namespace draw {
|
||||
struct CurveBatchCache;
|
||||
}
|
||||
|
||||
/* These two Lines with # tell `makesdna` this struct can be excluded. */
|
||||
#
|
||||
#
|
||||
struct BevPoint {
|
||||
float vec[3], tilt, radius, weight, offset;
|
||||
/** 2D Only. */
|
||||
float sina, cosa;
|
||||
/** 3D Only. */
|
||||
float dir[3], tan[3], quat[4];
|
||||
short dupe_tag;
|
||||
};
|
||||
|
||||
/* These two Lines with # tell `makesdna` this struct can be excluded. */
|
||||
#
|
||||
#
|
||||
struct BevList {
|
||||
struct BevList *next, *prev;
|
||||
int nr, dupe_nr;
|
||||
/** Cyclic when set to any value besides -1. */
|
||||
int poly;
|
||||
int hole;
|
||||
/** Set when the winding direction is reversed. */
|
||||
bool reversed;
|
||||
int charidx;
|
||||
int *segbevcount;
|
||||
float *seglen;
|
||||
BevPoint *bevpoints;
|
||||
};
|
||||
|
||||
/**
|
||||
* Keyframes on F-Curves (allows code reuse of Bezier eval code) and
|
||||
* Points on Bezier Curves/Paths are generally BezTriples.
|
||||
*
|
||||
* \note #BezTriple.tilt location in struct is abused by Key system.
|
||||
*
|
||||
* \note vec in BezTriple looks like this:
|
||||
* - vec[0][0] = x location of handle 1
|
||||
* - vec[0][1] = y location of handle 1
|
||||
* - vec[0][2] = z location of handle 1 (not used for FCurve Points(2d))
|
||||
* - vec[1][0] = x location of control point
|
||||
* - vec[1][1] = y location of control point
|
||||
* - vec[1][2] = z location of control point
|
||||
* - vec[2][0] = x location of handle 2
|
||||
* - vec[2][1] = y location of handle 2
|
||||
* - vec[2][2] = z location of handle 2 (not used for FCurve Points(2d))
|
||||
*/
|
||||
struct BezTriple {
|
||||
float vec[3][3];
|
||||
/** Tilt in 3D View. */
|
||||
float tilt;
|
||||
/** Used for softbody goal weight. */
|
||||
float weight;
|
||||
/** For bevel tapering & modifiers. */
|
||||
float radius;
|
||||
|
||||
/** Ipo: interpolation mode for segment from this BezTriple to the next. */
|
||||
eBezTriple_Interpolation ipo;
|
||||
|
||||
/** H1, h2: the handle type of the two handles. */
|
||||
eBezTriple_Handle h1, h2;
|
||||
/** F1, f2, f3: used for selection status. */
|
||||
eBezTriple_Flag f1, f2, f3;
|
||||
|
||||
/**
|
||||
* Hide is used to indicate whether BezTriple is hidden (3D).
|
||||
*
|
||||
* \warning For #FCurve this is used to store the key-type, see #BEZKEYTYPE.
|
||||
*/
|
||||
char hide;
|
||||
|
||||
/** Easing: easing type for interpolation mode. */
|
||||
eBezTriple_Easing easing;
|
||||
/** BEZT_IPO_BACK. */
|
||||
float back;
|
||||
/** BEZT_IPO_ELASTIC. */
|
||||
float amplitude, period;
|
||||
|
||||
/** Used during auto handle calculation to mark special cases (local extremes). */
|
||||
eBezTriple_Auto_Type auto_handle_type;
|
||||
char _pad[3];
|
||||
};
|
||||
|
||||
/**
|
||||
* Provide access to Keyframe Type info #eBezTriple_KeyframeType in #BezTriple::hide.
|
||||
* \note this is so that we can change it to another location.
|
||||
*/
|
||||
#define BEZKEYTYPE(bezt) (eBezTriple_KeyframeType((bezt)->hide))
|
||||
#define BEZKEYTYPE_LVALUE(bezt) ((bezt)->hide)
|
||||
|
||||
/**
|
||||
* \note #BPoint.tilt location in struct is abused by Key system.
|
||||
*/
|
||||
struct BPoint {
|
||||
float vec[4];
|
||||
/** Tilt in 3D View. */
|
||||
float tilt;
|
||||
/** Used for softbody goal weight. */
|
||||
float weight;
|
||||
/** F1: selection status, hide: is point hidden or not. */
|
||||
uint8_t f1;
|
||||
char _pad1[1];
|
||||
short hide;
|
||||
/** User-set radius per point for beveling etc. */
|
||||
float radius;
|
||||
char _pad[4];
|
||||
};
|
||||
|
||||
/**
|
||||
* \note Nurb name is misleading, since it can be used for polygons too,
|
||||
* also, it should be NURBS (Nurb isn't the singular of Nurbs).
|
||||
*/
|
||||
struct Nurb {
|
||||
DNA_DEFINE_CXX_METHODS(Nurb)
|
||||
|
||||
/** Multiple nurbs per curve object are allowed. */
|
||||
struct Nurb *next = nullptr, *prev = nullptr;
|
||||
eNurbType type = CU_POLY;
|
||||
/** Index into material list. */
|
||||
short mat_nr = 0;
|
||||
short hide = 0;
|
||||
eNurbFlag flag = eNurbFlag{};
|
||||
/** Number of points in the U or V directions. */
|
||||
int pntsu = 0, pntsv = 0;
|
||||
char _pad[4] = {};
|
||||
/** Tessellation resolution in the U or V directions. */
|
||||
short resolu = 0, resolv = 0;
|
||||
short orderu = 0, orderv = 0;
|
||||
eNurbKnotFlag flagu = eNurbKnotFlag{}, flagv = eNurbKnotFlag{};
|
||||
|
||||
float *knotsu = nullptr, *knotsv = nullptr;
|
||||
BPoint *bp = nullptr;
|
||||
BezTriple *bezt = nullptr;
|
||||
|
||||
/** KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE. */
|
||||
short tilt_interp = 0;
|
||||
short radius_interp = 0;
|
||||
|
||||
/* only used for dynamically generated Nurbs created from OB_FONT's */
|
||||
int charidx = 0;
|
||||
};
|
||||
|
||||
struct CharInfo {
|
||||
float kern = 0;
|
||||
short mat_nr = 0;
|
||||
eCharInfoFlag flag = eCharInfoFlag{};
|
||||
char _pad[1] = {};
|
||||
};
|
||||
|
||||
struct TextBox {
|
||||
float x = 0, y = 0, w = 0, h = 0;
|
||||
};
|
||||
|
||||
using CVKeyIndexMap = Map<const void *, struct CVKeyIndex *>;
|
||||
|
||||
/* These two Lines with # tell `makesdna` this struct can be excluded. */
|
||||
#
|
||||
#
|
||||
struct EditNurb {
|
||||
DNA_DEFINE_CXX_METHODS(EditNurb)
|
||||
|
||||
/* base of nurbs' list (old Curve->editnurb) */
|
||||
ListBaseT<Nurb> nurbs = {nullptr, nullptr};
|
||||
|
||||
/* index data for shape keys */
|
||||
CVKeyIndexMap *keyindex = nullptr;
|
||||
|
||||
/* shape key being edited */
|
||||
int shapenr = 0;
|
||||
|
||||
/**
|
||||
* ID data is older than edit-mode data.
|
||||
* Set #Main.is_memfile_undo_flush_needed when enabling.
|
||||
*/
|
||||
char needs_flush_to_id = 0;
|
||||
};
|
||||
|
||||
struct Curve {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Curve)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_CU_LEGACY;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** Actual data, called splines in rna. */
|
||||
ListBaseT<Nurb> nurb = {nullptr, nullptr};
|
||||
|
||||
/** Edited data, not in file, use pointer so we can check for it. */
|
||||
EditNurb *editnurb = nullptr;
|
||||
|
||||
struct Object *bevobj = nullptr, *taperobj = nullptr, *textoncurve = nullptr;
|
||||
struct Key *key = nullptr;
|
||||
struct Material **mat = nullptr;
|
||||
|
||||
struct CurveProfile *bevel_profile = nullptr;
|
||||
|
||||
float texspace_location[3] = {};
|
||||
float texspace_size[3] = {1, 1, 1};
|
||||
|
||||
/**
|
||||
* Object type of curve data-block.
|
||||
* This must be one of:
|
||||
* - #OB_CURVES_LEGACY.
|
||||
* - #OB_FONT.
|
||||
* - #OB_SURF.
|
||||
*/
|
||||
ObjectType ob_type = OB_CURVES_LEGACY;
|
||||
|
||||
char texspace_flag = CU_TEXSPACE_FLAG_AUTO;
|
||||
char _pad0[7] = {};
|
||||
eCurveTwistMode twist_mode = CU_TWIST_MINIMUM;
|
||||
float twist_smooth = 0, smallcaps_scale = 0.75f;
|
||||
|
||||
int pathlen = 100;
|
||||
short bevresol = 4, totcol = 0;
|
||||
eCurveFlag flag = eCurveFlag(CU_DEFORM_BOUNDS_OFF | CU_PATH_RADIUS);
|
||||
float offset = 0.0, extrude = 0, bevel_radius = 0;
|
||||
|
||||
/* default */
|
||||
short resolu = 12, resolv = 12;
|
||||
short resolu_ren = 0, resolv_ren = 0;
|
||||
|
||||
/* edit, index in nurb list */
|
||||
int actnu = 0;
|
||||
/* edit, index in active nurb (BPoint or BezTriple) */
|
||||
int actvert = 0;
|
||||
|
||||
eCurveOverflow overflow = CU_OVERFLOW_NONE;
|
||||
eCurveSpaceMode spacemode = CU_ALIGN_X_LEFT;
|
||||
eCurveAlignY align_y = CU_ALIGN_Y_TOP_BASELINE;
|
||||
eCurveBevelMode bevel_mode = CU_BEV_MODE_ROUND;
|
||||
/**
|
||||
* Determine how the effective radius of the bevel point is computed when a taper object is
|
||||
* specified. The effective radius is a function of the bevel point radius and the taper radius.
|
||||
*/
|
||||
eCurveTaperRadiusMode taper_radius_mode = CU_TAPER_RADIUS_OVERRIDE;
|
||||
/** Triangulation solver for filling 2D curves. */
|
||||
CurveFillSolverType fill_solver = CU_FILL_SOLVER_SWEEP_LINE;
|
||||
/** Fill rule for CDT fill solver. */
|
||||
CurveFillRuleType fill_rule = CU_FILL_RULE_EVEN_ODD;
|
||||
char _pad[1] = {};
|
||||
|
||||
/* font part */
|
||||
float spacing = 1.0f, linedist = 1.0, shear = 0, fsize = 1.0, wordspace = 1.0, ulpos = 0,
|
||||
ulheight = 0.05;
|
||||
float xof = 0, yof = 0;
|
||||
float linewidth = 0;
|
||||
|
||||
/* copy of EditFont vars (wchar_t aligned),
|
||||
* warning! don't use in editmode (storage only) */
|
||||
int pos = 0;
|
||||
int selstart = 0, selend = 0;
|
||||
|
||||
/* text data */
|
||||
/**
|
||||
* Number of characters (unicode code-points)
|
||||
* This is the length of #Curve.strinfo and the result of `BLI_strlen_utf8(cu->str)`.
|
||||
*/
|
||||
int len_char32 = 0;
|
||||
/** Number of bytes: `strlen(Curve.str)`. */
|
||||
int len = 0;
|
||||
char *str = nullptr;
|
||||
struct EditFont *editfont = nullptr;
|
||||
|
||||
char family[64] = "";
|
||||
struct VFont *vfont = nullptr;
|
||||
struct VFont *vfontb = nullptr;
|
||||
struct VFont *vfonti = nullptr;
|
||||
struct VFont *vfontbi = nullptr;
|
||||
|
||||
struct TextBox *tb = nullptr;
|
||||
int totbox = 0, actbox = 0;
|
||||
|
||||
struct CharInfo *strinfo = nullptr;
|
||||
struct CharInfo curinfo;
|
||||
/* font part end */
|
||||
|
||||
/** Current evaluation-time, for use by Objects parented to curves. */
|
||||
float ctime = 0;
|
||||
float bevfac1 = 0.0f, bevfac2 = 1.0f;
|
||||
eCurveBevfacMapping bevfac1_mapping = CU_BEVFAC_MAP_RESOLU,
|
||||
bevfac2_mapping = CU_BEVFAC_MAP_RESOLU;
|
||||
|
||||
char _pad2[1] = {};
|
||||
|
||||
/**
|
||||
* If non-zero, the #editfont and #editnurb pointers are not owned by this #Curve. That means
|
||||
* this curve is a container for the result of object geometry evaluation. This only works
|
||||
* because evaluated object data never outlives original data.
|
||||
*/
|
||||
char edit_data_from_original = 0;
|
||||
|
||||
/**
|
||||
* A pointer to curve data from evaluation. Owned by the object's #geometry_set_eval, either as a
|
||||
* geometry instance or the data of the evaluated #CurveComponent. The curve may also contain
|
||||
* data in the #nurb list, but for evaluated curves this is the proper place to retrieve data,
|
||||
* since it also contains the result of geometry nodes evaluation, and isn't just a copy of the
|
||||
* original object data.
|
||||
*/
|
||||
const struct Curves *curve_eval = nullptr;
|
||||
|
||||
draw::CurveBatchCache *batch_cache = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/** Get the largest material index used by the curves or `nullopt` if there are none. */
|
||||
std::optional<int> material_index_max() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* **************** CURVE ********************* */
|
||||
|
||||
/* checks if the given BezTriple is selected */
|
||||
#define BEZT_ISSEL_ANY(bezt) \
|
||||
(((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT))
|
||||
#define BEZT_ISSEL_ALL(bezt) \
|
||||
(((bezt)->f2 & SELECT) && ((bezt)->f1 & SELECT) && ((bezt)->f3 & SELECT))
|
||||
#define BEZT_ISSEL_ALL_HIDDENHANDLES(v3d, bezt) \
|
||||
((((v3d) != NULL) && ((v3d)->overlay.handle_display == CURVE_HANDLE_NONE)) ? \
|
||||
(bezt)->f2 & SELECT : \
|
||||
BEZT_ISSEL_ALL(bezt))
|
||||
#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) \
|
||||
((((v3d) != NULL) && ((v3d)->overlay.handle_display == CURVE_HANDLE_NONE)) ? \
|
||||
(bezt)->f2 & SELECT : \
|
||||
BEZT_ISSEL_ANY(bezt))
|
||||
|
||||
#define BEZT_ISSEL_IDX(bezt, i) \
|
||||
((i == 0 && (bezt)->f1 & SELECT) || (i == 1 && (bezt)->f2 & SELECT) || \
|
||||
(i == 2 && (bezt)->f3 & SELECT))
|
||||
|
||||
#define BEZT_SEL_ALL(bezt) \
|
||||
{ \
|
||||
(bezt)->f1 |= BEZT_FLAG_SELECT; \
|
||||
(bezt)->f2 |= BEZT_FLAG_SELECT; \
|
||||
(bezt)->f3 |= BEZT_FLAG_SELECT; \
|
||||
} \
|
||||
((void)0)
|
||||
#define BEZT_DESEL_ALL(bezt) \
|
||||
{ \
|
||||
(bezt)->f1 &= ~BEZT_FLAG_SELECT; \
|
||||
(bezt)->f2 &= ~BEZT_FLAG_SELECT; \
|
||||
(bezt)->f3 &= ~BEZT_FLAG_SELECT; \
|
||||
} \
|
||||
((void)0)
|
||||
#define BEZT_SEL_INVERT(bezt) \
|
||||
{ \
|
||||
(bezt)->f1 ^= BEZT_FLAG_SELECT; \
|
||||
(bezt)->f2 ^= BEZT_FLAG_SELECT; \
|
||||
(bezt)->f3 ^= BEZT_FLAG_SELECT; \
|
||||
} \
|
||||
((void)0)
|
||||
|
||||
#define BEZT_SEL_IDX(bezt, i) \
|
||||
{ \
|
||||
switch (i) { \
|
||||
case 0: \
|
||||
(bezt)->f1 |= BEZT_FLAG_SELECT; \
|
||||
break; \
|
||||
case 1: \
|
||||
(bezt)->f2 |= BEZT_FLAG_SELECT; \
|
||||
break; \
|
||||
case 2: \
|
||||
(bezt)->f3 |= BEZT_FLAG_SELECT; \
|
||||
break; \
|
||||
default: \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
((void)0)
|
||||
|
||||
#define BEZT_DESEL_IDX(bezt, i) \
|
||||
{ \
|
||||
switch (i) { \
|
||||
case 0: \
|
||||
(bezt)->f1 &= ~BEZT_FLAG_SELECT; \
|
||||
break; \
|
||||
case 1: \
|
||||
(bezt)->f2 &= ~BEZT_FLAG_SELECT; \
|
||||
break; \
|
||||
case 2: \
|
||||
(bezt)->f3 &= ~BEZT_FLAG_SELECT; \
|
||||
break; \
|
||||
default: \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
((void)0)
|
||||
|
||||
#define BEZT_IS_AUTOH(bezt) \
|
||||
(ELEM((bezt)->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM((bezt)->h2, HD_AUTO, HD_AUTO_ANIM))
|
||||
|
||||
} // namespace blender
|
||||
@@ -0,0 +1,89 @@
|
||||
/* SPDX-FileCopyrightText: 2019 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_vec_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** #CurveProfilePoint.flag */
|
||||
enum eCurveProfilePoint_Flag : short {
|
||||
PROF_SELECT = (1 << 0),
|
||||
PROF_H1_SELECT = (1 << 1),
|
||||
PROF_H2_SELECT = (1 << 2),
|
||||
PROF_ACTIVE = (1 << 3),
|
||||
PROF_H1_ACTIVE = (1 << 4),
|
||||
PROF_H2_ACTIVE = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eCurveProfilePoint_Flag)
|
||||
|
||||
/** #CurveProfile.flag */
|
||||
enum eCurveProfile_Flag : int {
|
||||
PROF_USE_CLIP = (1 << 0), /* Keep control points inside bounding rectangle. */
|
||||
/* PROF_SYMMETRY_MODE = (1 << 1), Unused for now. */
|
||||
PROF_SAMPLE_STRAIGHT_EDGES = (1 << 2), /* Sample extra points on straight edges. */
|
||||
PROF_SAMPLE_EVEN_LENGTHS = (1 << 3), /* Put segments evenly spaced along the path. */
|
||||
PROF_DIRTY_PRESET = (1 << 4), /* Marks when the dynamic preset has been changed. */
|
||||
};
|
||||
ENUM_OPERATORS(eCurveProfile_Flag)
|
||||
|
||||
enum eCurveProfilePresets : int {
|
||||
PROF_PRESET_LINE = 0, /* Default simple line between end points. */
|
||||
PROF_PRESET_SUPPORTS = 1, /* Support loops for a regular curved profile. */
|
||||
PROF_PRESET_CORNICE = 2, /* Molding type example. */
|
||||
PROF_PRESET_CROWN = 3, /* Second molding example. */
|
||||
PROF_PRESET_STEPS = 4, /* Dynamic number of steps defined by segments_len. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Each control point that makes up the profile.
|
||||
* \note The flags use the same enum as Bezier curves, but they aren't guaranteed
|
||||
* to have identical functionality, and all types aren't implemented.
|
||||
*/
|
||||
struct CurveProfilePoint {
|
||||
/** Location of the point, keep together. */
|
||||
float x = 0, y = 0;
|
||||
/** Flag selection state and others. */
|
||||
eCurveProfilePoint_Flag flag = {};
|
||||
/** Flags for both handle's type (eBezTriple_Handle auto, vect, free, and aligned supported). */
|
||||
char h1 = 0, h2 = 0;
|
||||
/** Handle locations, keep together.
|
||||
* \note For now the two handle types are set to the same type in RNA. */
|
||||
float h1_loc[2] = {};
|
||||
float h2_loc[2] = {};
|
||||
char _pad[4] = {};
|
||||
/** Runtime pointer to the point's profile for updating the curve with no direct reference. */
|
||||
struct CurveProfile *profile = nullptr;
|
||||
};
|
||||
|
||||
/** Defines a profile. */
|
||||
struct CurveProfile {
|
||||
/** Number of user-added points that define the profile. */
|
||||
short path_len = 0;
|
||||
/** Number of sampled points. */
|
||||
short segments_len = 0;
|
||||
/** Preset to use when reset. */
|
||||
eCurveProfilePresets preset = PROF_PRESET_LINE;
|
||||
/** Sequence of points defining the shape of the curve. */
|
||||
CurveProfilePoint *path = nullptr;
|
||||
/** Display and evaluation table at higher resolution for curves. */
|
||||
CurveProfilePoint *table = nullptr;
|
||||
/** The positions of the sampled points. Used to display a preview of where they will be. */
|
||||
CurveProfilePoint *segments = nullptr;
|
||||
/** Flag for mode states, sampling options, etc... */
|
||||
eCurveProfile_Flag flag = {};
|
||||
/** Used for keeping track how many times the widget is changed. */
|
||||
int changed_timestamp = 0;
|
||||
/** Widget's current view, and clipping rect (is default rect too). */
|
||||
rctf view_rect = {}, clip_rect = {};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
254
blender-5.2.0/source/blender/makesdna/DNA_curves_types.h
Normal file
254
blender-5.2.0/source/blender/makesdna/DNA_curves_types.h
Normal file
@@ -0,0 +1,254 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_attribute_types.h"
|
||||
#include "DNA_customdata_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
class CurvesGeometry;
|
||||
class CurvesGeometryRuntime;
|
||||
} // namespace bke
|
||||
|
||||
namespace draw {
|
||||
struct CurvesBatchCache;
|
||||
}
|
||||
|
||||
enum CurveType : int8_t {
|
||||
/**
|
||||
* Catmull Rom curves provide automatic smoothness, like Bezier curves with automatic handle
|
||||
* positions. This is the default type for the hair system because of the simplicity of
|
||||
* interaction and data storage.
|
||||
*/
|
||||
CURVE_TYPE_CATMULL_ROM = 0,
|
||||
/**
|
||||
* Poly curves (often called "polylines") have no interpolation at all. They evaluate to the same
|
||||
* set of points as the original control points. They are a good choice for high-resolution
|
||||
* data-sets or when constrained by performance.
|
||||
*/
|
||||
CURVE_TYPE_POLY = 1,
|
||||
/**
|
||||
* Bezier curves provide a common intuitive control system made up of handles and control points.
|
||||
* Handles are stored separately from positions, and do not store extra generic attribute values.
|
||||
* Bezier curves also give the flexibility to set handle types (see #HandleType) that influence
|
||||
* the number of evaluated points in each segment.
|
||||
*/
|
||||
CURVE_TYPE_BEZIER = 2,
|
||||
/**
|
||||
* NURBS curves offer the most flexibility at the cost of increased complexity. Given the choice
|
||||
* of different knot modes (see #KnotsMode) and different orders (see "nurbs_order" attribute),
|
||||
* any of the other types can theoretically be created with a NURBS curve.
|
||||
*
|
||||
* Note that Blender currently does not support custom knot vectors, though that should be
|
||||
* supported in the long term.
|
||||
*/
|
||||
CURVE_TYPE_NURBS = 3,
|
||||
};
|
||||
/* The number of supported curve types. */
|
||||
#define CURVE_TYPES_NUM 4
|
||||
|
||||
enum HandleType : int8_t {
|
||||
/** The handle can be moved anywhere, and doesn't influence the point's other handle. */
|
||||
BEZIER_HANDLE_FREE = 0,
|
||||
/** The location is automatically calculated to be smooth. */
|
||||
BEZIER_HANDLE_AUTO = 1,
|
||||
/** The location is calculated to point to the next/previous control point. */
|
||||
BEZIER_HANDLE_VECTOR = 2,
|
||||
/** The location is constrained to point in the opposite direction as the other handle. */
|
||||
BEZIER_HANDLE_ALIGN = 3,
|
||||
};
|
||||
#define BEZIER_HANDLES_NUM 4
|
||||
|
||||
/** Method used to calculate a NURBS curve's knot vector. */
|
||||
enum KnotsMode : int8_t {
|
||||
NURBS_KNOT_MODE_NORMAL = 0,
|
||||
NURBS_KNOT_MODE_ENDPOINT = 1,
|
||||
NURBS_KNOT_MODE_BEZIER = 2,
|
||||
NURBS_KNOT_MODE_ENDPOINT_BEZIER = 3,
|
||||
NURBS_KNOT_MODE_CUSTOM = 4,
|
||||
};
|
||||
|
||||
/** Method used to calculate the normals of a curve's evaluated points. */
|
||||
enum NormalMode : int8_t {
|
||||
/** Calculate normals with the smallest twist around the curve tangent across the whole curve. */
|
||||
NORMAL_MODE_MINIMUM_TWIST = 0,
|
||||
/**
|
||||
* Calculate normals perpendicular to the Z axis and the curve tangent. If a series of points
|
||||
* is vertical, the X axis is used.
|
||||
*/
|
||||
NORMAL_MODE_Z_UP = 1,
|
||||
/** Interpolate the stored "custom_normal" attribute for the final normals. */
|
||||
NORMAL_MODE_FREE = 2,
|
||||
};
|
||||
|
||||
/** #Curves.flag */
|
||||
enum eCurves_Flag : int {
|
||||
HA_DS_EXPAND = (1 << 0),
|
||||
CV_SCULPT_COLLISION_ENABLED = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eCurves_Flag)
|
||||
|
||||
/** #Curves.symmetry */
|
||||
enum eCurvesSymmetryType : char {
|
||||
CURVES_SYMMETRY_X = 1 << 0,
|
||||
CURVES_SYMMETRY_Y = 1 << 1,
|
||||
CURVES_SYMMETRY_Z = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eCurvesSymmetryType)
|
||||
|
||||
/**
|
||||
* A reusable data structure for geometry consisting of many curves. All control point data is
|
||||
* stored contiguously for better efficiency when there are many curves. Multiple curve types are
|
||||
* supported, as described in #CurveType. Data for each curve is accessed by slicing the main
|
||||
* point attribute data arrays.
|
||||
*
|
||||
* The data structure is meant to separate geometry data storage and processing from Blender
|
||||
* focused ID data-block handling. The struct can also be embedded to allow reusing it.
|
||||
*/
|
||||
struct CurvesGeometry {
|
||||
/**
|
||||
* The start index of each curve in the point data. The size of each curve can be calculated by
|
||||
* subtracting the offset from the next offset. That is valid even for the last curve because
|
||||
* this array is allocated with a length one larger than the number of curves. This is allowed
|
||||
* to be null when there are no curves.
|
||||
*
|
||||
* Every curve offset must be at least one larger than the previous. In other words, every curve
|
||||
* must have at least one point. The first value is 0 and the last value is #point_num.
|
||||
*
|
||||
* This array is shared based on the bke::CurvesGeometryRuntime::curve_offsets_sharing_info.
|
||||
* Avoid accessing directly when possible.
|
||||
*
|
||||
* \note This is *not* stored as an attribute because its size is one larger than #curve_num.
|
||||
*/
|
||||
int *curve_offsets = nullptr;
|
||||
|
||||
/** Curve and point domain attributes. */
|
||||
struct AttributeStorage attribute_storage;
|
||||
|
||||
/**
|
||||
* Generic attributes are stored in #attribute_storage. This is still used for vertex groups.
|
||||
*/
|
||||
CustomData point_data;
|
||||
|
||||
/** Used only for backward compatibility with old files. */
|
||||
CustomData curve_data_legacy;
|
||||
|
||||
/**
|
||||
* The total number of control points in all curves.
|
||||
*/
|
||||
int point_num = 0;
|
||||
/**
|
||||
* The number of curves.
|
||||
*/
|
||||
int curve_num = 0;
|
||||
|
||||
/**
|
||||
* List of vertex group (#bDeformGroup) names and flags only.
|
||||
*/
|
||||
ListBaseT<struct bDeformGroup> vertex_group_names = {nullptr, nullptr};
|
||||
/** The active index in the #vertex_group_names list. */
|
||||
int vertex_group_active_index = 0;
|
||||
|
||||
/** Set to -1 when none is active. */
|
||||
int attributes_active_index = 0;
|
||||
|
||||
/**
|
||||
* Runtime data for curves, stored as a pointer to allow defining this as a C++ class.
|
||||
*/
|
||||
bke::CurvesGeometryRuntime *runtime = nullptr;
|
||||
|
||||
/**
|
||||
* Knot values for NURBS curves with NURBS_KNOT_MODE_CUSTOM mode.
|
||||
* Array is allocated with bke::CurvesGeometry::nurbs_custom_knots_update_size() or
|
||||
* bke::CurvesGeometry::nurbs_custom_knots_resize().
|
||||
* Indexed with bke::CurvesGeometry::nurbs_custom_knots_by_curve().
|
||||
*/
|
||||
float *custom_knots = nullptr;
|
||||
|
||||
int custom_knot_num = 0;
|
||||
|
||||
char _pad[4] = {};
|
||||
|
||||
#ifdef __cplusplus
|
||||
bke::CurvesGeometry &wrap();
|
||||
const bke::CurvesGeometry &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* A data-block corresponding to a number of curves of various types with various attributes.
|
||||
* Geometry data (as opposed to pointers to other data-blocks and higher level data for user
|
||||
* interaction) is embedded in the #CurvesGeometry struct.
|
||||
*/
|
||||
struct Curves {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_CV;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after #id). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** Geometry data. */
|
||||
CurvesGeometry geometry;
|
||||
|
||||
eCurves_Flag flag = {};
|
||||
int attributes_active_index_legacy = 0;
|
||||
|
||||
/* Materials. */
|
||||
struct Material **mat = nullptr;
|
||||
short totcol = 0;
|
||||
|
||||
/**
|
||||
* User-defined symmetry flag that causes editing operations to maintain
|
||||
* symmetrical geometry.
|
||||
*/
|
||||
eCurvesSymmetryType symmetry = {};
|
||||
/**
|
||||
* #AttrDomain. The active domain for edit/sculpt mode selection. Only one selection mode can
|
||||
* be active at a time.
|
||||
*/
|
||||
char selection_domain = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
/**
|
||||
* Used as base mesh when curves represent e.g. hair or fur. This surface is used in edit modes.
|
||||
* When set, the curves will have attributes that indicate a position on this surface. This is
|
||||
* used for deforming the curves when the surface is deformed dynamically.
|
||||
*
|
||||
* This is expected to be a mesh object.
|
||||
*/
|
||||
struct Object *surface = nullptr;
|
||||
|
||||
/**
|
||||
* The name of the attribute on the surface #Mesh used to give meaning to the UV attachment
|
||||
* coordinates stored for each curve. Expected to be a 2D vector attribute on the face corner
|
||||
* domain.
|
||||
*/
|
||||
char *surface_uv_map = nullptr;
|
||||
|
||||
/* Distance to keep the curves away from the surface. */
|
||||
float surface_collision_distance = 0.005f;
|
||||
char _pad2[4] = {};
|
||||
|
||||
/* Draw cache to store data used for viewport drawing. */
|
||||
draw::CurvesBatchCache *batch_cache = nullptr;
|
||||
};
|
||||
|
||||
/* Only one material supported currently. */
|
||||
#define CURVES_MATERIAL_NR 1
|
||||
|
||||
} // namespace blender
|
||||
270
blender-5.2.0/source/blender/makesdna/DNA_customdata_types.h
Normal file
270
blender-5.2.0/source/blender/makesdna/DNA_customdata_types.h
Normal file
@@ -0,0 +1,270 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Used for custom mesh data types (stored per vert/edge/loop/face)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
#include "BLI_implicit_sharing.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** #CustomDataLayer.type */
|
||||
enum eCustomDataType : int {
|
||||
/**
|
||||
* Used by GPU attributes in the cases when we don't know which layer
|
||||
* we are addressing in advance.
|
||||
*/
|
||||
CD_AUTO_FROM_NAME = -1,
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_MVERT = 0,
|
||||
CD_MSTICKY = 1,
|
||||
#endif
|
||||
CD_MDEFORMVERT = 2, /* Array of #MDeformVert. */
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_MEDGE = 3,
|
||||
#endif
|
||||
CD_MFACE = 4,
|
||||
CD_MTFACE = 5,
|
||||
CD_MCOL = 6,
|
||||
CD_ORIGINDEX = 7,
|
||||
/**
|
||||
* Used as temporary storage for some areas that support interpolating custom normals.
|
||||
* Using a separate type from generic 3D vectors is a simple way of keeping values normalized.
|
||||
*/
|
||||
CD_NORMAL = 8,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_FACEMAP = 9,
|
||||
#endif
|
||||
CD_PROP_FLOAT = 10,
|
||||
CD_PROP_INT32 = 11,
|
||||
CD_PROP_STRING = 12,
|
||||
CD_ORIGSPACE = 13, /* for modifier stack face location mapping */
|
||||
CD_ORCO = 14, /* undeformed vertex coordinates, normalized to 0..1 range */
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_MTEXPOLY = 15,
|
||||
CD_MLOOPUV = 16,
|
||||
#endif
|
||||
CD_PROP_BYTE_COLOR = 17,
|
||||
/**
|
||||
* Previously used for runtime corner tangent storage in mesh #CustomData. Currently only used
|
||||
* as an identifier to choose tangents in a few places.
|
||||
*/
|
||||
CD_TANGENT = 18,
|
||||
CD_MDISPS = 19,
|
||||
CD_PROP_FLOAT4X4 = 20,
|
||||
/* CD_ID_MCOL = 21, */
|
||||
CD_PROP_INT16_2D = 22,
|
||||
CD_CLOTH_ORCO = 23,
|
||||
CD_PROP_FLOAT4 = 24,
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_MPOLY = 25,
|
||||
CD_MLOOP = 26,
|
||||
#endif
|
||||
CD_SHAPE_KEYINDEX = 27,
|
||||
CD_SHAPEKEY = 28,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_BWEIGHT = 29,
|
||||
CD_CREASE = 30,
|
||||
#endif
|
||||
CD_ORIGSPACE_MLOOP = 31,
|
||||
/* CD_PREVIEW_MLOOPCOL = 32, */ /* UNUSED */
|
||||
CD_BM_ELEM_PYPTR = 33,
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_PAINT_MASK = 34,
|
||||
#endif
|
||||
CD_GRID_PAINT_MASK = 35,
|
||||
CD_MVERT_SKIN = 36,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_FREESTYLE_EDGE = 37,
|
||||
CD_FREESTYLE_FACE = 38,
|
||||
#endif
|
||||
CD_MLOOPTANGENT = 39,
|
||||
CD_TESSLOOPNORMAL = 40,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_CUSTOMLOOPNORMAL = 41,
|
||||
CD_SCULPT_FACE_SETS = 42,
|
||||
#endif
|
||||
|
||||
/* CD_LOCATION = 43, */ /* UNUSED */
|
||||
/* CD_RADIUS = 44, */ /* UNUSED */
|
||||
CD_PROP_INT8 = 45,
|
||||
/* Two 32-bit signed integers. */
|
||||
CD_PROP_INT32_2D = 46,
|
||||
|
||||
CD_PROP_COLOR = 47,
|
||||
CD_PROP_FLOAT3 = 48,
|
||||
CD_PROP_FLOAT2 = 49,
|
||||
CD_PROP_BOOL = 50,
|
||||
|
||||
/* CD_HAIRLENGTH = 51, */ /* UNUSED */
|
||||
|
||||
CD_PROP_QUATERNION = 52,
|
||||
|
||||
CD_NUMTYPES = 53,
|
||||
};
|
||||
|
||||
/* Bits for #eCustomDataMask */
|
||||
|
||||
#define CD_MASK_MDEFORMVERT (1 << CD_MDEFORMVERT)
|
||||
#define CD_MASK_MFACE (1 << CD_MFACE)
|
||||
#define CD_MASK_MTFACE (1 << CD_MTFACE)
|
||||
#define CD_MASK_MCOL (1 << CD_MCOL)
|
||||
#define CD_MASK_ORIGINDEX (1 << CD_ORIGINDEX)
|
||||
#define CD_MASK_NORMAL (1 << CD_NORMAL)
|
||||
#define CD_MASK_PROP_FLOAT (1 << CD_PROP_FLOAT)
|
||||
#define CD_MASK_PROP_INT32 (1 << CD_PROP_INT32)
|
||||
#define CD_MASK_PROP_STRING (1 << CD_PROP_STRING)
|
||||
#define CD_MASK_ORIGSPACE (1 << CD_ORIGSPACE)
|
||||
#define CD_MASK_ORCO (1 << CD_ORCO)
|
||||
#define CD_MASK_PROP_BYTE_COLOR (1 << CD_PROP_BYTE_COLOR)
|
||||
#define CD_MASK_MDISPS (1 << CD_MDISPS)
|
||||
#define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO)
|
||||
|
||||
#define CD_MASK_SHAPE_KEYINDEX (1 << CD_SHAPE_KEYINDEX)
|
||||
#define CD_MASK_SHAPEKEY (1 << CD_SHAPEKEY)
|
||||
#define CD_MASK_ORIGSPACE_MLOOP (1LL << CD_ORIGSPACE_MLOOP)
|
||||
#define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR)
|
||||
|
||||
#define CD_MASK_GRID_PAINT_MASK (1LL << CD_GRID_PAINT_MASK)
|
||||
#define CD_MASK_MVERT_SKIN (1LL << CD_MVERT_SKIN)
|
||||
#define CD_MASK_MLOOPTANGENT (1LL << CD_MLOOPTANGENT)
|
||||
#define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL)
|
||||
#define CD_MASK_PROP_COLOR (1ULL << CD_PROP_COLOR)
|
||||
#define CD_MASK_PROP_FLOAT4 (1ULL << CD_PROP_FLOAT4)
|
||||
#define CD_MASK_PROP_FLOAT3 (1ULL << CD_PROP_FLOAT3)
|
||||
#define CD_MASK_PROP_FLOAT2 (1ULL << CD_PROP_FLOAT2)
|
||||
#define CD_MASK_PROP_BOOL (1ULL << CD_PROP_BOOL)
|
||||
#define CD_MASK_PROP_INT8 (1ULL << CD_PROP_INT8)
|
||||
#define CD_MASK_PROP_INT16_2D (1ULL << CD_PROP_INT16_2D)
|
||||
#define CD_MASK_PROP_INT32_2D (1ULL << CD_PROP_INT32_2D)
|
||||
#define CD_MASK_PROP_QUATERNION (1ULL << CD_PROP_QUATERNION)
|
||||
#define CD_MASK_PROP_FLOAT4X4 (1ULL << CD_PROP_FLOAT4X4)
|
||||
|
||||
/** Multi-resolution loop data. */
|
||||
#define CD_MASK_MULTIRES_GRIDS (CD_MASK_MDISPS | CD_GRID_PAINT_MASK)
|
||||
|
||||
/** All data layers. */
|
||||
#define CD_MASK_ALL (~0LL)
|
||||
|
||||
/** All generic attributes. */
|
||||
#define CD_MASK_PROP_ALL \
|
||||
(CD_MASK_PROP_FLOAT | CD_MASK_PROP_FLOAT2 | CD_MASK_PROP_FLOAT3 | CD_MASK_PROP_FLOAT4 | \
|
||||
CD_MASK_PROP_INT32 | CD_MASK_PROP_COLOR | CD_MASK_PROP_STRING | CD_MASK_PROP_BYTE_COLOR | \
|
||||
CD_MASK_PROP_BOOL | CD_MASK_PROP_INT8 | CD_MASK_PROP_INT16_2D | CD_MASK_PROP_INT32_2D | \
|
||||
CD_MASK_PROP_QUATERNION | CD_MASK_PROP_FLOAT4X4)
|
||||
|
||||
/** All color attributes */
|
||||
#define CD_MASK_COLOR_ALL (CD_MASK_PROP_COLOR | CD_MASK_PROP_BYTE_COLOR)
|
||||
|
||||
/** Limits. */
|
||||
#define MAX_MTFACE 8
|
||||
|
||||
#define MAX_CUSTOMDATA_LAYER_NAME 68
|
||||
#define MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX 64
|
||||
|
||||
/** #CustomDataLayer.flag */
|
||||
enum eCustomDataLayer_Flag : int {
|
||||
/**
|
||||
* Indicates layer should not be copied by #CustomData_from_template or #CustomData_copy_data.
|
||||
*/
|
||||
CD_FLAG_NOCOPY = (1 << 0),
|
||||
CD_FLAG_UNUSED = (1 << 1),
|
||||
/** Indicates the layer is only temporary, also implies no copy */
|
||||
CD_FLAG_TEMPORARY = ((1 << 2) | CD_FLAG_NOCOPY),
|
||||
/** Indicates the layer is stored in an external file */
|
||||
CD_FLAG_EXTERNAL = (1 << 3),
|
||||
/** Indicates external data is read into memory */
|
||||
CD_FLAG_IN_MEMORY = (1 << 4),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
CD_FLAG_COLOR_ACTIVE = (1 << 5),
|
||||
CD_FLAG_COLOR_RENDER = (1 << 6)
|
||||
#endif
|
||||
};
|
||||
ENUM_OPERATORS(eCustomDataLayer_Flag)
|
||||
|
||||
/** Descriptor and storage for a custom data layer. */
|
||||
struct CustomDataLayer {
|
||||
/** Type of data in layer. */
|
||||
eCustomDataType type = {};
|
||||
/** In editmode, offset of layer in block. */
|
||||
int offset = 0;
|
||||
/** General purpose flag. */
|
||||
eCustomDataLayer_Flag flag = {};
|
||||
/** Number of the active layer of this type. */
|
||||
int active = 0;
|
||||
/** Number of the layer to render. */
|
||||
int active_rnd = 0;
|
||||
/** Shape key-block unique id reference. */
|
||||
int uid = 0;
|
||||
/** Layer name. */
|
||||
char name[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
char _pad1[4] = {};
|
||||
/** Layer data. */
|
||||
void *data = nullptr;
|
||||
/**
|
||||
* Run-time data that allows sharing `data` with other entities (mostly custom data layers on
|
||||
* other geometries).
|
||||
*/
|
||||
const ImplicitSharingInfoHandle *sharing_info = nullptr;
|
||||
};
|
||||
|
||||
struct CustomDataExternal {
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
};
|
||||
|
||||
/**
|
||||
* #CustomData stores an arbitrary number of typed data "layers" for multiple elements.
|
||||
* The layers are typically geometry attributes, and the elements are typically geometry
|
||||
* elements like vertices, edges, or curves.
|
||||
*
|
||||
* Each layer has a type, often with certain semantics beyond the type of the raw data. However,
|
||||
* a subset of the layer types are exposed as attributes and accessed with a higher level API
|
||||
* built around #AttributeAccessor.
|
||||
*
|
||||
* For #BMesh, #CustomData is adapted to store the data from all layers in a single "block" which
|
||||
* is allocated for each element. Each layer's data is stored at a certain offset into every
|
||||
* block's data.
|
||||
*/
|
||||
struct CustomData {
|
||||
/** Layers ordered by type. */
|
||||
CustomDataLayer *layers = nullptr;
|
||||
/**
|
||||
* Runtime only map from types to indices of first layer of that type,
|
||||
* Correct size of #CD_NUMTYPES is ensured by CustomData_update_typemap.
|
||||
*/
|
||||
int typemap[53] = {};
|
||||
/** Number of layers, size of layers array. */
|
||||
int totlayer = 0, maxlayer = 0;
|
||||
/** In editmode, total size of all data layers. */
|
||||
int totsize = 0;
|
||||
/** (BMesh Only): Memory pool for allocation of blocks. */
|
||||
struct BLI_mempool *pool = nullptr;
|
||||
/** External file storing custom-data layers. */
|
||||
CustomDataExternal *external = nullptr;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
using eCustomDataMask = uint64_t;
|
||||
#endif
|
||||
|
||||
struct CustomData_MeshMasks {
|
||||
uint64_t vmask = 0;
|
||||
uint64_t emask = 0;
|
||||
uint64_t fmask = 0;
|
||||
uint64_t pmask = 0;
|
||||
uint64_t lmask = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
170
blender-5.2.0/source/blender/makesdna/DNA_defs.h
Normal file
170
blender-5.2.0/source/blender/makesdna/DNA_defs.h
Normal file
@@ -0,0 +1,170 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Group generic defines for all DNA headers may use in this file.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* `makesdna` ignores. */
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/* allow use of deprecated items */
|
||||
# define DNA_DEPRECATED
|
||||
#else
|
||||
# if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
|
||||
# define DNA_DEPRECATED [[deprecated]]
|
||||
# else
|
||||
# define DNA_DEPRECATED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* GCC considers default member initialization in constructors deprecated.
|
||||
* This macro helps silence that while still warning in other cases */
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
/* clang-format off */
|
||||
# define DNA_DEPRECATED_IGNORE(statement) \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||
statement \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
/* clang-format on */
|
||||
#else
|
||||
# define DNA_DEPRECATED_IGNORE(statement) statement
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define DNA_PRIVATE_ATTR __attribute__((deprecated))
|
||||
#else
|
||||
# define DNA_PRIVATE_ATTR
|
||||
#endif
|
||||
|
||||
/* poison pragma */
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
# define DNA_DEPRECATED_GCC_POISON 0
|
||||
#else
|
||||
/* enable the pragma if we can */
|
||||
# ifdef __GNUC__
|
||||
# define DNA_DEPRECATED_GCC_POISON 1
|
||||
# else
|
||||
# define DNA_DEPRECATED_GCC_POISON 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* hrmf, we need a better include then this */
|
||||
#include "../blenlib/BLI_sys_types.h" /* needed for int64_t only! */
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* non-id name variables should use this length */
|
||||
#define MAX_NAME 64
|
||||
|
||||
/* #DNA_DEFINE_CXX_METHODS is used to define C++ methods which are needed for proper/safe resource
|
||||
* management, making unsafe (from an ownership perspective: i.e. pointers which sometimes needs to
|
||||
* be set to nullptr on copy, sometimes needs to be dupalloc-ed) operations explicit, and taking
|
||||
* care of compiler specific warnings when dealing with members marked with DNA_DEPRECATED.
|
||||
*
|
||||
* The `class_name` argument is to match the structure name the macro is used from.
|
||||
*
|
||||
* Typical usage example:
|
||||
*
|
||||
* struct Object {
|
||||
* DNA_DEFINE_CXX_METHODS(Object)
|
||||
* };
|
||||
*/
|
||||
|
||||
/* Forward-declared here since there is no simple header file to be pulled for this functionality.
|
||||
* Avoids pulling `string.h` from this header to get access to #memcpy. */
|
||||
void _DNA_internal_memcpy(void *dst, const void *src, size_t size);
|
||||
void _DNA_internal_memzero(void *dst, size_t size);
|
||||
void _DNA_internal_swap(void *a, void *b, size_t size);
|
||||
|
||||
namespace dna::internal {
|
||||
|
||||
template<class T> class ShallowDataConstRef {
|
||||
public:
|
||||
constexpr explicit ShallowDataConstRef(const T &ref) : ref_(ref) {}
|
||||
|
||||
const T *get_pointer() const
|
||||
{
|
||||
return &ref_;
|
||||
}
|
||||
|
||||
private:
|
||||
const T &ref_;
|
||||
};
|
||||
|
||||
class ShallowZeroInitializeTag {};
|
||||
|
||||
} // namespace dna::internal
|
||||
|
||||
#define DNA_DEFINE_CXX_METHODS(class_name) \
|
||||
DNA_DEPRECATED_IGNORE(class_name() = default;) \
|
||||
~class_name() = default; \
|
||||
/* Delete copy and assignment, which are not safe for resource ownership. */ \
|
||||
class_name(const class_name &other) = delete; \
|
||||
class_name(class_name &&other) noexcept = delete; \
|
||||
class_name &operator=(const class_name &other) = delete; \
|
||||
class_name &operator=(class_name &&other) = delete; \
|
||||
/* Support for shallow copy. */ \
|
||||
/* NOTE: Calling the default constructor works-around deprecated warning generated by GCC. */ \
|
||||
class_name(const dna::internal::ShallowDataConstRef<class_name> ref) : class_name() \
|
||||
{ \
|
||||
_DNA_internal_memcpy(this, ref.get_pointer(), sizeof(class_name)); \
|
||||
} \
|
||||
class_name &operator=(const dna::internal::ShallowDataConstRef<class_name> ref) \
|
||||
{ \
|
||||
if (this != ref.get_pointer()) { \
|
||||
_DNA_internal_memcpy(this, ref.get_pointer(), sizeof(class_name)); \
|
||||
} \
|
||||
return *this; \
|
||||
} \
|
||||
/* Create object which memory is filled with zeros. */ \
|
||||
class_name(const dna::internal::ShallowZeroInitializeTag /*tag*/) : class_name() \
|
||||
{ \
|
||||
_DNA_internal_memzero(this, sizeof(class_name)); \
|
||||
} \
|
||||
class_name &operator=(const dna::internal::ShallowZeroInitializeTag /*tag*/) \
|
||||
{ \
|
||||
_DNA_internal_memzero(this, sizeof(class_name)); \
|
||||
return *this; \
|
||||
}
|
||||
|
||||
namespace dna {
|
||||
|
||||
/* Creates shallow copy of the given object.
|
||||
* The entire object is copied as-is using memory copy.
|
||||
*
|
||||
* Typical usage:
|
||||
* Object temp_object = dna::shallow_copy(*input_object);
|
||||
*
|
||||
* From the implementation detail go via copy constructor/assign operator defined in the structure.
|
||||
*/
|
||||
template<typename T>
|
||||
[[nodiscard]] inline internal::ShallowDataConstRef<T> shallow_copy(const T &other)
|
||||
{
|
||||
return internal::ShallowDataConstRef(other);
|
||||
}
|
||||
|
||||
template<typename T> inline void shallow_copy_array(T *dst, const T *src, const int64_t size)
|
||||
{
|
||||
_DNA_internal_memcpy(dst, src, sizeof(T) * size_t(size));
|
||||
}
|
||||
|
||||
/* DNA object initializer which leads to an object which underlying memory is filled with zeroes.
|
||||
*/
|
||||
[[nodiscard]] inline internal::ShallowZeroInitializeTag shallow_zero_initialize()
|
||||
{
|
||||
return internal::ShallowZeroInitializeTag();
|
||||
}
|
||||
|
||||
template<typename T> inline void shallow_swap(T &a, T &b)
|
||||
{
|
||||
_DNA_internal_swap(&a, &b, sizeof(T));
|
||||
}
|
||||
|
||||
} // namespace dna
|
||||
} // namespace blender
|
||||
67
blender-5.2.0/source/blender/makesdna/DNA_documentation.h
Normal file
67
blender-5.2.0/source/blender/makesdna/DNA_documentation.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* \page makesdna Make Struct DNA (`makesdna`)
|
||||
*
|
||||
* \section aboutdna About the DNA module
|
||||
*
|
||||
* The DNA module holds all type definitions that are serialized in a
|
||||
* blender file. There is an executable that scans all files, looking
|
||||
* for struct-s to serialize (hence sdna: Struct \ref DNA). From this
|
||||
* information, it builds a file with numbers that encode the format,
|
||||
* the names of variables, and the place to look for them.
|
||||
*
|
||||
* \section dnaissues Known issues with DNA
|
||||
*
|
||||
* - Function pointers:
|
||||
*
|
||||
* Because of historical reasons, some function pointers were
|
||||
* untyped. The parser/DNA generator has been modified to explicitly
|
||||
* handle these special cases. Most pointers have been given proper
|
||||
* proto's by now. DNA_space_types.h::Spacefile::returnfunc may still
|
||||
* be badly defined. The reason for this is that it is called with
|
||||
* different types of arguments. It takes a char* at this moment...
|
||||
*
|
||||
* - Ignoring structs:
|
||||
*
|
||||
* Sometimes we need to define structs in DNA which aren't written
|
||||
* to disk, and can be excluded from blend file DNA string.
|
||||
* in this case, add two '#' chars directly before the struct. eg.
|
||||
*
|
||||
* \code{.c}
|
||||
* #
|
||||
* #
|
||||
* struct MyStruct {
|
||||
* int value;
|
||||
* };
|
||||
* \endcode
|
||||
*
|
||||
* Ignored structs can only be referred to from non-ignored structs
|
||||
* when referred to as a pointer (where they're usually allocated
|
||||
* and cleared in `readfile.cc`).
|
||||
*
|
||||
* - %Path to the header files
|
||||
*
|
||||
* Also because of historical reasons, there is a path prefix to the
|
||||
* headers that need to be scanned. This is the BASE_HEADER
|
||||
* define. If you change the file-layout for DNA, you will probably
|
||||
* have to change this (Not very flexible, but it is hardly ever
|
||||
* changed. Sorry.).
|
||||
*
|
||||
* \section dnadependencies Dependencies
|
||||
*
|
||||
* DNA has no external dependencies (except for a few system
|
||||
* includes).
|
||||
*
|
||||
* \section dnanote NOTE
|
||||
*
|
||||
* PLEASE READ INSTRUCTIONS ABOUT ADDING VARIABLES IN 'DNA' STRUCTS IN
|
||||
*
|
||||
* intern/dna_genfile.cc
|
||||
* (ton)
|
||||
*/
|
||||
|
||||
/* This file has intentionally no definitions or implementation. */
|
||||
258
blender-5.2.0/source/blender/makesdna/DNA_dynamicpaint_types.h
Normal file
258
blender-5.2.0/source/blender/makesdna/DNA_dynamicpaint_types.h
Normal file
@@ -0,0 +1,258 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* surface type */
|
||||
enum eDynamicPaint_SurfaceType : short {
|
||||
MOD_DPAINT_SURFACE_T_PAINT = 0,
|
||||
MOD_DPAINT_SURFACE_T_DISPLACE = 1,
|
||||
MOD_DPAINT_SURFACE_T_WEIGHT = 2,
|
||||
MOD_DPAINT_SURFACE_T_WAVE = 3,
|
||||
};
|
||||
|
||||
/* surface flags */
|
||||
enum eDynamicPaint_SurfaceFlags : int {
|
||||
MOD_DPAINT_ACTIVE = 1 << 0, /* Is surface enabled */
|
||||
|
||||
MOD_DPAINT_ANTIALIAS = 1 << 1, /* do anti-aliasing. */
|
||||
MOD_DPAINT_DISSOLVE = 1 << 2, /* do dissolve */
|
||||
MOD_DPAINT_MULALPHA = 1 << 3, /* Multiply color by alpha when saving image */
|
||||
MOD_DPAINT_DISSOLVE_LOG = 1 << 4, /* Use 1/x for surface dissolve */
|
||||
MOD_DPAINT_DRY_LOG = 1 << 5, /* Use 1/x for drying paint */
|
||||
|
||||
MOD_DPAINT_WAVE_OPEN_BORDERS = 1 << 7, /* passes waves through mesh edges */
|
||||
MOD_DPAINT_DISP_INCREMENTAL = 1 << 8, /* builds displace on top of earlier values */
|
||||
MOD_DPAINT_USE_DRYING = 1 << 9, /* use drying */
|
||||
|
||||
MOD_DPAINT_OUT1 = 1 << 10, /* output primary surface */
|
||||
MOD_DPAINT_OUT2 = 1 << 11, /* output secondary surface */
|
||||
};
|
||||
ENUM_OPERATORS(eDynamicPaint_SurfaceFlags)
|
||||
|
||||
/* image_fileformat */
|
||||
enum eDynamicPaint_ImageFormat : short {
|
||||
MOD_DPAINT_IMGFORMAT_PNG = 0,
|
||||
MOD_DPAINT_IMGFORMAT_OPENEXR = 1,
|
||||
};
|
||||
|
||||
/* disp_type */
|
||||
enum eDynamicPaint_DispType : short {
|
||||
MOD_DPAINT_DISP_DISPLACE = 0, /* displacement output displace map */
|
||||
MOD_DPAINT_DISP_DEPTH = 1, /* displacement output depth data */
|
||||
};
|
||||
|
||||
/* effect */
|
||||
enum eDynamicPaint_EffectFlags : int {
|
||||
MOD_DPAINT_EFFECT_DO_SPREAD = 1 << 0, /* do spread effect */
|
||||
MOD_DPAINT_EFFECT_DO_DRIP = 1 << 1, /* do drip effect */
|
||||
MOD_DPAINT_EFFECT_DO_SHRINK = 1 << 2, /* do shrink effect */
|
||||
};
|
||||
ENUM_OPERATORS(eDynamicPaint_EffectFlags)
|
||||
|
||||
/* init_color_type */
|
||||
enum eDynamicPaint_InitColorType : short {
|
||||
MOD_DPAINT_INITIAL_NONE = 0,
|
||||
MOD_DPAINT_INITIAL_COLOR = 1,
|
||||
MOD_DPAINT_INITIAL_TEXTURE = 2,
|
||||
MOD_DPAINT_INITIAL_VERTEXCOLOR = 3,
|
||||
};
|
||||
|
||||
/* canvas flags */
|
||||
enum eDynamicPaint_CanvasFlags : short {
|
||||
/** surface is already baking, so it won't get updated (loop) */
|
||||
MOD_DPAINT_BAKING = 1 << 1,
|
||||
};
|
||||
ENUM_OPERATORS(eDynamicPaint_CanvasFlags)
|
||||
|
||||
/* flags */
|
||||
enum eDynamicPaint_BrushFlags : int {
|
||||
/** use particle radius */
|
||||
MOD_DPAINT_PART_RAD = 1 << 0,
|
||||
// MOD_DPAINT_USE_MATERIAL = 1 << 1, /* DNA_DEPRECATED */
|
||||
/** don't increase alpha unless paint alpha is higher than existing */
|
||||
MOD_DPAINT_ABS_ALPHA = 1 << 2,
|
||||
/** removes paint */
|
||||
MOD_DPAINT_ERASE = 1 << 3,
|
||||
|
||||
/** only read falloff ramp alpha */
|
||||
MOD_DPAINT_RAMP_ALPHA = 1 << 4,
|
||||
/** do proximity check only in defined dir */
|
||||
MOD_DPAINT_PROX_PROJECT = 1 << 5,
|
||||
/** inverse proximity painting */
|
||||
MOD_DPAINT_INVERSE_PROX = 1 << 6,
|
||||
/** negates volume influence on "volume + prox" mode */
|
||||
MOD_DPAINT_NEGATE_VOLUME = 1 << 7,
|
||||
|
||||
/** brush smudges existing paint */
|
||||
MOD_DPAINT_DO_SMUDGE = 1 << 8,
|
||||
/** multiply brush influence by velocity */
|
||||
MOD_DPAINT_VELOCITY_ALPHA = 1 << 9,
|
||||
/** replace brush color by velocity color ramp */
|
||||
MOD_DPAINT_VELOCITY_COLOR = 1 << 10,
|
||||
/** multiply brush intersection depth by velocity */
|
||||
MOD_DPAINT_VELOCITY_DEPTH = 1 << 11,
|
||||
|
||||
MOD_DPAINT_USES_VELOCITY = (MOD_DPAINT_DO_SMUDGE | MOD_DPAINT_VELOCITY_ALPHA |
|
||||
MOD_DPAINT_VELOCITY_COLOR | MOD_DPAINT_VELOCITY_DEPTH),
|
||||
};
|
||||
ENUM_OPERATORS(eDynamicPaint_BrushFlags)
|
||||
|
||||
/* collision type */
|
||||
enum eDynamicPaint_CollisionType : int {
|
||||
MOD_DPAINT_COL_VOLUME = 0, /* paint with mesh volume */
|
||||
MOD_DPAINT_COL_DIST = 1, /* paint using distance to mesh surface */
|
||||
MOD_DPAINT_COL_VOLDIST = 2, /* use both volume and distance */
|
||||
MOD_DPAINT_COL_PSYS = 3, /* use particle system */
|
||||
MOD_DPAINT_COL_POINT = 4, /* use distance to object center point */
|
||||
};
|
||||
|
||||
/* proximity_falloff */
|
||||
enum eDynamicPaint_ProximityFalloff : short {
|
||||
MOD_DPAINT_PRFALL_CONSTANT = 0, /* no-falloff */
|
||||
MOD_DPAINT_PRFALL_SMOOTH = 1, /* smooth, linear falloff */
|
||||
MOD_DPAINT_PRFALL_RAMP = 2, /* use color ramp */
|
||||
};
|
||||
|
||||
/* wave_brush_type */
|
||||
enum eDynamicPaint_WaveBrushType : short {
|
||||
MOD_DPAINT_WAVEB_DEPTH = 0, /* use intersection depth */
|
||||
MOD_DPAINT_WAVEB_FORCE = 1, /* act as a force on intersection area */
|
||||
MOD_DPAINT_WAVEB_REFLECT = 2, /* obstacle that reflects waves */
|
||||
MOD_DPAINT_WAVEB_CHANGE = 3, /* use change of intersection depth from previous frame */
|
||||
};
|
||||
|
||||
/* brush ray_dir */
|
||||
enum eDynamicPaint_RayDir : short {
|
||||
MOD_DPAINT_RAY_CANVAS = 0,
|
||||
MOD_DPAINT_RAY_BRUSH_AVG = 1,
|
||||
MOD_DPAINT_RAY_ZPLUS = 2,
|
||||
};
|
||||
|
||||
struct PaintSurfaceData;
|
||||
|
||||
/* surface format */
|
||||
enum eDynamicPaint_SurfaceFormat : short {
|
||||
MOD_DPAINT_SURFACE_F_PTEX = 0,
|
||||
MOD_DPAINT_SURFACE_F_VERTEX = 1,
|
||||
MOD_DPAINT_SURFACE_F_IMAGESEQ = 2,
|
||||
};
|
||||
|
||||
struct DynamicPaintSurface {
|
||||
|
||||
struct DynamicPaintSurface *next = nullptr, *prev = nullptr;
|
||||
/** For fast RNA access. */
|
||||
struct DynamicPaintCanvasSettings *canvas = nullptr;
|
||||
struct PaintSurfaceData *data = nullptr;
|
||||
|
||||
struct Collection *brush_group = nullptr;
|
||||
struct EffectorWeights *effector_weights = nullptr;
|
||||
|
||||
/* cache */
|
||||
struct PointCache *pointcache = nullptr;
|
||||
ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
|
||||
int current_frame = 0;
|
||||
|
||||
/* surface */
|
||||
char name[64] = "";
|
||||
eDynamicPaint_SurfaceFormat format = MOD_DPAINT_SURFACE_F_PTEX;
|
||||
eDynamicPaint_SurfaceType type = MOD_DPAINT_SURFACE_T_PAINT;
|
||||
eDynamicPaint_DispType disp_type = MOD_DPAINT_DISP_DISPLACE;
|
||||
eDynamicPaint_ImageFormat image_fileformat = MOD_DPAINT_IMGFORMAT_PNG;
|
||||
/** Ui selection box. */
|
||||
short effect_ui = 0;
|
||||
eDynamicPaint_InitColorType init_color_type = MOD_DPAINT_INITIAL_NONE;
|
||||
eDynamicPaint_SurfaceFlags flags = {};
|
||||
eDynamicPaint_EffectFlags effect = {};
|
||||
|
||||
int image_resolution = 0, substeps = 0;
|
||||
int start_frame = 0, end_frame = 0;
|
||||
|
||||
/* initial color */
|
||||
float init_color[4] = {};
|
||||
struct Tex *init_texture = nullptr;
|
||||
char init_layername[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
|
||||
int dry_speed = 0, diss_speed = 0;
|
||||
float color_dry_threshold = 0;
|
||||
float depth_clamp = 0, disp_factor = 0;
|
||||
|
||||
float spread_speed = 0, color_spread_speed = 0, shrink_speed = 0;
|
||||
float drip_vel = 0, drip_acc = 0;
|
||||
|
||||
/* per surface brush settings */
|
||||
float influence_scale = 0, radius_scale = 0;
|
||||
|
||||
/* wave settings */
|
||||
float wave_damping = 0, wave_speed = 0, wave_timescale = 0, wave_spring = 0, wave_smoothness = 0;
|
||||
char _pad2[4] = {};
|
||||
|
||||
char uvlayer_name[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
char image_output_path[/*FILE_MAX*/ 1024] = "";
|
||||
char output_name[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
char output_name2[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
};
|
||||
|
||||
/* Canvas settings */
|
||||
struct DynamicPaintCanvasSettings {
|
||||
/** For fast RNA access. */
|
||||
struct DynamicPaintModifierData *pmd = nullptr;
|
||||
|
||||
ListBaseT<DynamicPaintSurface> surfaces = {nullptr, nullptr};
|
||||
short active_sur = 0;
|
||||
eDynamicPaint_CanvasFlags flags = {};
|
||||
char _pad[4] = {};
|
||||
|
||||
/** Bake error description. */
|
||||
char error[64] = "";
|
||||
};
|
||||
|
||||
/* Brush settings */
|
||||
struct DynamicPaintBrushSettings {
|
||||
/** For fast RNA access. */
|
||||
struct DynamicPaintModifierData *pmd = nullptr;
|
||||
|
||||
/**
|
||||
* \note Storing the particle system pointer here is very weak, as it prevents modifiers' data
|
||||
* copying to be self-sufficient (extra external code needs to ensure the pointer remains valid
|
||||
* when the modifier data is copied from one object to another). See e.g.
|
||||
* `BKE_object_copy_particlesystems` or `BKE_object_copy_modifier`.
|
||||
*/
|
||||
struct ParticleSystem *psys = nullptr;
|
||||
|
||||
eDynamicPaint_BrushFlags flags = {};
|
||||
eDynamicPaint_CollisionType collision = MOD_DPAINT_COL_VOLUME;
|
||||
|
||||
float r = 0, g = 0, b = 0, alpha = 0;
|
||||
float wetness = 0;
|
||||
|
||||
float particle_radius = 0, particle_smooth = 0;
|
||||
float paint_distance = 0;
|
||||
|
||||
/* color ramps */
|
||||
/** Proximity paint falloff. */
|
||||
struct ColorBand *paint_ramp = nullptr;
|
||||
/** Velocity paint ramp. */
|
||||
struct ColorBand *vel_ramp = nullptr;
|
||||
|
||||
eDynamicPaint_ProximityFalloff proximity_falloff = MOD_DPAINT_PRFALL_CONSTANT;
|
||||
eDynamicPaint_WaveBrushType wave_type = MOD_DPAINT_WAVEB_DEPTH;
|
||||
eDynamicPaint_RayDir ray_dir = MOD_DPAINT_RAY_CANVAS;
|
||||
char _pad[2] = {};
|
||||
|
||||
float wave_factor = 0, wave_clamp = 0;
|
||||
float max_velocity = 0, smudge_strength = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
157
blender-5.2.0/source/blender/makesdna/DNA_effect_types.h
Normal file
157
blender-5.2.0/source/blender/makesdna/DNA_effect_types.h
Normal file
@@ -0,0 +1,157 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Types defined in this file are deprecated, converted into modifiers on load.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* Don't forget, new effects also in `writefile.cc` for DNA! */
|
||||
|
||||
/** #PartEff::flag. */
|
||||
enum ePartEff_Flag : short {
|
||||
// PAF_UNUSED_0 = 1 << 0, /* DEPRECATED, dirty. */
|
||||
PAF_BSPLINE = 1 << 1,
|
||||
PAF_STATIC = 1 << 2,
|
||||
PAF_FACE = 1 << 3,
|
||||
PAF_ANIMATED = 1 << 4,
|
||||
/** Show particles before they're emitted. */
|
||||
PAF_UNBORN = 1 << 5,
|
||||
/** Emit only from faces. */
|
||||
PAF_OFACE = 1 << 6,
|
||||
/** show emitter (don't hide actual mesh). */
|
||||
PAF_SHOWE = 1 << 7,
|
||||
/** True random emit from faces (not just ordered jitter). */
|
||||
PAF_TRAND = 1 << 8,
|
||||
/** even distribution in face emission based on face areas. */
|
||||
PAF_EDISTR = 1 << 9,
|
||||
/** Show particles after they've died. */
|
||||
PAF_DIED = 1 << 11,
|
||||
};
|
||||
ENUM_OPERATORS(ePartEff_Flag)
|
||||
|
||||
/** #PartEff::flag2, for pos/neg #PartEff::flag2neg. */
|
||||
enum ePartEff_Flag2 : short {
|
||||
PAF_TEXTIME = 1, /* Texture timing. */
|
||||
};
|
||||
ENUM_OPERATORS(ePartEff_Flag2)
|
||||
|
||||
/** #PartEff::type. */
|
||||
enum eEffect_Type : short {
|
||||
EFF_BUILD = 0,
|
||||
EFF_PARTICLE = 1,
|
||||
EFF_WAVE = 2,
|
||||
};
|
||||
|
||||
/** #PartEff::flag. */
|
||||
enum eEffect_Flag : short {
|
||||
EFF_SELECT = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eEffect_Flag)
|
||||
|
||||
/** #PartEff::stype. */
|
||||
enum ePartEff_SType : short {
|
||||
PAF_NORMAL = 0,
|
||||
PAF_VECT = 1,
|
||||
};
|
||||
|
||||
/** #PartEff::texmap. */
|
||||
enum ePartEff_TexMap : short {
|
||||
PAF_TEXINT = 0,
|
||||
PAF_TEXRGB = 1,
|
||||
PAF_TEXGRAD = 2,
|
||||
};
|
||||
|
||||
struct Effect {
|
||||
struct Effect *next = nullptr, *prev = nullptr;
|
||||
eEffect_Type type = EFF_BUILD;
|
||||
eEffect_Flag flag = {};
|
||||
short buttype = 0;
|
||||
char _pad0[2] = {};
|
||||
};
|
||||
|
||||
struct BuildEff {
|
||||
/* NOTE: match #Effect. */
|
||||
struct BuildEff *next = nullptr, *prev = nullptr;
|
||||
eEffect_Type type = EFF_BUILD;
|
||||
eEffect_Flag flag = {};
|
||||
short buttype = 0;
|
||||
/* End header. */
|
||||
|
||||
char _pad0[2] = {};
|
||||
|
||||
float len = 0, sfra = 0;
|
||||
};
|
||||
|
||||
#
|
||||
#
|
||||
struct Particle {
|
||||
float co[3] = {}, no[3] = {};
|
||||
float time = 0, lifetime = 0;
|
||||
short mat_nr = 0;
|
||||
char _pad0[2] = {};
|
||||
};
|
||||
|
||||
struct Collection;
|
||||
|
||||
struct PartEff {
|
||||
/* NOTE: match #Effect. */
|
||||
struct PartEff *next = nullptr, *prev = nullptr;
|
||||
eEffect_Type type = EFF_BUILD;
|
||||
ePartEff_Flag flag = {};
|
||||
short buttype = 0;
|
||||
/* End header. */
|
||||
|
||||
ePartEff_SType stype = PAF_NORMAL;
|
||||
short vertgroup = 0, userjit = 0;
|
||||
|
||||
float sta = 0, end = 0, lifetime = 0;
|
||||
int totpart = 0, totkey = 0, seed = 0;
|
||||
|
||||
float normfac = 0, obfac = 0, randfac = 0, texfac = 0, randlife = 0;
|
||||
float force[3] = {};
|
||||
float damp = 0;
|
||||
|
||||
float nabla = 0, vectsize = 0, maxlen = 0, defvec[3] = {};
|
||||
char _pad[4] = {};
|
||||
|
||||
float mult[4] = {}, life[4] = {};
|
||||
short child[4] = {}, mat[4] = {};
|
||||
ePartEff_TexMap texmap = PAF_TEXINT;
|
||||
short curmult = 0;
|
||||
short staticstep = 0, omat = 0, timetex = 0, speedtex = 0;
|
||||
ePartEff_Flag2 flag2 = {}, flag2neg = {};
|
||||
short disp = 0, vertgroup_v = 0;
|
||||
|
||||
char vgroupname[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
char vgroupname_v[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
/** Inverse matrix of parent Object. */
|
||||
float imat[4][4] = {};
|
||||
|
||||
Particle *keys = nullptr;
|
||||
struct Collection *group = nullptr;
|
||||
};
|
||||
|
||||
struct WaveEff {
|
||||
/* NOTE: match #Effect. */
|
||||
struct WaveEff *next = nullptr, *prev = nullptr;
|
||||
eEffect_Type type = EFF_BUILD;
|
||||
eEffect_Flag flag = {};
|
||||
short buttype = 0, stype = 0;
|
||||
/* End header. */
|
||||
|
||||
float startx = 0, starty = 0, height = 0, width = 0;
|
||||
float narrow = 0, speed = 0, minfac = 0, damp = 0;
|
||||
|
||||
float timeoffs = 0, lifetime = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
52
blender-5.2.0/source/blender/makesdna/DNA_fileglobal_types.h
Normal file
52
blender-5.2.0/source/blender/makesdna/DNA_fileglobal_types.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* FileGlobal stores a part of the current user-interface settings at
|
||||
* the moment of saving, and the file-specific settings.
|
||||
*/
|
||||
struct FileGlobal {
|
||||
/** Needs to be here, for human file-format recognition (keep first!). */
|
||||
char subvstr[4] = "";
|
||||
|
||||
short subversion = 0;
|
||||
short minversion = 0, minsubversion = 0;
|
||||
char _pad[6] = {};
|
||||
struct bScreen *curscreen = nullptr;
|
||||
struct Scene *curscene = nullptr;
|
||||
struct ViewLayer *cur_view_layer = nullptr;
|
||||
void *_pad1 = nullptr;
|
||||
|
||||
int fileflags = 0;
|
||||
int globalf = 0;
|
||||
/** Commit timestamp from `buildinfo`. */
|
||||
uint64_t build_commit_timestamp = 0;
|
||||
/** Hash from `buildinfo`. */
|
||||
char build_hash[16] = "";
|
||||
/** File path where this was saved, for recover. */
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
/* Working colorspace, for automatic conversion. Note the matrix is
|
||||
* the source of truth, the name is only for user interface and diagnosis. */
|
||||
char colorspace_scene_linear_name[/*MAX_COLORSPACE_NAME*/ 64] = "";
|
||||
float colorspace_scene_linear_to_xyz[3][3] = {};
|
||||
int _pad2[3] = {};
|
||||
};
|
||||
|
||||
/* minversion: in file, the oldest past blender version you can use compliant */
|
||||
/* example: if in 2.43 the meshes lose mesh data, minversion is 2.43 then too */
|
||||
/* or: in 2.42, subversion 1, same as above, minversion then is 2.42, min subversion 1 */
|
||||
/* (defines for version are in the BKE_blender_version.h file, for historic reasons) */
|
||||
|
||||
} // namespace blender
|
||||
875
blender-5.2.0/source/blender/makesdna/DNA_fluid_types.h
Normal file
875
blender-5.2.0/source/blender/makesdna/DNA_fluid_types.h
Normal file
@@ -0,0 +1,875 @@
|
||||
/* SPDX-FileCopyrightText: 2006 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_vec_defaults.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace gpu {
|
||||
class Texture;
|
||||
} // namespace gpu
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.flags
|
||||
* Domain flags.
|
||||
*/
|
||||
enum eFluidDomain_Flags : int {
|
||||
FLUID_DOMAIN_USE_NOISE = (1 << 1), /* Use noise. */
|
||||
FLUID_DOMAIN_USE_DISSOLVE = (1 << 2), /* Let smoke dissolve. */
|
||||
FLUID_DOMAIN_USE_DISSOLVE_LOG = (1 << 3), /* Using 1/x for dissolve. */
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
FLUID_DOMAIN_USE_HIGH_SMOOTH = (1 << 5), /* -- Deprecated -- */
|
||||
#endif
|
||||
FLUID_DOMAIN_FILE_LOAD = (1 << 6), /* Flag for file load. */
|
||||
FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN = (1 << 7),
|
||||
FLUID_DOMAIN_USE_ADAPTIVE_TIME = (1 << 8), /* Adaptive time stepping in domain. */
|
||||
FLUID_DOMAIN_USE_MESH = (1 << 9), /* Use mesh. */
|
||||
FLUID_DOMAIN_USE_GUIDE = (1 << 10), /* Use guiding. */
|
||||
FLUID_DOMAIN_USE_SPEED_VECTORS = (1 << 11), /* Generate mesh speed vectors. */
|
||||
FLUID_DOMAIN_EXPORT_MANTA_SCRIPT = (1 << 12), /* Export mantaflow script during bake. */
|
||||
FLUID_DOMAIN_USE_FRACTIONS = (1 << 13), /* Use second order obstacles. */
|
||||
FLUID_DOMAIN_DELETE_IN_OBSTACLE = (1 << 14), /* Delete fluid inside obstacles. */
|
||||
FLUID_DOMAIN_USE_DIFFUSION = (1 << 15), /* Use diffusion (e.g. viscosity, surface tension). */
|
||||
FLUID_DOMAIN_USE_RESUMABLE_CACHE = (1 << 16), /* Determine if cache should be resumable. */
|
||||
FLUID_DOMAIN_USE_VISCOSITY = (1 << 17), /* Use viscosity. */
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_Flags)
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.border_collisions
|
||||
* Border collisions.
|
||||
*/
|
||||
enum eFluidDomain_BorderFlags : int {
|
||||
FLUID_DOMAIN_BORDER_FRONT = (1 << 1),
|
||||
FLUID_DOMAIN_BORDER_BACK = (1 << 2),
|
||||
FLUID_DOMAIN_BORDER_RIGHT = (1 << 3),
|
||||
FLUID_DOMAIN_BORDER_LEFT = (1 << 4),
|
||||
FLUID_DOMAIN_BORDER_TOP = (1 << 5),
|
||||
FLUID_DOMAIN_BORDER_BOTTOM = (1 << 6),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_BorderFlags)
|
||||
|
||||
/* Cache file formats. */
|
||||
enum eFluidDomain_FileFormat : char {
|
||||
FLUID_DOMAIN_FILE_UNI = (1 << 0),
|
||||
FLUID_DOMAIN_FILE_OPENVDB = (1 << 1),
|
||||
FLUID_DOMAIN_FILE_RAW = (1 << 2),
|
||||
FLUID_DOMAIN_FILE_OBJECT = (1 << 3),
|
||||
FLUID_DOMAIN_FILE_BIN_OBJECT = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_FileFormat)
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.axis_slice_method
|
||||
* Axis aligned method.
|
||||
*/
|
||||
enum eFluidDomain_AxisSliceMethod : char {
|
||||
AXIS_SLICE_FULL = 0,
|
||||
AXIS_SLICE_SINGLE = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.slice_axis
|
||||
* Single slice direction.
|
||||
*/
|
||||
enum eFluidDomain_SliceAxis : char {
|
||||
SLICE_AXIS_AUTO = 0,
|
||||
SLICE_AXIS_X = 1,
|
||||
SLICE_AXIS_Y = 2,
|
||||
SLICE_AXIS_Z = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.interp_method
|
||||
* Display interpolation method.
|
||||
*/
|
||||
enum FLUID_DisplayInterpolationMethod : char {
|
||||
FLUID_DISPLAY_INTERP_LINEAR = 0,
|
||||
FLUID_DISPLAY_INTERP_CUBIC = 1,
|
||||
FLUID_DISPLAY_INTERP_CLOSEST = 2,
|
||||
};
|
||||
|
||||
/** #FluidDomainSettings.vector_draw_type */
|
||||
enum eFluidDomain_VectorDrawType : char {
|
||||
VECTOR_DRAW_NEEDLE = 0,
|
||||
VECTOR_DRAW_STREAMLINE = 1,
|
||||
VECTOR_DRAW_MAC = 2,
|
||||
};
|
||||
|
||||
/** #FluidDomainSettings.vector_draw_mac_components */
|
||||
enum eFluidDomain_VectorDrawMAC : char {
|
||||
VECTOR_DRAW_MAC_X = (1 << 0),
|
||||
VECTOR_DRAW_MAC_Y = (1 << 1),
|
||||
VECTOR_DRAW_MAC_Z = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_VectorDrawMAC)
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.vector_field
|
||||
* Fluid domain vector fields.
|
||||
*/
|
||||
enum FLUID_DisplayVectorField : char {
|
||||
FLUID_DOMAIN_VECTOR_FIELD_VELOCITY = 0,
|
||||
FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY = 1,
|
||||
FLUID_DOMAIN_VECTOR_FIELD_FORCE = 2,
|
||||
};
|
||||
|
||||
/** #FluidDomainSettings.sndparticle_boundary */
|
||||
enum eFluidDomain_SndParticleBoundary : char {
|
||||
SNDPARTICLE_BOUNDARY_DELETE = 0,
|
||||
SNDPARTICLE_BOUNDARY_PUSHOUT = 1,
|
||||
};
|
||||
|
||||
/** #FluidDomainSettings.sndparticle_combined_export */
|
||||
enum eFluidDomain_SndParticleCombinedExport : char {
|
||||
SNDPARTICLE_COMBINED_EXPORT_OFF = 0,
|
||||
SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM = 1,
|
||||
SNDPARTICLE_COMBINED_EXPORT_SPRAY_BUBBLE = 2,
|
||||
SNDPARTICLE_COMBINED_EXPORT_FOAM_BUBBLE = 3,
|
||||
SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM_BUBBLE = 4,
|
||||
};
|
||||
|
||||
/** #FluidDomainSettings.coba_field */
|
||||
enum eFluidDomain_CobaField : char {
|
||||
FLUID_DOMAIN_FIELD_DENSITY = 0,
|
||||
FLUID_DOMAIN_FIELD_HEAT = 1,
|
||||
FLUID_DOMAIN_FIELD_FUEL = 2,
|
||||
FLUID_DOMAIN_FIELD_REACT = 3,
|
||||
FLUID_DOMAIN_FIELD_FLAME = 4,
|
||||
FLUID_DOMAIN_FIELD_VELOCITY_X = 5,
|
||||
FLUID_DOMAIN_FIELD_VELOCITY_Y = 6,
|
||||
FLUID_DOMAIN_FIELD_VELOCITY_Z = 7,
|
||||
FLUID_DOMAIN_FIELD_COLOR_R = 8,
|
||||
FLUID_DOMAIN_FIELD_COLOR_G = 9,
|
||||
FLUID_DOMAIN_FIELD_COLOR_B = 10,
|
||||
FLUID_DOMAIN_FIELD_FORCE_X = 11,
|
||||
FLUID_DOMAIN_FIELD_FORCE_Y = 12,
|
||||
FLUID_DOMAIN_FIELD_FORCE_Z = 13,
|
||||
FLUID_DOMAIN_FIELD_PHI = 14,
|
||||
FLUID_DOMAIN_FIELD_PHI_IN = 15,
|
||||
FLUID_DOMAIN_FIELD_PHI_OUT = 16,
|
||||
FLUID_DOMAIN_FIELD_PHI_OBSTACLE = 17,
|
||||
FLUID_DOMAIN_FIELD_FLAGS = 18,
|
||||
FLUID_DOMAIN_FIELD_PRESSURE = 19,
|
||||
};
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.gridlines_color_field
|
||||
* Fluid grid-line display color field types.
|
||||
*/
|
||||
enum eFluidDomain_GridlineColorField : char {
|
||||
FLUID_GRIDLINE_COLOR_TYPE_NONE = 0,
|
||||
FLUID_GRIDLINE_COLOR_TYPE_FLAGS = 1,
|
||||
FLUID_GRIDLINE_COLOR_TYPE_RANGE = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* #FluidDomainSettings.gridlines_cell_filter
|
||||
* Fluid cell types.
|
||||
*/
|
||||
enum eFluidDomain_GridlineCellFilter : char {
|
||||
FLUID_CELL_TYPE_NONE = 0,
|
||||
FLUID_CELL_TYPE_FLUID = (1 << 0),
|
||||
FLUID_CELL_TYPE_OBSTACLE = (1 << 1),
|
||||
FLUID_CELL_TYPE_EMPTY = (1 << 2),
|
||||
FLUID_CELL_TYPE_INFLOW = (1 << 3),
|
||||
FLUID_CELL_TYPE_OUTFLOW = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_GridlineCellFilter)
|
||||
|
||||
/* Fluid domain types. */
|
||||
enum eFluidDomain_Type : short {
|
||||
FLUID_DOMAIN_TYPE_GAS = 0,
|
||||
FLUID_DOMAIN_TYPE_LIQUID = 1,
|
||||
};
|
||||
|
||||
/* Mesh levelset generator types. */
|
||||
enum eFluidDomain_MeshGenerator : short {
|
||||
FLUID_DOMAIN_MESH_IMPROVED = 0,
|
||||
FLUID_DOMAIN_MESH_UNION = 1,
|
||||
};
|
||||
|
||||
/* Guiding velocity source. */
|
||||
enum eFluidDomain_GuideSource : short {
|
||||
FLUID_DOMAIN_GUIDE_SRC_DOMAIN = 0,
|
||||
FLUID_DOMAIN_GUIDE_SRC_EFFECTOR = 1,
|
||||
};
|
||||
|
||||
/* Fluid data fields (active_fields). */
|
||||
enum eFluidDomain_ActiveFields : int {
|
||||
FLUID_DOMAIN_ACTIVE_HEAT = (1 << 0),
|
||||
FLUID_DOMAIN_ACTIVE_FIRE = (1 << 1),
|
||||
FLUID_DOMAIN_ACTIVE_COLORS = (1 << 2),
|
||||
FLUID_DOMAIN_ACTIVE_COLOR_SET = (1 << 3),
|
||||
FLUID_DOMAIN_ACTIVE_OBSTACLE = (1 << 4),
|
||||
FLUID_DOMAIN_ACTIVE_GUIDE = (1 << 5),
|
||||
FLUID_DOMAIN_ACTIVE_INVEL = (1 << 6),
|
||||
FLUID_DOMAIN_ACTIVE_OUTFLOW = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_ActiveFields)
|
||||
|
||||
/* Particle types. */
|
||||
enum eFluidDomain_ParticleTypes : int {
|
||||
FLUID_DOMAIN_PARTICLE_FLIP = (1 << 0),
|
||||
FLUID_DOMAIN_PARTICLE_SPRAY = (1 << 1),
|
||||
FLUID_DOMAIN_PARTICLE_BUBBLE = (1 << 2),
|
||||
FLUID_DOMAIN_PARTICLE_FOAM = (1 << 3),
|
||||
FLUID_DOMAIN_PARTICLE_TRACER = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_ParticleTypes)
|
||||
|
||||
/* Liquid simulation methods. */
|
||||
enum eFluidDomain_SimMethod : short {
|
||||
FLUID_DOMAIN_METHOD_FLIP = (1 << 0),
|
||||
FLUID_DOMAIN_METHOD_APIC = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_SimMethod)
|
||||
|
||||
/* Cache options. */
|
||||
enum eFluidDomain_CacheFlag : int {
|
||||
FLUID_DOMAIN_BAKING_DATA = (1 << 0),
|
||||
FLUID_DOMAIN_BAKED_DATA = (1 << 1),
|
||||
FLUID_DOMAIN_BAKING_NOISE = (1 << 2),
|
||||
FLUID_DOMAIN_BAKED_NOISE = (1 << 3),
|
||||
FLUID_DOMAIN_BAKING_MESH = (1 << 4),
|
||||
FLUID_DOMAIN_BAKED_MESH = (1 << 5),
|
||||
FLUID_DOMAIN_BAKING_PARTICLES = (1 << 6),
|
||||
FLUID_DOMAIN_BAKED_PARTICLES = (1 << 7),
|
||||
FLUID_DOMAIN_BAKING_GUIDE = (1 << 8),
|
||||
FLUID_DOMAIN_BAKED_GUIDE = (1 << 9),
|
||||
FLUID_DOMAIN_OUTDATED_DATA = (1 << 10),
|
||||
FLUID_DOMAIN_OUTDATED_NOISE = (1 << 11),
|
||||
FLUID_DOMAIN_OUTDATED_MESH = (1 << 12),
|
||||
FLUID_DOMAIN_OUTDATED_PARTICLES = (1 << 13),
|
||||
FLUID_DOMAIN_OUTDATED_GUIDE = (1 << 14),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidDomain_CacheFlag)
|
||||
|
||||
#define FLUID_DOMAIN_BAKING_ALL \
|
||||
(FLUID_DOMAIN_BAKING_DATA | FLUID_DOMAIN_BAKING_NOISE | FLUID_DOMAIN_BAKING_MESH | \
|
||||
FLUID_DOMAIN_BAKING_PARTICLES | FLUID_DOMAIN_BAKING_GUIDE)
|
||||
|
||||
#define FLUID_DOMAIN_BAKED_ALL \
|
||||
(FLUID_DOMAIN_BAKED_DATA | FLUID_DOMAIN_BAKED_NOISE | FLUID_DOMAIN_BAKED_MESH | \
|
||||
FLUID_DOMAIN_BAKED_PARTICLES | FLUID_DOMAIN_BAKED_GUIDE)
|
||||
|
||||
#define FLUID_DOMAIN_DIR_DEFAULT "cache_fluid"
|
||||
#define FLUID_DOMAIN_DIR_CONFIG "config"
|
||||
#define FLUID_DOMAIN_DIR_DATA "data"
|
||||
#define FLUID_DOMAIN_DIR_NOISE "noise"
|
||||
#define FLUID_DOMAIN_DIR_MESH "mesh"
|
||||
#define FLUID_DOMAIN_DIR_PARTICLES "particles"
|
||||
#define FLUID_DOMAIN_DIR_GUIDE "guiding"
|
||||
#define FLUID_DOMAIN_DIR_SCRIPT "script"
|
||||
#define FLUID_DOMAIN_SMOKE_SCRIPT "smoke_script.py"
|
||||
#define FLUID_DOMAIN_LIQUID_SCRIPT "liquid_script.py"
|
||||
#define FLUID_CACHE_VERSION "C01"
|
||||
|
||||
/* Cache file names. */
|
||||
#define FLUID_NAME_CONFIG "config"
|
||||
#define FLUID_NAME_DATA "fluid_data"
|
||||
#define FLUID_NAME_NOISE "fluid_noise"
|
||||
#define FLUID_NAME_MESH "fluid_mesh"
|
||||
#define FLUID_NAME_PARTICLES "fluid_particles"
|
||||
#define FLUID_NAME_GUIDING "fluid_guiding"
|
||||
|
||||
/* Fluid object names. */
|
||||
#define FLUID_NAME_FLAGS "flags" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_VELOCITY "velocity" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_VEL "vel"
|
||||
#define FLUID_NAME_VELOCITYTMP "velocity_previous" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_VELOCITYX "x_vel"
|
||||
#define FLUID_NAME_VELOCITYY "y_vel"
|
||||
#define FLUID_NAME_VELOCITYZ "z_vel"
|
||||
#define FLUID_NAME_PRESSURE "pressure"
|
||||
#define FLUID_NAME_PHIOBS "phi_obstacle" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PHISIN "phiSIn"
|
||||
#define FLUID_NAME_PHIIN "phi_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PHIOUT "phi_out" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_FORCES "forces"
|
||||
#define FLUID_NAME_FORCE_X "x_force"
|
||||
#define FLUID_NAME_FORCE_Y "y_force"
|
||||
#define FLUID_NAME_FORCE_Z "z_force"
|
||||
#define FLUID_NAME_NUMOBS "numObs"
|
||||
#define FLUID_NAME_PHIOBSSIN "phiObsSIn"
|
||||
#define FLUID_NAME_PHIOBSIN "phi_obstacle_inflow"
|
||||
#define FLUID_NAME_OBVEL "obvel"
|
||||
#define FLUID_NAME_OBVELC "obvelC"
|
||||
#define FLUID_NAME_OBVEL_X "x_obvel"
|
||||
#define FLUID_NAME_OBVEL_Y "y_obvel"
|
||||
#define FLUID_NAME_OBVEL_Z "z_obvel"
|
||||
#define FLUID_NAME_FRACTIONS "fractions"
|
||||
#define FLUID_NAME_INVELC "invelC"
|
||||
#define FLUID_NAME_INVEL_X "x_invel"
|
||||
#define FLUID_NAME_INVEL_Y "y_invel"
|
||||
#define FLUID_NAME_INVEL_Z "z_invel"
|
||||
#define FLUID_NAME_PHIOUTSIN "phiOutSIn"
|
||||
#define FLUID_NAME_PHIOUTIN "phi_out_inflow"
|
||||
|
||||
/* Smoke object names. */
|
||||
#define FLUID_NAME_SHADOW "shadow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_EMISSION "emission" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_EMISSIONIN "emissionIn"
|
||||
#define FLUID_NAME_DENSITY "density" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_DENSITYIN "density_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_HEAT "heat"
|
||||
#define FLUID_NAME_HEATIN "heatIn"
|
||||
#define FLUID_NAME_TEMPERATURE "temperature" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_TEMPERATUREIN "temperature_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORR "color_r" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORG "color_g" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORB "color_b" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORRIN "color_r_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORGIN "color_g_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORBIN "color_b_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_FLAME "flame" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_FUEL "fuel" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_REACT "react" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_FUELIN "fuel_inflow" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_REACTIN "react_inflow" /* == OpenVDB grid attribute name. */
|
||||
|
||||
/* Liquid object names. */
|
||||
#define FLUID_NAME_PHIPARTS "phi_particles" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PHI "phi" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PHITMP "phi_previous" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_VELOCITYOLD "velOld"
|
||||
#define FLUID_NAME_VELOCITYPARTS "velParts"
|
||||
#define FLUID_NAME_MAPWEIGHTS "mapWeights"
|
||||
#define FLUID_NAME_PP "pp"
|
||||
#define FLUID_NAME_PVEL "pVel"
|
||||
#define FLUID_NAME_PARTS "particles" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PARTSVELOCITY "particles_velocity" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PINDEX "pindex"
|
||||
#define FLUID_NAME_GPI "gpi"
|
||||
#define FLUID_NAME_CURVATURE "gpi"
|
||||
|
||||
/* Noise object names. */
|
||||
#define FLUID_NAME_VELOCITY_NOISE "velocity_noise"
|
||||
#define FLUID_NAME_DENSITY_NOISE "density_noise" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PHIIN_NOISE "phiIn_noise"
|
||||
#define FLUID_NAME_PHIOUT_NOISE "phiOut_noise"
|
||||
#define FLUID_NAME_PHIOBS_NOISE "phiObs_noise"
|
||||
#define FLUID_NAME_FLAGS_NOISE "flags_noise"
|
||||
#define FLUID_NAME_TMPIN_NOISE "tmpIn_noise"
|
||||
#define FLUID_NAME_EMISSIONIN_NOISE "emissionIn_noise"
|
||||
#define FLUID_NAME_ENERGY "energy"
|
||||
#define FLUID_NAME_TMPFLAGS "tmpFlags"
|
||||
#define FLUID_NAME_TEXTURE_U "textureU"
|
||||
#define FLUID_NAME_TEXTURE_V "textureV"
|
||||
#define FLUID_NAME_TEXTURE_W "textureW"
|
||||
#define FLUID_NAME_TEXTURE_U2 "textureU2"
|
||||
#define FLUID_NAME_TEXTURE_V2 "textureV2"
|
||||
#define FLUID_NAME_TEXTURE_W2 "textureW2"
|
||||
#define FLUID_NAME_UV0 "uv_grid_0" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_UV1 "uv_grid_1" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORR_NOISE "color_r_noise" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORG_NOISE "color_g_noise" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_COLORB_NOISE "color_b_noise" /* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_FLAME_NOISE "flame_noise"
|
||||
#define FLUID_NAME_FUEL_NOISE "fuel_noise"
|
||||
#define FLUID_NAME_REACT_NOISE "react_noise"
|
||||
|
||||
/* Mesh object names. */
|
||||
#define FLUID_NAME_PHIPARTS_MESH "phiParts_mesh"
|
||||
#define FLUID_NAME_PHI_MESH "phi_mesh"
|
||||
#define FLUID_NAME_PP_MESH "pp_mesh"
|
||||
#define FLUID_NAME_FLAGS_MESH "flags_mesh"
|
||||
#define FLUID_NAME_LMESH "lMesh"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_VELOCITYVEC_MESH "vertex_velocities_mesh"
|
||||
#define FLUID_NAME_VELOCITY_MESH "velocity_mesh"
|
||||
#define FLUID_NAME_PINDEX_MESH "pindex_mesh"
|
||||
#define FLUID_NAME_GPI_MESH "gpi_mesh"
|
||||
|
||||
/* Particles object names. */
|
||||
#define FLUID_NAME_PP_PARTICLES "ppSnd"
|
||||
#define FLUID_NAME_PVEL_PARTICLES "pVelSnd"
|
||||
#define FLUID_NAME_PLIFE_PARTICLES "pLifeSnd"
|
||||
#define FLUID_NAME_PFORCE_PARTICLES "pForceSnd"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PARTS_PARTICLES "particles_secondary"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PARTSVEL_PARTICLES "particles_velocity_secondary"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_PARTSLIFE_PARTICLES "particles_life_secondary"
|
||||
#define FLUID_NAME_PARTSFORCE_PARTICLES "particles_force_secondary"
|
||||
#define FLUID_NAME_VELOCITY_PARTICLES "velocity_secondary"
|
||||
#define FLUID_NAME_FLAGS_PARTICLES "flags_secondary"
|
||||
#define FLUID_NAME_PHI_PARTICLES "phi_secondary"
|
||||
#define FLUID_NAME_PHIOBS_PARTICLES "phiObs_secondary"
|
||||
#define FLUID_NAME_PHIOUT_PARTICLES "phiOut_secondary"
|
||||
#define FLUID_NAME_NORMAL_PARTICLES "normal_secondary"
|
||||
#define FLUID_NAME_NEIGHBORRATIO_PARTICLES "neighbor_ratio_secondary"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_TRAPPEDAIR_PARTICLES "trapped_air_secondary"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_WAVECREST_PARTICLES "wave_crest_secondary"
|
||||
/* == OpenVDB grid attribute name. */
|
||||
#define FLUID_NAME_KINETICENERGY_PARTICLES "kinetic_energy_secondary"
|
||||
|
||||
/* Guiding object names. */
|
||||
#define FLUID_NAME_VELT "velT"
|
||||
#define FLUID_NAME_WEIGHTGUIDE "weightGuide"
|
||||
#define FLUID_NAME_NUMGUIDES "numGuides"
|
||||
#define FLUID_NAME_PHIGUIDEIN "phiGuideIn"
|
||||
#define FLUID_NAME_GUIDEVELC "guidevelC"
|
||||
#define FLUID_NAME_GUIDEVEL_X "x_guidevel"
|
||||
#define FLUID_NAME_GUIDEVEL_Y "y_guidevel"
|
||||
#define FLUID_NAME_GUIDEVEL_Z "z_guidevel"
|
||||
#define FLUID_NAME_GUIDEVEL "guidevel"
|
||||
#define FLUID_NAME_VELOCITY_GUIDE "velocity_guide"
|
||||
|
||||
/* Cache file extensions. */
|
||||
#define FLUID_DOMAIN_EXTENSION_UNI ".uni"
|
||||
#define FLUID_DOMAIN_EXTENSION_OPENVDB ".vdb"
|
||||
#define FLUID_DOMAIN_EXTENSION_RAW ".raw"
|
||||
#define FLUID_DOMAIN_EXTENSION_OBJ ".obj"
|
||||
#define FLUID_DOMAIN_EXTENSION_BINOBJ ".bobj.gz"
|
||||
|
||||
enum eFluidDomain_GridType : int {
|
||||
FLUID_DOMAIN_GRID_FLOAT = 0,
|
||||
FLUID_DOMAIN_GRID_INT = 1,
|
||||
FLUID_DOMAIN_GRID_VEC3F = 2,
|
||||
};
|
||||
|
||||
enum eFluidDomain_CacheFilesMode : int {
|
||||
FLUID_DOMAIN_CACHE_FILES_SINGLE = 0,
|
||||
FLUID_DOMAIN_CACHE_FILES_COMBINED = 1,
|
||||
};
|
||||
|
||||
enum eFluidDomain_CacheType : short {
|
||||
FLUID_DOMAIN_CACHE_REPLAY = 0,
|
||||
FLUID_DOMAIN_CACHE_MODULAR = 1,
|
||||
FLUID_DOMAIN_CACHE_ALL = 2,
|
||||
};
|
||||
|
||||
enum eFluidDomain_OpenVDBCompression : int {
|
||||
VDB_COMPRESSION_BLOSC = 0,
|
||||
VDB_COMPRESSION_ZIP = 1,
|
||||
VDB_COMPRESSION_NONE = 2,
|
||||
};
|
||||
|
||||
enum eFluidDomain_OpenVDBDepth : char {
|
||||
VDB_PRECISION_HALF_FLOAT = 0,
|
||||
VDB_PRECISION_FULL_FLOAT = 1,
|
||||
VDB_PRECISION_MINI_FLOAT = 2,
|
||||
};
|
||||
|
||||
/* Deprecated values (i.e. all defines and enums below this line up until typedefs). */
|
||||
/* Cache compression. */
|
||||
enum eFluidDomain_CacheComp : int {
|
||||
SM_CACHE_LIGHT = 0,
|
||||
SM_CACHE_HEAVY = 1,
|
||||
};
|
||||
|
||||
/* High resolution sampling types. */
|
||||
enum eFluidDomain_HighresSampling : int {
|
||||
SM_HRES_NEAREST = 0,
|
||||
SM_HRES_LINEAR = 1,
|
||||
SM_HRES_FULLSAMPLE = 2,
|
||||
};
|
||||
|
||||
/* Flow types. */
|
||||
enum eFluidFlow_Type : short {
|
||||
FLUID_FLOW_TYPE_SMOKE = 1,
|
||||
FLUID_FLOW_TYPE_FIRE = 2,
|
||||
FLUID_FLOW_TYPE_SMOKEFIRE = 3,
|
||||
FLUID_FLOW_TYPE_LIQUID = 4,
|
||||
};
|
||||
|
||||
/* Flow behavior types. */
|
||||
enum eFluidFlow_Behavior : short {
|
||||
FLUID_FLOW_BEHAVIOR_INFLOW = 0,
|
||||
FLUID_FLOW_BEHAVIOR_OUTFLOW = 1,
|
||||
FLUID_FLOW_BEHAVIOR_GEOMETRY = 2,
|
||||
};
|
||||
|
||||
/* Flow source types. */
|
||||
enum eFluidFlow_Source : short {
|
||||
FLUID_FLOW_SOURCE_PARTICLES = 0,
|
||||
FLUID_FLOW_SOURCE_MESH = 1,
|
||||
};
|
||||
|
||||
/* Flow texture types. */
|
||||
enum eFluidFlow_TextureType : short {
|
||||
FLUID_FLOW_TEXTURE_MAP_AUTO = 0,
|
||||
FLUID_FLOW_TEXTURE_MAP_UV = 1,
|
||||
};
|
||||
|
||||
/* Flow flags. */
|
||||
enum eFluidFlow_Flags : int {
|
||||
/* Old style emission. */
|
||||
FLUID_FLOW_ABSOLUTE = (1 << 1),
|
||||
/* Passes particles speed to the smoke. */
|
||||
FLUID_FLOW_INITVELOCITY = (1 << 2),
|
||||
/* Use texture to control emission speed. */
|
||||
FLUID_FLOW_TEXTUREEMIT = (1 << 3),
|
||||
/* Use specific size for particles instead of closest cell. */
|
||||
FLUID_FLOW_USE_PART_SIZE = (1 << 4),
|
||||
/* Control when to apply inflow. */
|
||||
FLUID_FLOW_USE_INFLOW = (1 << 5),
|
||||
/* Control how to initialize flow objects. */
|
||||
FLUID_FLOW_USE_PLANE_INIT = (1 << 6),
|
||||
/* Notify domain objects about state change (invalidate cache). */
|
||||
FLUID_FLOW_NEEDS_UPDATE = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidFlow_Flags)
|
||||
|
||||
/* Effector types. */
|
||||
enum eFluidEffector_Type : short {
|
||||
FLUID_EFFECTOR_TYPE_COLLISION = 0,
|
||||
FLUID_EFFECTOR_TYPE_GUIDE = 1,
|
||||
};
|
||||
|
||||
/* Guiding velocity modes. */
|
||||
enum eFluidEffector_GuideMode : short {
|
||||
FLUID_EFFECTOR_GUIDE_MAX = 0,
|
||||
FLUID_EFFECTOR_GUIDE_MIN = 1,
|
||||
FLUID_EFFECTOR_GUIDE_OVERRIDE = 2,
|
||||
FLUID_EFFECTOR_GUIDE_AVERAGED = 3,
|
||||
};
|
||||
|
||||
/* Effector flags. */
|
||||
enum eFluidEffector_Flags : int {
|
||||
/* Control when to apply inflow. */
|
||||
FLUID_EFFECTOR_USE_EFFEC = (1 << 1),
|
||||
/* Control how to initialize flow objects. */
|
||||
FLUID_EFFECTOR_USE_PLANE_INIT = (1 << 2),
|
||||
/* Notify domain objects about state change (invalidate cache). */
|
||||
FLUID_EFFECTOR_NEEDS_UPDATE = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eFluidEffector_Flags)
|
||||
|
||||
struct FluidDomainSettings {
|
||||
/* -- Runtime-only fields (from here on). -- */
|
||||
|
||||
struct FluidModifierData *fmd = nullptr; /* For fast RNA access. */
|
||||
struct MANTA *fluid = nullptr;
|
||||
struct MANTA *fluid_old = nullptr; /* Adaptive domain needs access to old fluid state. */
|
||||
void *fluid_mutex = nullptr;
|
||||
struct Collection *fluid_group = nullptr;
|
||||
struct Collection *force_group = nullptr; /* UNUSED */
|
||||
struct Collection *effector_group = nullptr; /* Effector objects group. */
|
||||
gpu::Texture *tex_density = nullptr;
|
||||
gpu::Texture *tex_color = nullptr;
|
||||
gpu::Texture *tex_wt = nullptr;
|
||||
gpu::Texture *tex_shadow = nullptr;
|
||||
gpu::Texture *tex_flame = nullptr;
|
||||
gpu::Texture *tex_flame_coba = nullptr;
|
||||
gpu::Texture *tex_coba = nullptr;
|
||||
gpu::Texture *tex_field = nullptr;
|
||||
gpu::Texture *tex_velocity_x = nullptr;
|
||||
gpu::Texture *tex_velocity_y = nullptr;
|
||||
gpu::Texture *tex_velocity_z = nullptr;
|
||||
gpu::Texture *tex_flags = nullptr;
|
||||
gpu::Texture *tex_range_field = nullptr;
|
||||
struct Object *guide_parent = nullptr;
|
||||
struct EffectorWeights *effector_weights = nullptr; /* #BKE_effector_add_weights. */
|
||||
|
||||
/* Domain object data. */
|
||||
float p0[3] = {0.0f, 0.0f, 0.0f}; /* Start point of BB in local space
|
||||
* (includes sub-cell shift for adaptive domain). */
|
||||
float p1[3] = {0.0f, 0.0f, 0.0f}; /* End point of BB in local space. */
|
||||
float dp0[3] = {0.0f, 0.0f, 0.0f}; /* Difference from object center to grid start point. */
|
||||
float cell_size[3] = {0.0f, 0.0f, 0.0f}; /* Size of simulation cell in local space. */
|
||||
float global_size[3] = {0.0f, 0.0f, 0.0f}; /* Global size of domain axes. */
|
||||
float prev_loc[3] = {0.0f, 0.0f, 0.0f};
|
||||
int shift[3] = {0, 0, 0}; /* Current domain shift in simulation cells. */
|
||||
float shift_f[3] = {0.0f, 0.0f, 0.0f}; /* Exact domain shift. */
|
||||
float obj_shift_f[3] = {0.0f, 0.0f, 0.0f}; /* How much object has shifted since previous smoke
|
||||
* frame (used to "lock" domain while drawing). */
|
||||
float imat[4][4] = _DNA_DEFAULT_UNIT_M4; /* Domain object imat. */
|
||||
float obmat[4][4] = _DNA_DEFAULT_UNIT_M4; /* Domain obmat. */
|
||||
float fluidmat[4][4] = _DNA_DEFAULT_UNIT_M4; /* Low res fluid matrix. */
|
||||
float fluidmat_wt[4][4] = _DNA_DEFAULT_UNIT_M4; /* High res fluid matrix. */
|
||||
int base_res[3] = {0, 0, 0}; /* Initial "non-adapted" resolution. */
|
||||
int res_min[3] = {0, 0, 0}; /* Cell min. */
|
||||
int res_max[3] = {0, 0, 0}; /* Cell max. */
|
||||
int res[3] = {0, 0, 0}; /* Data resolution (res_max-res_min). */
|
||||
int total_cells = 0;
|
||||
float dx = 0; /* 1.0f / res. */
|
||||
float scale = 0.0f; /* Largest domain size. */
|
||||
int boundary_width = 1; /* Usually this is just 1. */
|
||||
float gravity_final[3] = {
|
||||
0.0f, 0.0f, 0.0f}; /* Scene or domain gravity multiplied with gravity weight. */
|
||||
|
||||
/* -- User-accessible fields (from here on). -- */
|
||||
|
||||
/* Adaptive domain options. */
|
||||
int adapt_margin = 4;
|
||||
int adapt_res = 0;
|
||||
float adapt_threshold = 0.002f;
|
||||
|
||||
/* Fluid domain options */
|
||||
int maxres = 32; /* Longest axis on the BB gets this resolution assigned. */
|
||||
int solver_res = 3; /* Dimension of manta solver, 2d or 3d. */
|
||||
eFluidDomain_BorderFlags border_collisions = {}; /* How domain border collisions are handled. */
|
||||
eFluidDomain_Flags flags = FLUID_DOMAIN_USE_DISSOLVE_LOG | FLUID_DOMAIN_USE_ADAPTIVE_TIME |
|
||||
FLUID_DOMAIN_USE_MESH; /* Use-mesh, use-noise, etc. */
|
||||
float gravity[3] = {0.0f, 0.0f, -9.81f};
|
||||
eFluidDomain_ActiveFields active_fields = {};
|
||||
eFluidDomain_Type type = FLUID_DOMAIN_TYPE_GAS; /* Gas, liquid. */
|
||||
char _pad2[6] = {}; /* Unused. */
|
||||
|
||||
/* Smoke domain options. */
|
||||
float alpha = 1.0f;
|
||||
float beta = 1.0f;
|
||||
int diss_speed = 5; /* In frames. */
|
||||
float vorticity = 0.0f;
|
||||
float active_color[3] = {0.0f, 0.0f, 0.0f}; /* Monitor smoke color. */
|
||||
eFluidDomain_HighresSampling highres_sampling = SM_HRES_FULLSAMPLE;
|
||||
|
||||
/* Flame options. */
|
||||
float burning_rate = 0.75f, flame_smoke = 1.0f, flame_vorticity = 0.5f;
|
||||
float flame_ignition = 1.5f, flame_max_temp = 3.0f;
|
||||
float flame_smoke_color[3] = {0.7f, 0.7f, 0.7f};
|
||||
|
||||
/* Noise options. */
|
||||
float noise_strength = 1.0f;
|
||||
float noise_pos_scale = 2.0f;
|
||||
float noise_time_anim = 0.1f;
|
||||
int res_noise[3] = {0, 0, 0};
|
||||
int noise_scale = 2;
|
||||
char _pad3[4] = {}; /* Unused. */
|
||||
|
||||
/* Liquid domain options. */
|
||||
float particle_randomness = 0.1f;
|
||||
int particle_number = 2;
|
||||
int particle_minimum = 8;
|
||||
int particle_maximum = 16;
|
||||
float particle_radius = 1.0f;
|
||||
float particle_band_width = 3.0f;
|
||||
float fractions_threshold = 0.05f;
|
||||
float fractions_distance = 0.5f;
|
||||
float flip_ratio = 0.97f;
|
||||
int sys_particle_maximum = 0;
|
||||
eFluidDomain_SimMethod simulation_method = FLUID_DOMAIN_METHOD_FLIP;
|
||||
char _pad4[6] = {};
|
||||
|
||||
/* Viscosity options. */
|
||||
float viscosity_value = 0.05f;
|
||||
char _pad5[4] = {};
|
||||
|
||||
/* Diffusion options. */
|
||||
float surface_tension = 0.0f;
|
||||
float viscosity_base = 1.0f;
|
||||
int viscosity_exponent = 6.0f;
|
||||
|
||||
/* Mesh options. */
|
||||
float mesh_concave_upper = 3.5f;
|
||||
float mesh_concave_lower = 0.4f;
|
||||
float mesh_particle_radius = 2.0f;
|
||||
int mesh_smoothen_pos = 1;
|
||||
int mesh_smoothen_neg = 1;
|
||||
int mesh_scale = 2;
|
||||
eFluidDomain_MeshGenerator mesh_generator = FLUID_DOMAIN_MESH_IMPROVED;
|
||||
char _pad6[2] = {}; /* Unused. */
|
||||
|
||||
/* Secondary particle options. */
|
||||
eFluidDomain_ParticleTypes particle_type = {};
|
||||
int particle_scale = 1;
|
||||
float sndparticle_tau_min_wc = 2.0f;
|
||||
float sndparticle_tau_max_wc = 8.0f;
|
||||
float sndparticle_tau_min_ta = 5.0f;
|
||||
float sndparticle_tau_max_ta = 20.0f;
|
||||
float sndparticle_tau_min_k = 1.0f;
|
||||
float sndparticle_tau_max_k = 5.0f;
|
||||
int sndparticle_k_wc = 200;
|
||||
int sndparticle_k_ta = 40;
|
||||
float sndparticle_k_b = 0.5f;
|
||||
float sndparticle_k_d = 0.6f;
|
||||
float sndparticle_l_min = 10.0f;
|
||||
float sndparticle_l_max = 25.0f;
|
||||
int sndparticle_potential_radius = 2;
|
||||
int sndparticle_update_radius = 2;
|
||||
eFluidDomain_SndParticleBoundary sndparticle_boundary = SNDPARTICLE_BOUNDARY_DELETE;
|
||||
eFluidDomain_SndParticleCombinedExport sndparticle_combined_export =
|
||||
SNDPARTICLE_COMBINED_EXPORT_OFF;
|
||||
char _pad7[6] = {}; /* Unused. */
|
||||
|
||||
/* Fluid guiding options. */
|
||||
float guide_alpha = 2.0f; /* Guiding weight scalar (determines strength). */
|
||||
int guide_beta = 5; /* Guiding blur radius (affects size of vortices). */
|
||||
float guide_vel_factor = 2.0f; /* Multiply guiding velocity by this factor. */
|
||||
int guide_res[3] = {0, 0, 0}; /* Res for velocity guide grids - independent from base res. */
|
||||
eFluidDomain_GuideSource guide_source = FLUID_DOMAIN_GUIDE_SRC_DOMAIN;
|
||||
char _pad8[2] = {}; /* Unused. */
|
||||
|
||||
/* Cache options. */
|
||||
int cache_frame_start = 1;
|
||||
int cache_frame_end = 250;
|
||||
int cache_frame_pause_data = 0;
|
||||
int cache_frame_pause_noise = 0;
|
||||
int cache_frame_pause_mesh = 0;
|
||||
int cache_frame_pause_particles = 0;
|
||||
int cache_frame_pause_guide = 0;
|
||||
int cache_frame_offset = 0;
|
||||
eFluidDomain_CacheFlag cache_flag = {};
|
||||
eFluidDomain_FileFormat cache_mesh_format = FLUID_DOMAIN_FILE_BIN_OBJECT;
|
||||
eFluidDomain_FileFormat cache_data_format = FLUID_DOMAIN_FILE_OPENVDB;
|
||||
eFluidDomain_FileFormat cache_particle_format = FLUID_DOMAIN_FILE_OPENVDB;
|
||||
eFluidDomain_FileFormat cache_noise_format = FLUID_DOMAIN_FILE_OPENVDB;
|
||||
char cache_directory[/*FILE_MAX*/ 1024] = "";
|
||||
char error[64] = ""; /* Bake error description. */
|
||||
eFluidDomain_CacheType cache_type = FLUID_DOMAIN_CACHE_REPLAY;
|
||||
char cache_id[4] = ""; /* Run-time only */
|
||||
char _pad9[2] = {}; /* Unused. */
|
||||
|
||||
/* Time options. */
|
||||
float dt = 0.0f;
|
||||
float time_total = 0.0f;
|
||||
float time_per_frame = 0.0f;
|
||||
float frame_length = 0.0f;
|
||||
float time_scale = 1.0f;
|
||||
float cfl_condition = 2.0f;
|
||||
int timesteps_minimum = 1;
|
||||
int timesteps_maximum = 4;
|
||||
|
||||
/* Display options. */
|
||||
float slice_per_voxel = 5.0f;
|
||||
float slice_depth = 0.5f;
|
||||
float display_thickness = 1.0f;
|
||||
float grid_scale = 1.0f;
|
||||
struct ColorBand *coba = nullptr;
|
||||
float vector_scale = 1.0f;
|
||||
float gridlines_lower_bound = 0.0f;
|
||||
float gridlines_upper_bound = 1.0f;
|
||||
float gridlines_range_color[4] = {1.0f, 0.0f, 0.0f, 1.0f};
|
||||
eFluidDomain_AxisSliceMethod axis_slice_method = AXIS_SLICE_FULL;
|
||||
eFluidDomain_SliceAxis slice_axis = SLICE_AXIS_AUTO;
|
||||
char show_gridlines = false;
|
||||
char draw_velocity = false;
|
||||
eFluidDomain_VectorDrawType vector_draw_type = VECTOR_DRAW_NEEDLE;
|
||||
FLUID_DisplayVectorField vector_field =
|
||||
FLUID_DOMAIN_VECTOR_FIELD_VELOCITY; /* Simulation field used for vector display. */
|
||||
char vector_scale_with_magnitude = true;
|
||||
eFluidDomain_VectorDrawMAC vector_draw_mac_components = VECTOR_DRAW_MAC_X | VECTOR_DRAW_MAC_Y |
|
||||
VECTOR_DRAW_MAC_Z;
|
||||
char use_coba = false;
|
||||
eFluidDomain_CobaField coba_field =
|
||||
FLUID_DOMAIN_FIELD_DENSITY; /* Simulation field used for the color mapping. */
|
||||
FLUID_DisplayInterpolationMethod interp_method = FLUID_DISPLAY_INTERP_LINEAR;
|
||||
eFluidDomain_GridlineColorField gridlines_color_field =
|
||||
FLUID_GRIDLINE_COLOR_TYPE_NONE; /* Simulation field used to color map onto gridlines. */
|
||||
eFluidDomain_GridlineCellFilter gridlines_cell_filter = FLUID_CELL_TYPE_NONE;
|
||||
char _pad10[3] = {}; /* Unused. */
|
||||
|
||||
/* Velocity factor for motion blur rendering. */
|
||||
float velocity_scale = 1.0f;
|
||||
|
||||
/* OpenVDB cache options. */
|
||||
eFluidDomain_OpenVDBCompression openvdb_compression = VDB_COMPRESSION_BLOSC;
|
||||
float clipping = 1e-6f;
|
||||
eFluidDomain_OpenVDBDepth openvdb_data_depth = VDB_PRECISION_HALF_FLOAT;
|
||||
char _pad11[7] = {}; /* Unused. */
|
||||
|
||||
/* -- Deprecated / unused options (below). -- */
|
||||
|
||||
/* View options. */
|
||||
int viewsettings = 0;
|
||||
char _pad12[4] = {}; /* Unused. */
|
||||
|
||||
/**
|
||||
* Point-cache options.
|
||||
* Smoke uses only one cache from now on (index [0]),
|
||||
* but keeping the array for now for reading old files.
|
||||
*/
|
||||
struct PointCache *point_cache[2] = {nullptr, nullptr}; /* Use #BKE_ptcache_add. */
|
||||
struct ListBaseT<PointCache> ptcaches[2] = {
|
||||
{nullptr, nullptr}, {nullptr, nullptr},
|
||||
};
|
||||
eFluidDomain_CacheComp cache_comp = SM_CACHE_LIGHT;
|
||||
eFluidDomain_CacheComp cache_high_comp = SM_CACHE_LIGHT;
|
||||
eFluidDomain_FileFormat cache_file_format = {};
|
||||
char _pad13[7] = {}; /* Unused. */
|
||||
};
|
||||
|
||||
struct FluidFlowSettings {
|
||||
|
||||
/* -- Runtime-only fields (from here on). -- */
|
||||
|
||||
/* For fast RNA access. */
|
||||
struct FluidModifierData *fmd = nullptr;
|
||||
struct Mesh *mesh = nullptr;
|
||||
struct ParticleSystem *psys = nullptr;
|
||||
struct Tex *noise_texture = nullptr;
|
||||
|
||||
/* Initial velocity. */
|
||||
/* Previous vertex positions in domain space. */
|
||||
float *verts_old = nullptr;
|
||||
int numverts = 0;
|
||||
float vel_multi = 1.0f; /* Multiplier for inherited velocity. */
|
||||
float vel_normal = 0.0f;
|
||||
float vel_random = 0.0f;
|
||||
float vel_coord[3] = {0.0f, 0.0f, 0.0f};
|
||||
char _pad1[4] = {};
|
||||
|
||||
/* -- User-accessible fields (from here on). -- */
|
||||
|
||||
/* Emission. */
|
||||
float density = 1.0f;
|
||||
float color[3] = {0.7f, 0.7f, 0.7f};
|
||||
float fuel_amount = 1.0f;
|
||||
/* Delta temperature (temp - ambient temp). */
|
||||
float temperature = 1.0f;
|
||||
/* Density emitted within mesh volume. */
|
||||
float volume_density = 0.0f;
|
||||
/* Maximum emission distance from mesh surface. */
|
||||
float surface_distance = 1.0f;
|
||||
float particle_size = 1.0f;
|
||||
int subframes = 0;
|
||||
|
||||
/* Texture control. */
|
||||
float texture_size = 1.0f;
|
||||
float texture_offset = 0.0f;
|
||||
char _pad2[4] = {};
|
||||
char uvlayer_name[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
char _pad3[4] = {};
|
||||
short vgroup_density = 0;
|
||||
|
||||
eFluidFlow_Type type = FLUID_FLOW_TYPE_SMOKE; /* Smoke, flames, both, outflow, liquid. */
|
||||
eFluidFlow_Behavior behavior = FLUID_FLOW_BEHAVIOR_GEOMETRY; /* Inflow, outflow, static. */
|
||||
eFluidFlow_Source source = FLUID_FLOW_SOURCE_MESH;
|
||||
eFluidFlow_TextureType texture_type = FLUID_FLOW_TEXTURE_MAP_AUTO;
|
||||
short _pad4[3] = {};
|
||||
eFluidFlow_Flags flags = FLUID_FLOW_ABSOLUTE | FLUID_FLOW_USE_PART_SIZE |
|
||||
FLUID_FLOW_USE_INFLOW; /* Absolute emission etc. */
|
||||
};
|
||||
|
||||
/* Collision objects (filled with smoke). */
|
||||
struct FluidEffectorSettings {
|
||||
|
||||
/* -- Runtime-only fields (from here on). -- */
|
||||
|
||||
/* For fast RNA access. */
|
||||
struct FluidModifierData *fmd = nullptr;
|
||||
struct Mesh *mesh = nullptr;
|
||||
float *verts_old = nullptr;
|
||||
int numverts = 0;
|
||||
|
||||
/* -- User-accessible fields (from here on). -- */
|
||||
|
||||
float surface_distance = 0.0f; /* Thickness of mesh surface, used in obstacle SDF. */
|
||||
eFluidEffector_Flags flags = FLUID_EFFECTOR_USE_EFFEC;
|
||||
int subframes = 0;
|
||||
eFluidEffector_Type type = FLUID_EFFECTOR_TYPE_COLLISION;
|
||||
char _pad1[6] = {};
|
||||
|
||||
/* Guiding options. */
|
||||
float vel_multi = 1.0f; /* Multiplier for object velocity. */
|
||||
eFluidEffector_GuideMode guide_mode = FLUID_EFFECTOR_GUIDE_OVERRIDE;
|
||||
char _pad2[2] = {};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
142
blender-5.2.0/source/blender/makesdna/DNA_freestyle_types.h
Normal file
142
blender-5.2.0/source/blender/makesdna/DNA_freestyle_types.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/* SPDX-FileCopyrightText: 2010 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct Collection;
|
||||
struct FreestyleLineStyle;
|
||||
struct Text;
|
||||
|
||||
/* FreestyleConfig::flags */
|
||||
enum eFreestyleConfig_Flags : int {
|
||||
FREESTYLE_SUGGESTIVE_CONTOURS_FLAG = 1 << 0,
|
||||
FREESTYLE_RIDGES_AND_VALLEYS_FLAG = 1 << 1,
|
||||
FREESTYLE_MATERIAL_BOUNDARIES_FLAG = 1 << 2,
|
||||
FREESTYLE_FACE_SMOOTHNESS_FLAG = 1 << 3,
|
||||
/* FREESTYLE_ADVANCED_OPTIONS_FLAG = 1 << 4, */ /* UNUSED */
|
||||
FREESTYLE_CULLING = 1 << 5,
|
||||
FREESTYLE_VIEW_MAP_CACHE = 1 << 6,
|
||||
FREESTYLE_AS_RENDER_PASS = 1 << 7,
|
||||
};
|
||||
ENUM_OPERATORS(eFreestyleConfig_Flags)
|
||||
|
||||
/* FreestyleConfig::mode */
|
||||
enum eFreestyleControl_Mode : int {
|
||||
FREESTYLE_CONTROL_SCRIPT_MODE = 1,
|
||||
FREESTYLE_CONTROL_EDITOR_MODE = 2,
|
||||
};
|
||||
|
||||
/* FreestyleLineSet::flags */
|
||||
enum eFreestyleLineSet_Flags : int {
|
||||
FREESTYLE_LINESET_CURRENT = 1 << 0,
|
||||
FREESTYLE_LINESET_ENABLED = 1 << 1,
|
||||
FREESTYLE_LINESET_FE_NOT = 1 << 2,
|
||||
FREESTYLE_LINESET_FE_AND = 1 << 3,
|
||||
FREESTYLE_LINESET_GR_NOT = 1 << 4,
|
||||
FREESTYLE_LINESET_FM_NOT = 1 << 5,
|
||||
FREESTYLE_LINESET_FM_BOTH = 1 << 6,
|
||||
};
|
||||
ENUM_OPERATORS(eFreestyleLineSet_Flags)
|
||||
|
||||
/* FreestyleLineSet::selection */
|
||||
enum eFreestyleLineSet_Selection : int {
|
||||
FREESTYLE_SEL_VISIBILITY = 1 << 0,
|
||||
FREESTYLE_SEL_EDGE_TYPES = 1 << 1,
|
||||
FREESTYLE_SEL_GROUP = 1 << 2,
|
||||
FREESTYLE_SEL_IMAGE_BORDER = 1 << 3,
|
||||
FREESTYLE_SEL_FACE_MARK = 1 << 4,
|
||||
};
|
||||
ENUM_OPERATORS(eFreestyleLineSet_Selection)
|
||||
|
||||
/* FreestyleLineSet::edge_types, exclude_edge_types */
|
||||
enum eFreestyleLineSet_EdgeTypes : int {
|
||||
FREESTYLE_FE_SILHOUETTE = 1 << 0,
|
||||
FREESTYLE_FE_BORDER = 1 << 1,
|
||||
FREESTYLE_FE_CREASE = 1 << 2,
|
||||
FREESTYLE_FE_RIDGE_VALLEY = 1 << 3,
|
||||
/* FREESTYLE_FE_VALLEY = 1 << 4, */ /* No longer used */
|
||||
FREESTYLE_FE_SUGGESTIVE_CONTOUR = 1 << 5,
|
||||
FREESTYLE_FE_MATERIAL_BOUNDARY = 1 << 6,
|
||||
FREESTYLE_FE_CONTOUR = 1 << 7,
|
||||
FREESTYLE_FE_EXTERNAL_CONTOUR = 1 << 8,
|
||||
FREESTYLE_FE_EDGE_MARK = 1 << 9,
|
||||
};
|
||||
ENUM_OPERATORS(eFreestyleLineSet_EdgeTypes)
|
||||
|
||||
/* FreestyleLineSet::qi */
|
||||
enum eFreestyleLineSet_QI : short {
|
||||
FREESTYLE_QI_VISIBLE = 1,
|
||||
FREESTYLE_QI_HIDDEN = 2,
|
||||
FREESTYLE_QI_RANGE = 3,
|
||||
};
|
||||
|
||||
/* FreestyleConfig::raycasting_algorithm */
|
||||
/* Defines should be replaced with ViewMapBuilder::visibility_algo */
|
||||
enum eFreestyleRaycastingAlgorithm : int {
|
||||
FREESTYLE_ALGO_REGULAR = 1,
|
||||
FREESTYLE_ALGO_FAST = 2,
|
||||
FREESTYLE_ALGO_VERYFAST = 3,
|
||||
FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL = 4,
|
||||
FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL = 5,
|
||||
FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE = 6,
|
||||
FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE = 7,
|
||||
};
|
||||
|
||||
struct FreestyleLineSet {
|
||||
struct FreestyleLineSet *next = nullptr, *prev = nullptr;
|
||||
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
eFreestyleLineSet_Flags flags = {};
|
||||
|
||||
/** Selection criteria. */
|
||||
eFreestyleLineSet_Selection selection = {};
|
||||
/** Quantitative invisibility. */
|
||||
eFreestyleLineSet_QI qi = {};
|
||||
char _pad1[2] = {};
|
||||
int qi_start = 0, qi_end = 0;
|
||||
/** Feature edge types. */
|
||||
eFreestyleLineSet_EdgeTypes edge_types = {}, exclude_edge_types = {};
|
||||
char _pad2[4] = {};
|
||||
/** Group of target objects. */
|
||||
struct Collection *group = nullptr;
|
||||
|
||||
struct FreestyleLineStyle *linestyle = nullptr;
|
||||
};
|
||||
|
||||
struct FreestyleModuleConfig {
|
||||
struct FreestyleModuleConfig *next = nullptr, *prev = nullptr;
|
||||
|
||||
struct Text *script = nullptr;
|
||||
short is_displayed = 0;
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
struct FreestyleConfig {
|
||||
ListBaseT<FreestyleModuleConfig> modules = {nullptr, nullptr};
|
||||
|
||||
/** Scripting, editor. */
|
||||
eFreestyleControl_Mode mode = {};
|
||||
DNA_DEPRECATED int raycasting_algorithm = 0;
|
||||
/** Suggestive contours, ridges/valleys, material boundaries. */
|
||||
eFreestyleConfig_Flags flags = {};
|
||||
float sphere_radius = 0;
|
||||
float dkr_epsilon = 0;
|
||||
/** In radians. */
|
||||
float crease_angle = 0;
|
||||
|
||||
ListBaseT<FreestyleLineSet> linesets = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
242
blender-5.2.0/source/blender/makesdna/DNA_genfile.h
Normal file
242
blender-5.2.0/source/blender/makesdna/DNA_genfile.h
Normal file
@@ -0,0 +1,242 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* \brief blenloader genfile private function prototypes
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "intern/dna_utils.h"
|
||||
|
||||
/**
|
||||
* DNAstr contains the prebuilt SDNA structure defining the layouts of the types
|
||||
* used by this version of Blender. It is defined in a file dna.c, which is
|
||||
* generated by the `makesdna` program during the build process (see `makesdna.cc`).
|
||||
*/
|
||||
extern const unsigned char DNAstr[];
|
||||
/** Length of DNAstr. */
|
||||
extern const int DNAlen;
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct SDNA;
|
||||
|
||||
/**
|
||||
* Primitive (non-struct, non-pointer/function/array) types,
|
||||
*
|
||||
* NOTE: this is endianness-sensitive.
|
||||
* \warning Don't change these values!
|
||||
* Currently changes here will work on native endianness, however before 5.0,
|
||||
* #DNA_struct_switch_endian used to check these hard-coded values against those from old files.
|
||||
*/
|
||||
enum eSDNA_Type {
|
||||
SDNA_TYPE_CHAR = 0,
|
||||
SDNA_TYPE_UCHAR = 1,
|
||||
SDNA_TYPE_SHORT = 2,
|
||||
SDNA_TYPE_USHORT = 3,
|
||||
SDNA_TYPE_INT = 4,
|
||||
/* SDNA_TYPE_LONG = 5, */ /* deprecated (use as int) */
|
||||
/* SDNA_TYPE_ULONG = 6, */ /* deprecated (use as int) */
|
||||
SDNA_TYPE_FLOAT = 7,
|
||||
SDNA_TYPE_DOUBLE = 8,
|
||||
SDNA_TYPE_INT64 = 9,
|
||||
SDNA_TYPE_UINT64 = 10,
|
||||
SDNA_TYPE_VOID = 11,
|
||||
SDNA_TYPE_INT8 = 12,
|
||||
/**
|
||||
* Type used for untyped raw bytes buffers (written by #BlendWriter::write_raw and read by
|
||||
* #BLO_read_raw_address).
|
||||
*
|
||||
* Technically, it also covers all 'raw data' types above.
|
||||
*/
|
||||
SDNA_TYPE_RAW_DATA = 13,
|
||||
};
|
||||
|
||||
/**
|
||||
* For use with #DNA_struct_reconstruct & #DNA_struct_get_compareflags
|
||||
*/
|
||||
enum eSDNA_StructCompare {
|
||||
/* Struct has disappeared
|
||||
* (values of this struct type will not be loaded by the current Blender) */
|
||||
SDNA_CMP_REMOVED = 0,
|
||||
/* Struct is the same (can be loaded with straight memory copy). */
|
||||
SDNA_CMP_EQUAL = 1,
|
||||
/* Struct is different in some way
|
||||
* (needs to be copied/converted field by field) */
|
||||
SDNA_CMP_NOT_EQUAL = 2,
|
||||
/* This is only used temporarily by #DNA_struct_get_compareflags. */
|
||||
SDNA_CMP_UNKNOWN = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs and returns a decoded SDNA structure from the given encoded SDNA data block.
|
||||
*/
|
||||
struct SDNA *DNA_sdna_from_data(
|
||||
const void *data, int data_len, bool data_alloc, bool do_alias, const char **r_error_message);
|
||||
void DNA_sdna_free(struct SDNA *sdna);
|
||||
|
||||
/* Access for current Blender versions SDNA. */
|
||||
void DNA_sdna_current_init();
|
||||
/* borrowed reference */
|
||||
const struct SDNA *DNA_sdna_current_get();
|
||||
void DNA_sdna_current_free();
|
||||
|
||||
struct DNA_ReconstructInfo;
|
||||
/**
|
||||
* Pre-process information about how structs in \a newsdna can be reconstructed from structs in
|
||||
* \a oldsdna. This information is then used to speedup #DNA_struct_reconstruct.
|
||||
*/
|
||||
struct DNA_ReconstructInfo *DNA_reconstruct_info_create(const struct SDNA *oldsdna,
|
||||
const struct SDNA *newsdna,
|
||||
const char *compare_flags);
|
||||
void DNA_reconstruct_info_free(struct DNA_ReconstructInfo *reconstruct_info);
|
||||
|
||||
/**
|
||||
* \param struct_index_last: Support faster lookups when there is the possibility
|
||||
* of the same name being looked up multiple times. Initialize to `UINT_MAX`.
|
||||
*
|
||||
* \return the index of the struct or -1 on failure.
|
||||
*/
|
||||
int DNA_struct_find_index_with_alias_ex(const struct SDNA *sdna,
|
||||
const char *str,
|
||||
unsigned int *struct_index_last);
|
||||
/** \note prefer #DNA_struct_find_with_alias_ex unless there is a good reason not to. */
|
||||
int DNA_struct_find_index_without_alias_ex(const struct SDNA *sdna,
|
||||
const char *str,
|
||||
unsigned int *struct_index_last);
|
||||
/**
|
||||
* \return the index of the struct or -1 on failure.
|
||||
*/
|
||||
int DNA_struct_find_with_alias(const struct SDNA *sdna, const char *str);
|
||||
/** \note prefer #DNA_struct_find_with_alias unless there is a good reason not to. */
|
||||
int DNA_struct_find_index_without_alias(const struct SDNA *sdna, const char *str);
|
||||
|
||||
/**
|
||||
* A convenience function, the equivalent of: `DNA_struct_find_with_alias(..) != -1`
|
||||
*/
|
||||
bool DNA_struct_exists_with_alias(const struct SDNA *sdna, const char *str);
|
||||
/** \note prefer #DNA_struct_exists_with_alias unless there is a good reason not to. */
|
||||
bool DNA_struct_exists_without_alias(const struct SDNA *sdna, const char *stype);
|
||||
/**
|
||||
* A convenience function, the equivalent of: `DNA_struct_member_find_with_alias(..) != -1`
|
||||
*/
|
||||
bool DNA_struct_member_exists_with_alias(const struct SDNA *sdna,
|
||||
const char *stype,
|
||||
const char *vartype,
|
||||
const char *name);
|
||||
/** \note prefer #DNA_struct_exists_with_alias unless there is a good reason not to. */
|
||||
bool DNA_struct_member_exists_without_alias(const struct SDNA *sdna,
|
||||
const char *stype,
|
||||
const char *vartype,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Constructs and returns an array of byte flags with one element for each struct in oldsdna,
|
||||
* indicating how it compares to newsdna.
|
||||
*/
|
||||
const char *DNA_struct_get_compareflags(const struct SDNA *oldsdna, const struct SDNA *newsdna);
|
||||
/**
|
||||
* \param reconstruct_info: Information preprocessed by #DNA_reconstruct_info_create.
|
||||
* \param old_struct_index: Index of struct info within oldsdna.
|
||||
* \param blocks: The number of array elements.
|
||||
* \param old_blocks: Array of struct data.
|
||||
* \param alloc_name: String to pass to the allocation calls for reconstructed data.
|
||||
* \return An allocated reconstructed struct.
|
||||
*/
|
||||
void *DNA_struct_reconstruct(const struct DNA_ReconstructInfo *reconstruct_info,
|
||||
int old_struct_index,
|
||||
int blocks,
|
||||
const void *old_blocks,
|
||||
const char *alloc_name);
|
||||
|
||||
/**
|
||||
* A version of #DNA_struct_member_offset_by_name_with_alias that uses the non-aliased name.
|
||||
* Always prefer aliased names where possible.
|
||||
*/
|
||||
int DNA_struct_member_offset_by_name_without_alias(const struct SDNA *sdna,
|
||||
const char *stype,
|
||||
const char *vartype,
|
||||
const char *name);
|
||||
/**
|
||||
* Returns the offset of the field with the specified name and type within the specified
|
||||
* struct type in #SDNA, -1 on failure.
|
||||
*/
|
||||
int DNA_struct_member_offset_by_name_with_alias(const struct SDNA *sdna,
|
||||
const char *stype,
|
||||
const char *vartype,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Returns the size of struct fields of the specified type and member_index.
|
||||
*
|
||||
* \param type: Index into sdna->types/types_size
|
||||
* \param member_index: Index into sdna->names, needed to extract possible pointer/array
|
||||
* information.
|
||||
*/
|
||||
int DNA_struct_member_size(const struct SDNA *sdna, short type, short member_index);
|
||||
|
||||
/**
|
||||
* Returns the size in bytes of a primitive type.
|
||||
*/
|
||||
int DNA_elem_type_size(eSDNA_Type elem_nr);
|
||||
|
||||
/**
|
||||
* Returns the size of a struct.
|
||||
*
|
||||
* \param struct_index: Index into the #sdna.structs array (aka #BHead.SDNAnr).
|
||||
*/
|
||||
int DNA_struct_size(const struct SDNA *sdna, int struct_index);
|
||||
|
||||
/**
|
||||
* Get the alignment that should be used when allocating memory for this type.
|
||||
*/
|
||||
int DNA_struct_alignment(const struct SDNA *sdna, int struct_index);
|
||||
|
||||
/**
|
||||
* Return the current (alias) type name of the given struct index.
|
||||
*/
|
||||
const char *DNA_struct_identifier(struct SDNA *sdna, int struct_index);
|
||||
|
||||
/**
|
||||
* Find the struct matching the given `old_type_name`, and rename its type (referenced by its
|
||||
* #SDNA_Struct.type_index) to the given `new_type_name`.
|
||||
*
|
||||
* WARNING: Deprecated, do not use in new code. Only used to version some renaming done during
|
||||
* early 2.80 development.
|
||||
*/
|
||||
bool DNA_sdna_patch_struct_by_name(struct SDNA *sdna,
|
||||
const char *old_type_name,
|
||||
const char *new_type_name);
|
||||
/**
|
||||
* Rename \a old_member_name with \a new_member_name for struct matching \a type_name.
|
||||
*
|
||||
* Handles search & replace, maintaining surrounding non-identifier characters such as pointer &
|
||||
* array size.
|
||||
*
|
||||
* WARNING: Deprecated, do not use in new code. Only used to version some renaming done during
|
||||
* early 2.80 development.
|
||||
*/
|
||||
bool DNA_sdna_patch_struct_member_by_name(struct SDNA *sdna,
|
||||
const char *type_name,
|
||||
const char *old_member_name,
|
||||
const char *new_member_name);
|
||||
|
||||
void DNA_sdna_alias_data_ensure(struct SDNA *sdna);
|
||||
|
||||
/**
|
||||
* Separated from #DNA_sdna_alias_data_ensure because it's not needed
|
||||
* unless we want to lookup aliased struct names (#DNA_struct_find_with_alias and friends).
|
||||
*/
|
||||
void DNA_sdna_alias_data_ensure_structs_map(struct SDNA *sdna);
|
||||
|
||||
/* For versioning, avoid verbosity selecting between with/without alias versions of functions. */
|
||||
#ifdef DNA_GENFILE_VERSIONING_MACROS
|
||||
# define DNA_struct_exists(sdna, str) DNA_struct_exists_with_alias(sdna, str)
|
||||
# define DNA_struct_member_exists(sdna, stype, vartype, name) \
|
||||
DNA_struct_member_exists_with_alias(sdna, stype, vartype, name)
|
||||
#endif
|
||||
|
||||
} // namespace blender
|
||||
811
blender-5.2.0/source/blender/makesdna/DNA_gpencil_legacy_types.h
Normal file
811
blender-5.2.0/source/blender/makesdna/DNA_gpencil_legacy_types.h
Normal file
@@ -0,0 +1,811 @@
|
||||
/* SPDX-FileCopyrightText: 2008 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct MDeformVert;
|
||||
struct tGPspoint;
|
||||
|
||||
/** #bGPDspoint.flag */
|
||||
enum eGPDspoint_Flag : int {
|
||||
/* stroke point is selected (for editing) */
|
||||
GP_SPOINT_SELECT = (1 << 0),
|
||||
|
||||
/* stroke point is tagged (for some editing operation) */
|
||||
GP_SPOINT_TAG = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDspoint_Flag)
|
||||
|
||||
/** #bGPDpalettecolor.flag */
|
||||
enum eGPDpalettecolor_Flag : short {
|
||||
/* color is active */
|
||||
/* PC_COLOR_ACTIVE = (1 << 0), */ /* UNUSED */
|
||||
/* don't display color */
|
||||
PC_COLOR_HIDE = (1 << 1),
|
||||
/* protected from further editing */
|
||||
PC_COLOR_LOCKED = (1 << 2),
|
||||
/* do onion skinning */
|
||||
PC_COLOR_ONIONSKIN = (1 << 3),
|
||||
/* "volumetric" strokes */
|
||||
PC_COLOR_VOLUMETRIC = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDpalettecolor_Flag)
|
||||
|
||||
/** #bGPDpalette.flag */
|
||||
enum eGPDpalette_Flag : short {
|
||||
/* palette is active */
|
||||
PL_PALETTE_ACTIVE = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDpalette_Flag)
|
||||
|
||||
/* bGPDcurve_point->flag */
|
||||
enum eGPDcurve_point_Flag : int {
|
||||
GP_CURVE_POINT_SELECT = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDcurve_point_Flag)
|
||||
|
||||
/* bGPDcurve_Flag->flag */
|
||||
enum bGPDcurve_Flag : short {
|
||||
/* Flag to indicated that the stroke data has been changed and the curve needs to be refitted */
|
||||
GP_CURVE_NEEDS_STROKE_UPDATE = (1 << 0),
|
||||
/* Curve is selected */
|
||||
GP_CURVE_SELECT = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(bGPDcurve_Flag)
|
||||
|
||||
/** #bGPDstroke.flag */
|
||||
enum eGPDstroke_Flag : short {
|
||||
/* stroke is in 3d-space */
|
||||
GP_STROKE_3DSPACE = (1 << 0),
|
||||
/* stroke is in 2d-space */
|
||||
GP_STROKE_2DSPACE = (1 << 1),
|
||||
/* stroke is in 2d-space (but with special 'image' scaling) */
|
||||
GP_STROKE_2DIMAGE = (1 << 2),
|
||||
/* stroke is selected */
|
||||
GP_STROKE_SELECT = (1 << 3),
|
||||
/* Flag used to indicate that stroke is closed and draw edge between last and first point */
|
||||
GP_STROKE_CYCLIC = (1 << 7),
|
||||
/* Flag used to indicate that stroke is used for fill close and must use
|
||||
* fill color for stroke and no fill area */
|
||||
GP_STROKE_NOFILL = (1 << 8),
|
||||
/* Flag to indicated that the editcurve has been changed and the stroke needs to be updated with
|
||||
* the curve data */
|
||||
GP_STROKE_NEEDS_CURVE_UPDATE = (1 << 9),
|
||||
/* Flag to indicate that a stroke is used only for help, and will not affect rendering or fill */
|
||||
GP_STROKE_HELP = (1 << 10),
|
||||
/* Flag to indicate that a extend stroke collide (fill tool). */
|
||||
GP_STROKE_COLLIDE = (1 << 11),
|
||||
/* only for use with stroke-buffer (while drawing arrows) */
|
||||
GP_STROKE_USE_ARROW_START = (1 << 12),
|
||||
/* only for use with stroke-buffer (while drawing arrows) */
|
||||
GP_STROKE_USE_ARROW_END = (1 << 13),
|
||||
/* Tag for update geometry */
|
||||
GP_STROKE_TAG = (1 << 14),
|
||||
/* only for use with stroke-buffer (while drawing eraser) */
|
||||
GP_STROKE_ERASER = static_cast<short>(1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDstroke_Flag)
|
||||
|
||||
/** #bGPDstroke.caps */
|
||||
enum eGPDstroke_Caps : short {
|
||||
/* type of extreme */
|
||||
GP_STROKE_CAP_ROUND = 0,
|
||||
GP_STROKE_CAP_FLAT = 1,
|
||||
|
||||
/* Keep last. */
|
||||
GP_STROKE_CAP_MAX,
|
||||
};
|
||||
|
||||
/** #bGPDataRuntime.arrowstyle */
|
||||
enum eGPDstroke_Arrowstyle : int {
|
||||
GP_STROKE_ARROWSTYLE_NONE = 0,
|
||||
GP_STROKE_ARROWSTYLE_SEGMENT = 2,
|
||||
GP_STROKE_ARROWSTYLE_OPEN = 3,
|
||||
GP_STROKE_ARROWSTYLE_CLOSED = 4,
|
||||
GP_STROKE_ARROWSTYLE_SQUARE = 6,
|
||||
};
|
||||
|
||||
/* bGPDframe->flag */
|
||||
enum eGPDframe_Flag : short {
|
||||
/* frame is being painted on */
|
||||
GP_FRAME_PAINT = (1 << 0),
|
||||
/* for editing in Action Editor */
|
||||
GP_FRAME_SELECT = (1 << 1),
|
||||
/* Line Art generation */
|
||||
GP_FRAME_LRT_CLEARED = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDframe_Flag)
|
||||
|
||||
/* bGPDlayer_Mask->flag */
|
||||
enum ebGPDlayer_Mask_Flag : short {
|
||||
/* Mask is hidden. */
|
||||
GP_MASK_HIDE = (1 << 0),
|
||||
/* Mask is inverted. */
|
||||
GP_MASK_INVERT = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(ebGPDlayer_Mask_Flag)
|
||||
|
||||
/* bGPDlayer->flag */
|
||||
enum eGPDlayer_Flag : short {
|
||||
/* don't display layer */
|
||||
GP_LAYER_HIDE = (1 << 0),
|
||||
/* protected from further editing */
|
||||
GP_LAYER_LOCKED = (1 << 1),
|
||||
/* layer is 'active' layer being edited */
|
||||
GP_LAYER_ACTIVE = (1 << 2),
|
||||
/* draw points of stroke for debugging purposes */
|
||||
GP_LAYER_DRAWDEBUG = (1 << 3),
|
||||
/* Flag used to display in Paint mode only layers with keyframe */
|
||||
GP_LAYER_SOLO_MODE = (1 << 4),
|
||||
/* for editing in Action Editor */
|
||||
GP_LAYER_SELECT = (1 << 5),
|
||||
/* current frame for layer can't be changed */
|
||||
GP_LAYER_FRAMELOCK = (1 << 6),
|
||||
/* Don't render X-ray (which is default). */
|
||||
GP_LAYER_NO_XRAY = (1 << 7),
|
||||
/* "volumetric" strokes */
|
||||
GP_LAYER_VOLUMETRIC = (1 << 10),
|
||||
/* Use Scene lights */
|
||||
GP_LAYER_USE_LIGHTS = (1 << 11),
|
||||
/* Unlock color */
|
||||
GP_LAYER_UNLOCK_COLOR = (1 << 12),
|
||||
/* Mask Layer */
|
||||
GP_LAYER_USE_MASK = (1 << 13), /* TODO: DEPRECATED */
|
||||
/* Ruler Layer */
|
||||
GP_LAYER_IS_RULER = (1 << 14),
|
||||
/* Disable masks in view-layer render */
|
||||
GP_LAYER_DISABLE_MASKS_IN_VIEWLAYER = static_cast<short>(1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDlayer_Flag)
|
||||
|
||||
/** #bGPDlayer.onion_flag */
|
||||
enum eGPDlayer_OnionFlag : short {
|
||||
/* do onion skinning */
|
||||
GP_LAYER_ONIONSKIN = (1 << 0),
|
||||
GP_LAYER_ONIONSKIN_CUSTOM_COLOR = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eGPDlayer_OnionFlag)
|
||||
|
||||
/** #bGPDlayer.blend_mode */
|
||||
enum eGPLayerBlendModes : int {
|
||||
eGplBlendMode_Regular = 0,
|
||||
eGplBlendMode_HardLight = 1,
|
||||
eGplBlendMode_Add = 2,
|
||||
eGplBlendMode_Subtract = 3,
|
||||
eGplBlendMode_Multiply = 4,
|
||||
eGplBlendMode_Divide = 5,
|
||||
};
|
||||
|
||||
/**
|
||||
* #bGPdata.flag
|
||||
*
|
||||
* NOTE: A few flags have been deprecated since early 2.5,
|
||||
* since they have been made redundant by interaction
|
||||
* changes made during the porting process.
|
||||
*/
|
||||
enum eGPdata_Flag : int {
|
||||
/* data-block is used for "annotations"
|
||||
* NOTE: This flag used to be used in 2.4x, but should hardly ever have been set.
|
||||
* We can use this freely now, as all GP data-blocks from pre-2.8 will get
|
||||
* set on file load (as many old use cases are for "annotations" only)
|
||||
*/
|
||||
GP_DATA_ANNOTATIONS = (1 << 0),
|
||||
|
||||
/* show debugging info in viewport (i.e. status print) */
|
||||
GP_DATA_DISPINFO = (1 << 1),
|
||||
/* in Action Editor, show as expanded channel */
|
||||
GP_DATA_EXPAND = (1 << 2),
|
||||
|
||||
/* is the block overriding all clicks? */
|
||||
/* GP_DATA_EDITPAINT = (1 << 3), */
|
||||
|
||||
/* ------------------------------------------------ DEPRECATED */
|
||||
/* new strokes are added in viewport space */
|
||||
GP_DATA_VIEWALIGN = (1 << 4),
|
||||
|
||||
/* Project into the screen's Z values */
|
||||
GP_DATA_DEPTH_VIEW = (1 << 5),
|
||||
GP_DATA_DEPTH_STROKE = (1 << 6),
|
||||
|
||||
GP_DATA_DEPTH_STROKE_ENDPOINTS = (1 << 7),
|
||||
/* ------------------------------------------------ DEPRECATED */
|
||||
|
||||
/* Stroke Editing Mode - Toggle to enable alternative keymap
|
||||
* for easier editing of stroke points */
|
||||
GP_DATA_STROKE_EDITMODE = (1 << 8),
|
||||
|
||||
/* Main flag to switch onion skinning on/off */
|
||||
GP_DATA_SHOW_ONIONSKINS = (1 << 9),
|
||||
|
||||
/* Batch drawing cache need to be recalculated */
|
||||
GP_DATA_CACHE_IS_DIRTY = (1 << 11),
|
||||
|
||||
/* Stroke Paint Mode - Toggle paint mode */
|
||||
GP_DATA_STROKE_PAINTMODE = (1 << 12),
|
||||
/* Stroke Editing Mode - Toggle sculpt mode */
|
||||
GP_DATA_STROKE_SCULPTMODE = (1 << 13),
|
||||
/* Stroke Editing Mode - Toggle weight paint mode */
|
||||
GP_DATA_STROKE_WEIGHTMODE = (1 << 14),
|
||||
|
||||
/* keep stroke thickness unchanged when zoom change */
|
||||
GP_DATA_STROKE_KEEPTHICKNESS = (1 << 15),
|
||||
|
||||
/* Allow edit several frames at the same time */
|
||||
GP_DATA_STROKE_MULTIEDIT = (1 << 16),
|
||||
|
||||
/* Vertex Paint Mode - Toggle paint mode */
|
||||
GP_DATA_STROKE_VERTEXMODE = (1 << 18),
|
||||
|
||||
/* Auto-lock not active layers. */
|
||||
GP_DATA_AUTOLOCK_LAYERS = (1 << 20),
|
||||
|
||||
/* Enable Bezier Editing Curve (a sub-mode of Edit mode). */
|
||||
GP_DATA_CURVE_EDIT_MODE = (1 << 21),
|
||||
/* Use adaptive curve resolution */
|
||||
GP_DATA_CURVE_ADAPTIVE_RESOLUTION = (1 << 22),
|
||||
};
|
||||
ENUM_OPERATORS(eGPdata_Flag)
|
||||
|
||||
/* gpd->onion_flag */
|
||||
enum eGPD_OnionFlag : int {
|
||||
/* use custom color for ghosts before current frame */
|
||||
GP_ONION_GHOST_PREVCOL = (1 << 0),
|
||||
/* use custom color for ghosts after current frame */
|
||||
GP_ONION_GHOST_NEXTCOL = (1 << 1),
|
||||
/* always show onion skins (i.e. even during renders/animation playback) */
|
||||
GP_ONION_GHOST_ALWAYS = (1 << 2),
|
||||
/* use fade color in onion skin */
|
||||
GP_ONION_FADE = (1 << 3),
|
||||
/* Loop showing first frame after last frame */
|
||||
GP_ONION_LOOP = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eGPD_OnionFlag)
|
||||
|
||||
/* gpd->onion_mode */
|
||||
enum eGP_OnionModes : int {
|
||||
GP_ONION_MODE_ABSOLUTE = 0,
|
||||
GP_ONION_MODE_RELATIVE = 1,
|
||||
GP_ONION_MODE_SELECTED = 2,
|
||||
};
|
||||
|
||||
/* draw modes (Use 2D or 3D position) */
|
||||
enum eGP_DrawMode : short {
|
||||
GP_DRAWMODE_2D = 0,
|
||||
GP_DRAWMODE_3D = 1,
|
||||
};
|
||||
|
||||
#define GP_DEFAULT_PIX_FACTOR 1.0f
|
||||
#define GP_DEFAULT_GRID_LINES 4
|
||||
#define GP_MAX_INPUT_SAMPLES 10
|
||||
|
||||
#define GP_DEFAULT_CURVE_RESOLUTION 32
|
||||
#define GP_DEFAULT_CURVE_ERROR 0.1f
|
||||
#define GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE M_PI_2
|
||||
|
||||
#define GPENCIL_MIN_FILL_FAC 0.05f
|
||||
#define GPENCIL_MAX_FILL_FAC 8.0f
|
||||
|
||||
/**
|
||||
* Grease-Pencil Annotations - 'Stroke Point'
|
||||
* -> Coordinates may either be 2d or 3d depending on settings at the time
|
||||
* -> Coordinates of point on stroke, in proportions of window size
|
||||
* This assumes that the bottom-left corner is (0,0)
|
||||
*/
|
||||
struct bGPDspoint {
|
||||
/** Co-ordinates of point (usually 2d, but can be 3d as well). */
|
||||
float x = 0, y = 0, z = 0;
|
||||
/** Pressure of input device (from 0 to 1) at this point. */
|
||||
float pressure = 0;
|
||||
/** Color strength (used for alpha factor). */
|
||||
float strength = 0;
|
||||
/** Seconds since start of stroke. */
|
||||
float time = 0;
|
||||
/** Additional options. */
|
||||
eGPDspoint_Flag flag = {};
|
||||
|
||||
/** Factor of uv along the stroke. */
|
||||
float uv_fac = 0;
|
||||
/** UV rotation for dot mode. */
|
||||
float uv_rot = 0;
|
||||
/** UV for fill mode */
|
||||
float uv_fill[2] = {};
|
||||
|
||||
/** Vertex Color RGBA (A=mix factor). */
|
||||
float vert_color[4] = {};
|
||||
|
||||
char _pad2[4] = {};
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Fill - Triangle Tessellation Data */
|
||||
|
||||
/* Grease-Pencil Annotations - 'Triangle'
|
||||
* -> A triangle contains the index of three vertices for filling the stroke
|
||||
* This is only used if high quality fill is enabled
|
||||
*/
|
||||
struct bGPDtriangle {
|
||||
/* indices for tessellated triangle used for GP Fill */
|
||||
unsigned int verts[3] = {};
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Palettes (Deprecated - 2.78 - 2.79 only) */
|
||||
|
||||
/* color of palettes */
|
||||
struct bGPDpalettecolor {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDpalettecolor)
|
||||
|
||||
struct bGPDpalettecolor *next = nullptr, *prev = nullptr;
|
||||
/** Color name. Must be unique. */
|
||||
char info[64] = "";
|
||||
float color[4] = {};
|
||||
/** Color that should be used for drawing "fills" for strokes. */
|
||||
float fill[4] = {};
|
||||
/** Settings for palette color. */
|
||||
eGPDpalettecolor_Flag flag = {};
|
||||
/** Padding for compiler alignment error. */
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
/* palette of colors */
|
||||
struct bGPDpalette {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDpalette)
|
||||
|
||||
struct bGPDpalette *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Pointer to individual colors. */
|
||||
ListBaseT<bGPDpalettecolor> colors = {nullptr, nullptr};
|
||||
/** Palette name. Must be unique. */
|
||||
char info[64] = "";
|
||||
|
||||
eGPDpalette_Flag flag = {};
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Curve Point */
|
||||
|
||||
struct bGPDcurve_point {
|
||||
/** Bezier Triple for the handles and control points. */
|
||||
BezTriple bezt = {};
|
||||
/** Pressure of input device (from 0 to 1) at this point. */
|
||||
float pressure = 0;
|
||||
/** Color strength (used for alpha factor). */
|
||||
float strength = 0;
|
||||
/** Index of corresponding point in gps->points. */
|
||||
int point_index = 0;
|
||||
|
||||
/** Additional options. */
|
||||
eGPDcurve_point_Flag flag = {};
|
||||
|
||||
/** Factor of uv along the stroke. */
|
||||
float uv_fac = 0;
|
||||
/** UV rotation for dot mode. */
|
||||
float uv_rot = 0;
|
||||
/** UV for fill mode. */
|
||||
float uv_fill[2] = {};
|
||||
|
||||
/** Vertex Color RGBA (A=mix factor). */
|
||||
float vert_color[4] = {};
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Curve */
|
||||
|
||||
/* Curve for Bezier Editing. */
|
||||
struct bGPDcurve {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDcurve)
|
||||
|
||||
/** Array of BezTriple. */
|
||||
bGPDcurve_point *curve_points = nullptr;
|
||||
/** Total number of curve points. */
|
||||
int tot_curve_points = 0;
|
||||
/** General flag. */
|
||||
bGPDcurve_Flag flag = {};
|
||||
char _pad[2] = {};
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Strokes */
|
||||
|
||||
/* Runtime temp data for bGPDstroke */
|
||||
struct bGPDstroke_Runtime {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDstroke_Runtime)
|
||||
|
||||
/** temporary layer name only used during copy/paste to put the stroke in the original layer */
|
||||
char tmp_layerinfo[128] = "";
|
||||
|
||||
/** Runtime falloff factor (only for transform). */
|
||||
float multi_frame_falloff = 0;
|
||||
|
||||
/** Triangle offset in the IBO where this stroke starts. */
|
||||
int stroke_start = 0;
|
||||
/** Triangle offset in the IBO where this fill starts. */
|
||||
int fill_start = 0;
|
||||
/** Vertex offset in the VBO where this stroke starts. */
|
||||
int vertex_start = 0;
|
||||
/** Curve Handles offset in the IBO where this handle starts. */
|
||||
int curve_start = 0;
|
||||
int _pad0 = {};
|
||||
|
||||
/** Original stroke (used to dereference evaluated data) */
|
||||
struct bGPDstroke *gps_orig = nullptr;
|
||||
void *_pad2 = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Grease-Pencil Annotations - 'Stroke'
|
||||
* -> A stroke represents a (simplified version) of the curve
|
||||
* drawn by the user in one 'mouse-down'->'mouse-up' operation
|
||||
*/
|
||||
struct bGPDstroke {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDstroke)
|
||||
|
||||
struct bGPDstroke *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Array of data-points for stroke. */
|
||||
bGPDspoint *points = nullptr;
|
||||
/** Tessellated triangles for GP Fill. */
|
||||
bGPDtriangle *triangles = nullptr;
|
||||
/** Number of data-points in array. */
|
||||
int totpoints = 0;
|
||||
/** Number of triangles in array. */
|
||||
int tot_triangles = 0;
|
||||
|
||||
/** Thickness of stroke. */
|
||||
short thickness = 0;
|
||||
/** Various settings about this stroke. */
|
||||
eGPDstroke_Flag flag = {};
|
||||
short _pad[2] = {};
|
||||
|
||||
/** Init time of stroke. */
|
||||
double inittime = 0;
|
||||
|
||||
/** Color name. */
|
||||
DNA_DEPRECATED char colorname[128] = "";
|
||||
|
||||
/** Material index. */
|
||||
int mat_nr = 0;
|
||||
/** Caps mode for each stroke extreme */
|
||||
eGPDstroke_Caps caps[2] = {};
|
||||
|
||||
/** gradient control along y for color */
|
||||
float hardness = 0;
|
||||
/** factor xy of shape for dots gradients */
|
||||
float aspect_ratio[2] = {};
|
||||
|
||||
/** Factor of opacity for Fill color (used by opacity modifier). */
|
||||
float fill_opacity_fac = 0;
|
||||
|
||||
/** UV rotation */
|
||||
float uv_rotation = 0;
|
||||
/** UV translation (X and Y axis) */
|
||||
float uv_translation[2] = {};
|
||||
float uv_scale = 0;
|
||||
|
||||
/** Stroke selection index. */
|
||||
int select_index = 0;
|
||||
char _pad4[4] = {};
|
||||
|
||||
/** Vertex weight data. */
|
||||
struct MDeformVert *dvert = nullptr;
|
||||
void *_pad3 = nullptr;
|
||||
|
||||
/** Vertex Color for Fill (one for all stroke, A=mix factor). */
|
||||
float vert_color_fill[4] = {};
|
||||
|
||||
/** Curve used to edit the stroke using Bezier handlers. */
|
||||
struct bGPDcurve *editcurve = nullptr;
|
||||
|
||||
bGPDstroke_Runtime runtime;
|
||||
void *_pad5 = nullptr;
|
||||
};
|
||||
|
||||
/* Arrows ----------------------- */
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Frame */
|
||||
|
||||
/* Runtime temp data for bGPDframe */
|
||||
struct bGPDframe_Runtime {
|
||||
/** Index of this frame in the listbase of frames. */
|
||||
int frameid = 0;
|
||||
/** Onion offset from active frame. 0 if not onion. INT_MAX to bypass frame. */
|
||||
int onion_id = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Grease-Pencil Annotations - 'Frame'
|
||||
* -> Acts as storage for the 'image' formed by strokes
|
||||
*/
|
||||
struct bGPDframe {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDframe)
|
||||
|
||||
struct bGPDframe *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** List of the simplified 'strokes' that make up the frame's data. */
|
||||
ListBaseT<bGPDstroke> strokes = {nullptr, nullptr};
|
||||
|
||||
/** Frame number of this frame. */
|
||||
int framenum = 0;
|
||||
|
||||
/** Temp settings. */
|
||||
eGPDframe_Flag flag = {};
|
||||
/** Keyframe type (eBezTriple_KeyframeType). */
|
||||
short key_type = 0;
|
||||
|
||||
bGPDframe_Runtime runtime;
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Layer */
|
||||
|
||||
/* List of masking layers. */
|
||||
struct bGPDlayer_Mask {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDlayer_Mask)
|
||||
|
||||
struct bGPDlayer_Mask *next = nullptr, *prev = nullptr;
|
||||
char name[128] = "";
|
||||
ebGPDlayer_Mask_Flag flag = {};
|
||||
/** Index for sorting. Only valid while sorting algorithm is running. */
|
||||
short sort_index = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/** Runtime temp data for #bGPDlayer. */
|
||||
struct bGPDlayer_Runtime {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDlayer_Runtime)
|
||||
|
||||
/** Id for dynamic icon used to show annotation color preview for layer. */
|
||||
int icon_id = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/** Grease-Pencil Annotations - 'Layer'. */
|
||||
struct bGPDlayer {
|
||||
DNA_DEFINE_CXX_METHODS(bGPDlayer)
|
||||
|
||||
struct bGPDlayer *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** List of annotations to display for frames (bGPDframe list). */
|
||||
ListBaseT<bGPDframe> frames = {nullptr, nullptr};
|
||||
/** Active frame (should be the frame that is currently being displayed). */
|
||||
bGPDframe *actframe = nullptr;
|
||||
|
||||
/** Settings for layer. */
|
||||
eGPDlayer_Flag flag = {};
|
||||
/** Per-layer onion-skinning flags. */
|
||||
eGPDlayer_OnionFlag onion_flag = {};
|
||||
|
||||
/** Color for strokes in layers. Used for annotations, and for ruler
|
||||
* (which uses GPencil internally). */
|
||||
float color[4] = {};
|
||||
/** Fill color for strokes in layers. Not used anymore (was only for). */
|
||||
float fill[4] = {};
|
||||
|
||||
/** Name/reference info for this layer (i.e. "director's comments, 12/.3")
|
||||
* needs to be kept unique, as it's used as the layer identifier */
|
||||
char info[128] = "";
|
||||
|
||||
/** Thickness to apply to strokes (Annotations). */
|
||||
short thickness = 0;
|
||||
/** Used to filter groups of layers in modifiers. */
|
||||
short pass_index = 0;
|
||||
|
||||
/** Parent object. */
|
||||
struct Object *parent = nullptr;
|
||||
/** Inverse matrix (only used if parented). */
|
||||
float inverse[4][4] = {};
|
||||
/** String describing sub-object info. */
|
||||
char parsubstr[/*MAX_NAME*/ 64] = "";
|
||||
short partype = 0;
|
||||
|
||||
/** Thickness adjustment. */
|
||||
short line_change = 0;
|
||||
/** Color used to tint layer, alpha value is used as factor. */
|
||||
float tintcolor[4] = {};
|
||||
/** Opacity of the layer. */
|
||||
float opacity = 0;
|
||||
/** Name of the layer used to filter render output. */
|
||||
char viewlayername[64] = "";
|
||||
|
||||
/** Blend modes. */
|
||||
eGPLayerBlendModes blend_mode = eGplBlendMode_Regular;
|
||||
/** Vertex Paint opacity by Layer. */
|
||||
float vertex_paint_opacity = 0;
|
||||
|
||||
/* annotation onion skin */
|
||||
/**
|
||||
* Ghosts Before: max number of ghost frames to show between
|
||||
* active frame and the one before it (0 = only the ghost itself).
|
||||
*/
|
||||
short gstep = 0;
|
||||
/**
|
||||
* Ghosts After: max number of ghost frames to show after
|
||||
* active frame and the following it (0 = only the ghost itself).
|
||||
*/
|
||||
short gstep_next = 0;
|
||||
|
||||
/** Color for ghosts before the active frame. */
|
||||
float gcolor_prev[3] = {0.302f, 0.851f, 0.302f};
|
||||
/** Color for ghosts after the active frame. */
|
||||
float gcolor_next[3] = {0.250f, 0.1f, 1.0f};
|
||||
char _pad1[4] = {};
|
||||
|
||||
/** Mask list (bGPDlayer_Mask). */
|
||||
ListBaseT<bGPDlayer_Mask> mask_layers = {nullptr, nullptr};
|
||||
/** Current Mask index (noted base 1). */
|
||||
int act_mask = 0;
|
||||
char _pad2[4] = {};
|
||||
|
||||
/** Layer transforms. */
|
||||
float location[3] = {}, rotation[3] = {}, scale[3] = {};
|
||||
float layer_mat[4][4] = {}, layer_invmat[4][4] = {};
|
||||
char _pad3[4] = {};
|
||||
|
||||
bGPDlayer_Runtime runtime;
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* GP Datablock */
|
||||
|
||||
/* Runtime temp data for bGPdata */
|
||||
struct bGPdata_Runtime {
|
||||
DNA_DEFINE_CXX_METHODS(bGPdata_Runtime)
|
||||
|
||||
/** Stroke buffer. */
|
||||
tGPspoint *sbuffer = nullptr;
|
||||
|
||||
/** Animation playing flag. */
|
||||
short playing = 0;
|
||||
|
||||
/** Material index of the stroke. */
|
||||
short matid = 0;
|
||||
|
||||
/* Stroke Buffer data (only used during paint-session)
|
||||
* - buffer must be initialized before use, but freed after
|
||||
* whole paint operation is over
|
||||
*/
|
||||
/** Flags for stroke that cache represents. */
|
||||
eGPDstroke_Flag sbuffer_sflag = eGPDstroke_Flag{};
|
||||
char _pad1[2] = {};
|
||||
/** Number of elements currently used in cache. */
|
||||
int sbuffer_used = 0;
|
||||
/** Number of total elements available in cache. */
|
||||
int sbuffer_size = 0;
|
||||
|
||||
/** Vertex Color applied to Fill (while drawing). */
|
||||
float vert_color_fill[4] = {};
|
||||
|
||||
/** Opacity for fills while drawing. */
|
||||
float fill_opacity_fac = 0;
|
||||
|
||||
/** Arrow points for stroke corners. */
|
||||
float arrow_start[8] = {};
|
||||
float arrow_end[8] = {};
|
||||
/* Arrow style for each corner */
|
||||
eGPDstroke_Arrowstyle arrow_start_style = GP_STROKE_ARROWSTYLE_NONE;
|
||||
eGPDstroke_Arrowstyle arrow_end_style = GP_STROKE_ARROWSTYLE_NONE;
|
||||
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* grid configuration */
|
||||
struct bGPgrid {
|
||||
float color[3] = {};
|
||||
float scale[2] = {};
|
||||
float offset[2] = {};
|
||||
char _pad1[4] = {};
|
||||
|
||||
int lines = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/** Grease-Pencil Annotations - 'DataBlock'. */
|
||||
struct bGPdata {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(bGPdata)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_GD_LEGACY;
|
||||
#endif
|
||||
|
||||
/** Grease Pencil data is a data-block. */
|
||||
ID id;
|
||||
/** Animation data - for animating draw settings. */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/* Grease-Pencil data */
|
||||
/** bGPDlayer. */
|
||||
ListBaseT<bGPDlayer> layers = {nullptr, nullptr};
|
||||
/** Settings for this data-block. */
|
||||
eGPdata_Flag flag = {};
|
||||
/** Default resolution for generated curves using curve editing method. */
|
||||
int curve_edit_resolution = 0;
|
||||
/** Curve Editing error threshold. */
|
||||
float curve_edit_threshold = 0;
|
||||
/** Curve Editing corner angle (less or equal is treated as corner). */
|
||||
float curve_edit_corner_angle = 0;
|
||||
|
||||
/* Palettes */
|
||||
/** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */
|
||||
ListBaseT<bGPDpalette> palettes = {nullptr, nullptr};
|
||||
|
||||
/** List of bDeformGroup names and flag only. */
|
||||
ListBaseT<bDeformGroup> vertex_group_names = {nullptr, nullptr};
|
||||
|
||||
/* 3D Viewport/Appearance Settings */
|
||||
/** Factor to define pixel size conversion. */
|
||||
float pixfactor = 0;
|
||||
/** Color for edit line. */
|
||||
float line_color[4] = {};
|
||||
|
||||
/* Onion skinning */
|
||||
/** Onion alpha factor change. */
|
||||
float onion_factor = 0;
|
||||
/** Onion skinning range. */
|
||||
eGP_OnionModes onion_mode = GP_ONION_MODE_ABSOLUTE;
|
||||
/** Onion skinning flags. */
|
||||
eGPD_OnionFlag onion_flag = {};
|
||||
/**
|
||||
* Ghosts Before: max number of ghost frames to show between
|
||||
* active frame and the one before it (0 = only the ghost itself).
|
||||
*/
|
||||
short gstep = 0;
|
||||
/**
|
||||
* Ghosts After: max number of ghost frames to show after
|
||||
* active frame and the following it (0 = only the ghost itself).
|
||||
*/
|
||||
short gstep_next = 0;
|
||||
|
||||
/** Optional color for ghosts before the active frame. */
|
||||
float gcolor_prev[3] = {};
|
||||
/** Optional color for ghosts after the active frame. */
|
||||
float gcolor_next[3] = {};
|
||||
|
||||
/** Offset for drawing over surfaces to keep strokes on top. */
|
||||
float zdepth_offset = 0;
|
||||
/** Materials array. */
|
||||
struct Material **mat = nullptr;
|
||||
/** Total materials. */
|
||||
short totcol = 0;
|
||||
|
||||
/* stats */
|
||||
short totlayer = 0;
|
||||
short totframe = 0;
|
||||
char _pad2[6] = {};
|
||||
int totstroke = 0;
|
||||
int totpoint = 0;
|
||||
|
||||
/** Draw mode for strokes. */
|
||||
eGP_DrawMode draw_mode = GP_DRAWMODE_2D;
|
||||
/** Keyframe type for onion filter (eBezTriple_KeyframeType plus All option) */
|
||||
short onion_keytype = 0;
|
||||
|
||||
/** Stroke selection last index. Used to generate a unique selection index. */
|
||||
int select_last_index = 0;
|
||||
|
||||
int vertex_group_active_index = 0;
|
||||
|
||||
bGPgrid grid;
|
||||
|
||||
bGPdata_Runtime runtime;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
1260
blender-5.2.0/source/blender/makesdna/DNA_gpencil_modifier_types.h
Normal file
1260
blender-5.2.0/source/blender/makesdna/DNA_gpencil_modifier_types.h
Normal file
File diff suppressed because it is too large
Load Diff
27
blender-5.2.0/source/blender/makesdna/DNA_gpu_types.h
Normal file
27
blender-5.2.0/source/blender/makesdna/DNA_gpu_types.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* Keep for 'Camera' versioning. */
|
||||
/** Properties for DOF effect. */
|
||||
struct GPUDOFSettings {
|
||||
/** Focal distance for depth of field. */
|
||||
float focus_distance = 0;
|
||||
float fstop = 0;
|
||||
float focal_length = 0;
|
||||
float sensor = 0;
|
||||
float rotation = 0;
|
||||
float ratio = 0;
|
||||
int num_blades = 0;
|
||||
int high_quality = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
745
blender-5.2.0/source/blender/makesdna/DNA_grease_pencil_types.h
Normal file
745
blender-5.2.0/source/blender/makesdna/DNA_grease_pencil_types.h
Normal file
@@ -0,0 +1,745 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_attribute_types.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_curves_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_bounds_types.hh"
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_index_mask_fwd.hh"
|
||||
#include "BLI_map.hh"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
#include "BLI_memory_counter_fwd.hh"
|
||||
#include "BLI_span.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
class AttributeAccessor;
|
||||
class MutableAttributeAccessor;
|
||||
class GreasePencilRuntime;
|
||||
class GreasePencilDrawingRuntime;
|
||||
namespace greasepencil {
|
||||
class DrawingRuntime;
|
||||
class Drawing;
|
||||
class DrawingReference;
|
||||
class TreeNode;
|
||||
class Layer;
|
||||
class LayerMask;
|
||||
class LayerRuntime;
|
||||
class LayerGroup;
|
||||
class LayerGroupRuntime;
|
||||
} // namespace greasepencil
|
||||
} // namespace bke
|
||||
|
||||
struct Main;
|
||||
struct GreasePencil;
|
||||
struct Object;
|
||||
|
||||
enum GreasePencilStrokeCapType : int8_t {
|
||||
GP_STROKE_CAP_TYPE_ROUND = 0,
|
||||
GP_STROKE_CAP_TYPE_FLAT = 1,
|
||||
/* Keep last. */
|
||||
GP_STROKE_CAP_TYPE_MAX,
|
||||
};
|
||||
|
||||
#define GP_STROKE_MITER_ANGLE_ROUND 0.0f
|
||||
#define GP_STROKE_MITER_ANGLE_BEVEL DEG2RADF(180.0f)
|
||||
|
||||
/**
|
||||
* Type of drawing data.
|
||||
* If `GP_DRAWING` the node is a `GreasePencilDrawing`,
|
||||
* if `GP_DRAWING_REFERENCE` the node is a `GreasePencilDrawingReference`.
|
||||
*/
|
||||
enum GreasePencilDrawingType : int8_t {
|
||||
GP_DRAWING = 0,
|
||||
GP_DRAWING_REFERENCE = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* Flag for drawings and drawing references. #GreasePencilDrawingBase.flag
|
||||
*/
|
||||
enum GreasePencilDrawingBaseFlag : uint32_t {
|
||||
/* TODO */
|
||||
GreasePencilDrawingBaseFlag_TODO
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilDrawingBaseFlag)
|
||||
|
||||
/**
|
||||
* Flag for grease pencil frames. #GreasePencilFrame.flag
|
||||
*/
|
||||
enum GreasePencilFrameFlag : uint32_t {
|
||||
GP_FRAME_SELECTED = (1 << 0),
|
||||
/* When set, the frame is implicitly held until the next frame. E.g. it doesn't have a fixed
|
||||
* duration. */
|
||||
GP_FRAME_IMPLICIT_HOLD = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilFrameFlag)
|
||||
|
||||
enum GreasePencilLayerFramesMapStorageFlag : int {
|
||||
GP_LAYER_FRAMES_STORAGE_DIRTY = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilLayerFramesMapStorageFlag)
|
||||
|
||||
/**
|
||||
* Flag for layer masks. #GreasePencilLayerMask.flag
|
||||
*/
|
||||
enum GreasePencilLayerMaskFlag : uint16_t {
|
||||
GP_LAYER_MASK_HIDE = (1 << 0),
|
||||
GP_LAYER_MASK_INVERT = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilLayerMaskFlag)
|
||||
|
||||
/**
|
||||
* Layer blending modes. #GreasePencilLayer.blend_mode
|
||||
*/
|
||||
enum GreasePencilLayerBlendMode : int8_t {
|
||||
GP_LAYER_BLEND_NONE = 0,
|
||||
GP_LAYER_BLEND_HARDLIGHT = 1,
|
||||
GP_LAYER_BLEND_ADD = 2,
|
||||
GP_LAYER_BLEND_SUBTRACT = 3,
|
||||
GP_LAYER_BLEND_MULTIPLY = 4,
|
||||
GP_LAYER_BLEND_DIVIDE = 5,
|
||||
};
|
||||
|
||||
/**
|
||||
* Type of layer node.
|
||||
* If `GP_LAYER_TREE_LEAF` the node is a `GreasePencilLayerTreeLeaf`,
|
||||
* if `GP_LAYER_TREE_GROUP` the node is a `GreasePencilLayerTreeGroup`.
|
||||
*/
|
||||
enum GreasePencilLayerTreeNodeType : int8_t {
|
||||
GP_LAYER_TREE_LEAF = 0,
|
||||
GP_LAYER_TREE_GROUP = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* Flags for layer tree nodes. #GreasePencilLayerTreeNode.flag
|
||||
*/
|
||||
enum GreasePencilLayerTreeNodeFlag : uint32_t {
|
||||
GP_LAYER_TREE_NODE_HIDE = (1 << 0),
|
||||
GP_LAYER_TREE_NODE_LOCKED = (1 << 1),
|
||||
GP_LAYER_TREE_NODE_SELECT = (1 << 2),
|
||||
GP_LAYER_TREE_NODE_MUTE = (1 << 3),
|
||||
GP_LAYER_TREE_NODE_USE_LIGHTS = (1 << 4),
|
||||
GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING = (1 << 5),
|
||||
GP_LAYER_TREE_NODE_EXPANDED = (1 << 6),
|
||||
GP_LAYER_TREE_NODE_HIDE_MASKS = (1 << 7),
|
||||
GP_LAYER_TREE_NODE_DISABLE_MASKS_IN_VIEWLAYER = (1 << 8),
|
||||
GP_LAYER_TREE_NODE_IGNORE_LOCKED_MATERIALS = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilLayerTreeNodeFlag)
|
||||
|
||||
enum GroupColorTag : int8_t {
|
||||
LAYERGROUP_COLOR_NONE = -1,
|
||||
LAYERGROUP_COLOR_01,
|
||||
LAYERGROUP_COLOR_02,
|
||||
LAYERGROUP_COLOR_03,
|
||||
LAYERGROUP_COLOR_04,
|
||||
LAYERGROUP_COLOR_05,
|
||||
LAYERGROUP_COLOR_06,
|
||||
LAYERGROUP_COLOR_07,
|
||||
LAYERGROUP_COLOR_08,
|
||||
};
|
||||
|
||||
/**
|
||||
* Flag for the grease pencil data-block. #GreasePencil.flag
|
||||
*/
|
||||
enum GreasePencilFlag : uint32_t {
|
||||
GREASE_PENCIL_ANIM_CHANNEL_EXPANDED = (1 << 0),
|
||||
GREASE_PENCIL_AUTOLOCK_LAYERS = (1 << 1),
|
||||
GREASE_PENCIL_STROKE_ORDER_3D = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilFlag)
|
||||
|
||||
/**
|
||||
* Onion skinning mode. #GreasePencilOnionSkinningSettings.mode
|
||||
*/
|
||||
enum GreasePencilOnionSkinningMode : int8_t {
|
||||
GP_ONION_SKINNING_MODE_ABSOLUTE = 0,
|
||||
GP_ONION_SKINNING_MODE_RELATIVE = 1,
|
||||
GP_ONION_SKINNING_MODE_SELECTED = 2,
|
||||
};
|
||||
|
||||
enum GreasePencilOnionSkinningFlag : uint8_t {
|
||||
/* Use custom colors (per object-data) for onion skinning. */
|
||||
GP_ONION_SKINNING_USE_CUSTOM_COLORS = (1 << 0),
|
||||
/* Fade the opacity of ghost frames further away from the current frame. */
|
||||
GP_ONION_SKINNING_USE_FADE = (1 << 1),
|
||||
/* Show looping frames in onion skinning. */
|
||||
GP_ONION_SKINNING_SHOW_LOOP = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilOnionSkinningFlag)
|
||||
|
||||
/**
|
||||
* Flag for filtering the onion skinning per keyframe type.
|
||||
* #GreasePencilOnionSkinningSettings.filter
|
||||
* \note needs to match order of `eBezTriple_KeyframeType`.
|
||||
*/
|
||||
enum GreasePencilOnionSkinningFilter : uint8_t {
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_KEYFRAME = (1 << 0),
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_EXTREME = (1 << 1),
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_BREAKDOWN = (1 << 2),
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_JITTER = (1 << 3),
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_MOVEHOLD = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(GreasePencilOnionSkinningFilter)
|
||||
|
||||
#define GREASE_PENCIL_ONION_SKINNING_FILTER_ALL \
|
||||
(GP_ONION_SKINNING_FILTER_KEYTYPE_KEYFRAME | GP_ONION_SKINNING_FILTER_KEYTYPE_EXTREME | \
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_BREAKDOWN | GP_ONION_SKINNING_FILTER_KEYTYPE_JITTER | \
|
||||
GP_ONION_SKINNING_FILTER_KEYTYPE_MOVEHOLD)
|
||||
|
||||
/**
|
||||
* Base class for drawings and drawing references (drawings from other objects).
|
||||
*/
|
||||
struct GreasePencilDrawingBase {
|
||||
/**
|
||||
* Indicates if this is an actual drawing or a drawing referenced from another object.
|
||||
*/
|
||||
GreasePencilDrawingType type = GP_DRAWING;
|
||||
char _pad[3] = {};
|
||||
/**
|
||||
* Flag. Used to set e.g. the selection status.
|
||||
*/
|
||||
GreasePencilDrawingBaseFlag flag = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* A grease pencil drawing is a set of strokes. The data is stored using the `CurvesGeometry` data
|
||||
* structure and the custom attributes within it.
|
||||
*/
|
||||
struct GreasePencilDrawing {
|
||||
GreasePencilDrawingBase base;
|
||||
/**
|
||||
* The stroke data for this drawing.
|
||||
*/
|
||||
CurvesGeometry geometry;
|
||||
/**
|
||||
* Runtime data on the drawing.
|
||||
*/
|
||||
bke::greasepencil::DrawingRuntime *runtime = nullptr;
|
||||
#ifdef __cplusplus
|
||||
bke::greasepencil::Drawing &wrap();
|
||||
const bke::greasepencil::Drawing &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct GreasePencilDrawingReference {
|
||||
GreasePencilDrawingBase base;
|
||||
/**
|
||||
* A reference to another GreasePencil data-block.
|
||||
* If the data-block has multiple drawings, this drawing references all of them sequentially.
|
||||
* See the note in `GreasePencilLayer->frames()` for a detailed explanation of this.
|
||||
*/
|
||||
struct GreasePencil *id_reference = nullptr;
|
||||
#ifdef __cplusplus
|
||||
bke::greasepencil::DrawingReference &wrap();
|
||||
const bke::greasepencil::DrawingReference &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* A GreasePencilFrame is a single keyframe in the timeline.
|
||||
* It references a drawing by index into the drawing array.
|
||||
*/
|
||||
struct GreasePencilFrame {
|
||||
/**
|
||||
* Index into the GreasePencil->drawings array.
|
||||
*/
|
||||
int drawing_index = 0;
|
||||
/**
|
||||
* Flag. Used to set e.g. the selection.
|
||||
*/
|
||||
GreasePencilFrameFlag flag = {};
|
||||
/**
|
||||
* Keyframe type. See `eBezTriple_KeyframeType`.
|
||||
*/
|
||||
int8_t type = 0;
|
||||
char _pad[3] = {};
|
||||
#ifdef __cplusplus
|
||||
static GreasePencilFrame end();
|
||||
bool is_end() const;
|
||||
bool is_implicit_hold() const;
|
||||
bool is_selected() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Storage for the Map in `bke::greasepencil::Layer`.
|
||||
* See the description there for more detail.
|
||||
*/
|
||||
struct GreasePencilLayerFramesMapStorage {
|
||||
/* Array of `frames` keys (sorted in ascending order). */
|
||||
int *keys = nullptr;
|
||||
/* Array of `frames` values (order matches the keys array). */
|
||||
GreasePencilFrame *values = nullptr;
|
||||
/* Size of the map (number of key-value pairs). */
|
||||
int num = 0;
|
||||
/* Flag for the status of the storage. */
|
||||
GreasePencilLayerFramesMapStorageFlag flag = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* A grease pencil layer mask stores the name of a layer that is the mask.
|
||||
*/
|
||||
struct GreasePencilLayerMask {
|
||||
struct GreasePencilLayerMask *next = nullptr, *prev = nullptr;
|
||||
/**
|
||||
* The name of the layer that is the mask.
|
||||
*/
|
||||
char *layer_name = nullptr;
|
||||
/**
|
||||
* Layer mask flag.
|
||||
*/
|
||||
GreasePencilLayerMaskFlag flag = {};
|
||||
char _pad[6] = {};
|
||||
#ifdef __cplusplus
|
||||
bke::greasepencil::LayerMask &wrap();
|
||||
const bke::greasepencil::LayerMask &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct GreasePencilLayerTreeGroup;
|
||||
struct GreasePencilLayerTreeNode {
|
||||
/* ListBaseT pointers. */
|
||||
struct GreasePencilLayerTreeNode *next = nullptr, *prev = nullptr;
|
||||
/* Parent pointer. Can be null. */
|
||||
struct GreasePencilLayerTreeGroup *parent = nullptr;
|
||||
/**
|
||||
* Name of the layer/group. Dynamic length.
|
||||
*/
|
||||
char *name = nullptr;
|
||||
/**
|
||||
* Indicates the type of struct this element is.
|
||||
*/
|
||||
GreasePencilLayerTreeNodeType type = GP_LAYER_TREE_LEAF;
|
||||
char _pad[7] = {};
|
||||
/**
|
||||
* Channel color for dope-sheet.
|
||||
*/
|
||||
float color[3] = {};
|
||||
/**
|
||||
* Flag. Used to set e.g. the selection, visibility, ... status.
|
||||
*/
|
||||
GreasePencilLayerTreeNodeFlag flag = {};
|
||||
#ifdef __cplusplus
|
||||
bke::greasepencil::TreeNode &wrap();
|
||||
const bke::greasepencil::TreeNode &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* A grease pencil layer is a collection of drawings mapped to a specific time on the timeline.
|
||||
*/
|
||||
struct GreasePencilLayer {
|
||||
GreasePencilLayerTreeNode base;
|
||||
/* Only used for storage in the .blend file. */
|
||||
GreasePencilLayerFramesMapStorage frames_storage;
|
||||
/**
|
||||
* Layer blend mode.
|
||||
*/
|
||||
GreasePencilLayerBlendMode blend_mode = GP_LAYER_BLEND_NONE;
|
||||
char _pad[3] = {};
|
||||
/**
|
||||
* Opacity of the layer.
|
||||
*/
|
||||
float opacity = 0;
|
||||
ListBaseT<GreasePencilLayerMask> masks = {nullptr, nullptr};
|
||||
int active_mask_index = 0;
|
||||
char _pad2[4] = {};
|
||||
/**
|
||||
* Layer parent object. Can be an armature in which case the `parsubstr` is the bone name.
|
||||
*/
|
||||
struct Object *parent = nullptr;
|
||||
char *parsubstr = nullptr;
|
||||
/**
|
||||
* Stores the inverse of the parent during parenting to keep the layer in its position.
|
||||
* Also referred to as the "keep transform" parenting elsewhere.
|
||||
*/
|
||||
float parentinv[4][4] = {};
|
||||
/**
|
||||
* Layer transform UI settings. These should *not* be used to do any computation.
|
||||
* Use the functions is the `bke::greasepencil::Layer` class instead.
|
||||
*/
|
||||
float translation[3] = {}, rotation[3] = {}, scale[3] = {1.0f, 1.0f, 1.0f};
|
||||
char _pad3[4] = {};
|
||||
/** Name of the view layer used to filter render output. */
|
||||
char *viewlayername = nullptr;
|
||||
/**
|
||||
* Runtime struct pointer.
|
||||
*/
|
||||
bke::greasepencil::LayerRuntime *runtime = nullptr;
|
||||
#ifdef __cplusplus
|
||||
bke::greasepencil::Layer &wrap();
|
||||
const bke::greasepencil::Layer &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct GreasePencilLayerTreeGroup {
|
||||
GreasePencilLayerTreeNode base;
|
||||
ListBaseT<GreasePencilLayerTreeNode> children = {nullptr, nullptr};
|
||||
/**
|
||||
* Icon color tag.
|
||||
*/
|
||||
GroupColorTag color_tag = LAYERGROUP_COLOR_01;
|
||||
char _pad[7] = {};
|
||||
/**
|
||||
* Runtime struct pointer.
|
||||
*/
|
||||
bke::greasepencil::LayerGroupRuntime *runtime = nullptr;
|
||||
#ifdef __cplusplus
|
||||
bke::greasepencil::LayerGroup &wrap();
|
||||
const bke::greasepencil::LayerGroup &wrap() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Per data-block Grease Pencil onion skinning settings.
|
||||
*/
|
||||
struct GreasePencilOnionSkinningSettings {
|
||||
/**
|
||||
* Opacity for the ghost frames.
|
||||
*/
|
||||
float opacity = 0.5f;
|
||||
GreasePencilOnionSkinningMode mode = GP_ONION_SKINNING_MODE_RELATIVE;
|
||||
GreasePencilOnionSkinningFlag flag = (GP_ONION_SKINNING_USE_FADE |
|
||||
GP_ONION_SKINNING_USE_CUSTOM_COLORS);
|
||||
GreasePencilOnionSkinningFilter filter = GREASE_PENCIL_ONION_SKINNING_FILTER_ALL;
|
||||
char _pad[1] = {};
|
||||
/**
|
||||
* Number of ghost frames shown before.
|
||||
*/
|
||||
int16_t num_frames_before = 1;
|
||||
/**
|
||||
* Number of ghost frames shown after.
|
||||
*/
|
||||
int16_t num_frames_after = 1;
|
||||
/**
|
||||
* Color of the ghost frames before.
|
||||
*/
|
||||
float color_before[3] = {0.145098f, 0.419608f, 0.137255f};
|
||||
/**
|
||||
* Color of the ghost frames after.
|
||||
*/
|
||||
float color_after[3] = {0.125490f, 0.082353f, 0.529412f};
|
||||
char _pad2[4] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* The grease pencil data-block.
|
||||
*/
|
||||
struct GreasePencil {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_GP;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data. */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/**
|
||||
* An array of pointers to drawings. The drawing can own its data or reference it from another
|
||||
* data-block. Note that the order of this array is arbitrary. The mapping of drawings to frames
|
||||
* is done by the layers. See the `Layer` class in `BKE_grease_pencil.hh`.
|
||||
*/
|
||||
GreasePencilDrawingBase **drawing_array = nullptr;
|
||||
int drawing_array_num = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
/* Root group of the layer tree. */
|
||||
GreasePencilLayerTreeGroup *root_group_ptr = nullptr;
|
||||
|
||||
/** Used only for backward compatibility with old files. */
|
||||
CustomData layers_data_legacy;
|
||||
|
||||
/**
|
||||
* Layer domain attributes.
|
||||
*/
|
||||
struct AttributeStorage attribute_storage;
|
||||
|
||||
/**
|
||||
* The index of the active attribute in the UI.
|
||||
*
|
||||
* Set to -1 when none is active.
|
||||
*/
|
||||
int attributes_active_index = 0;
|
||||
char _pad2[4] = {};
|
||||
|
||||
/**
|
||||
* Pointer to the active node. Can be NULL.
|
||||
* This pointer does not own the data.
|
||||
*/
|
||||
GreasePencilLayerTreeNode *active_node = nullptr;
|
||||
|
||||
/**
|
||||
* An array of materials.
|
||||
*/
|
||||
struct Material **material_array = nullptr;
|
||||
short material_array_num = 0;
|
||||
char _pad3[2] = {};
|
||||
/**
|
||||
* Global flag on the data-block.
|
||||
*/
|
||||
GreasePencilFlag flag = GREASE_PENCIL_ANIM_CHANNEL_EXPANDED;
|
||||
|
||||
ListBaseT<bDeformGroup> vertex_group_names = {nullptr, nullptr};
|
||||
int vertex_group_active_index = 0;
|
||||
char _pad4[4] = {};
|
||||
|
||||
/**
|
||||
* Onion skinning settings.
|
||||
*/
|
||||
GreasePencilOnionSkinningSettings onion_skinning_settings;
|
||||
/**
|
||||
* Runtime struct pointer.
|
||||
*/
|
||||
bke::GreasePencilRuntime *runtime = nullptr;
|
||||
#ifdef __cplusplus
|
||||
/* Root group. */
|
||||
const bke::greasepencil::LayerGroup &root_group() const;
|
||||
bke::greasepencil::LayerGroup &root_group();
|
||||
|
||||
/* Drawings read/write access. */
|
||||
Span<const GreasePencilDrawingBase *> drawings() const;
|
||||
MutableSpan<GreasePencilDrawingBase *> drawings();
|
||||
const GreasePencilDrawingBase *drawing(int64_t index) const;
|
||||
GreasePencilDrawingBase *drawing(int64_t index);
|
||||
|
||||
/* Layers, layer groups and nodes read/write access. */
|
||||
Span<const bke::greasepencil::Layer *> layers() const;
|
||||
Span<bke::greasepencil::Layer *> layers_for_write();
|
||||
const bke::greasepencil::Layer &layer(int64_t index) const;
|
||||
bke::greasepencil::Layer &layer(int64_t index);
|
||||
|
||||
Span<const bke::greasepencil::LayerGroup *> layer_groups() const;
|
||||
Span<bke::greasepencil::LayerGroup *> layer_groups_for_write();
|
||||
|
||||
Span<const bke::greasepencil::TreeNode *> nodes() const;
|
||||
Span<bke::greasepencil::TreeNode *> nodes_for_write();
|
||||
|
||||
/* Return the index of the layer if it's found, otherwise `std::nullopt`. */
|
||||
std::optional<int> get_layer_index(const bke::greasepencil::Layer &layer) const;
|
||||
|
||||
/* Active layer functions. */
|
||||
bool has_active_layer() const;
|
||||
const bke::greasepencil::Layer *get_active_layer() const;
|
||||
bke::greasepencil::Layer *get_active_layer();
|
||||
void set_active_layer(bke::greasepencil::Layer *layer);
|
||||
bool is_layer_active(const bke::greasepencil::Layer *layer) const;
|
||||
void autolock_inactive_layers();
|
||||
|
||||
/* Active group functions. */
|
||||
bool has_active_group() const;
|
||||
const bke::greasepencil::LayerGroup *get_active_group() const;
|
||||
bke::greasepencil::LayerGroup *get_active_group();
|
||||
|
||||
/* Active node functions. */
|
||||
const bke::greasepencil::TreeNode *get_active_node() const;
|
||||
bke::greasepencil::TreeNode *get_active_node();
|
||||
void set_active_node(bke::greasepencil::TreeNode *node);
|
||||
|
||||
/* Adding layers and layer groups. */
|
||||
/** Adds a new layer with the given name to the top of root group. */
|
||||
bke::greasepencil::Layer &add_layer(StringRef name, bool check_name_is_unique = true);
|
||||
/** Adds a new layer with the given name to the top of the given group. */
|
||||
bke::greasepencil::Layer &add_layer(bke::greasepencil::LayerGroup &parent_group,
|
||||
StringRef name,
|
||||
bool check_name_is_unique = true);
|
||||
/** Duplicates a layer from the same object to the top of the root group. */
|
||||
bke::greasepencil::Layer &duplicate_layer(const bke::greasepencil::Layer &duplicate_layer,
|
||||
bool duplicate_frames = false,
|
||||
bool duplicate_drawings = false);
|
||||
/** Duplicates a layer from the same object to the top of the given group. */
|
||||
bke::greasepencil::Layer &duplicate_layer(bke::greasepencil::LayerGroup &parent_group,
|
||||
const bke::greasepencil::Layer &duplicate_layer,
|
||||
bool duplicate_frames = false,
|
||||
bool duplicate_drawings = false);
|
||||
/** Add new layer group into the root group. */
|
||||
bke::greasepencil::LayerGroup &add_layer_group(StringRef name, bool check_name_is_unique = true);
|
||||
bke::greasepencil::LayerGroup &add_layer_group(bke::greasepencil::LayerGroup &parent_group,
|
||||
StringRef name,
|
||||
bool check_name_is_unique = true);
|
||||
|
||||
/**
|
||||
* Adds multiple layers with an empty name.
|
||||
* NOTE: Evaluated Grease Pencil geometry is allowed to have layers with the same name.
|
||||
*/
|
||||
void add_layers_for_eval(int num_new_layers);
|
||||
|
||||
/* Moving nodes. */
|
||||
void move_node_up(bke::greasepencil::TreeNode &node, int step = 1);
|
||||
void move_node_down(bke::greasepencil::TreeNode &node, int step = 1);
|
||||
void move_node_top(bke::greasepencil::TreeNode &node);
|
||||
void move_node_bottom(bke::greasepencil::TreeNode &node);
|
||||
|
||||
void move_node_after(bke::greasepencil::TreeNode &node,
|
||||
bke::greasepencil::TreeNode &target_node);
|
||||
void move_node_before(bke::greasepencil::TreeNode &node,
|
||||
bke::greasepencil::TreeNode &target_node);
|
||||
void move_node_into(bke::greasepencil::TreeNode &node,
|
||||
bke::greasepencil::LayerGroup &parent_group);
|
||||
|
||||
/* Search functions. */
|
||||
const bke::greasepencil::TreeNode *find_node_by_name(StringRef name) const;
|
||||
bke::greasepencil::TreeNode *find_node_by_name(StringRef name);
|
||||
IndexMask layer_selection_by_name(StringRef name, IndexMaskMemory &memory) const;
|
||||
|
||||
void rename_node(Main &bmain, bke::greasepencil::TreeNode &node, StringRef new_name);
|
||||
|
||||
void remove_layer(bke::greasepencil::Layer &layer);
|
||||
void remove_group(bke::greasepencil::LayerGroup &group, bool keep_children = false);
|
||||
|
||||
std::string unique_layer_name(StringRef name);
|
||||
|
||||
/* Frames API functions. */
|
||||
|
||||
/**
|
||||
* Insert a new keyframe in \a layer. If successful, this will also create a new drawing.
|
||||
*
|
||||
* \param frame_number: The frame number at which the keyframe is inserted (the start frame).
|
||||
* \param duration: Duration of the keyframe. If set to 0, then the keyframe is implicitly held
|
||||
* (until the next keyframe).
|
||||
* \param keytype: The keyframe type (used to render different colored keys).
|
||||
*
|
||||
* \returns A pointer to a drawing if the keyframe was inserted, otherwise nullptr.
|
||||
*/
|
||||
bke::greasepencil::Drawing *insert_frame(
|
||||
bke::greasepencil::Layer &layer,
|
||||
int frame_number,
|
||||
int duration = 0,
|
||||
eBezTriple_KeyframeType keytype = BEZT_KEYTYPE_KEYFRAME);
|
||||
|
||||
/**
|
||||
* Same as #insert_frame but insert a new keyframe in each layer in \a layers. This will also
|
||||
* create a new drawing for each of the created keyframes.
|
||||
*/
|
||||
void insert_frames(Span<bke::greasepencil::Layer *> layers,
|
||||
int frame_number,
|
||||
int duration = 0,
|
||||
eBezTriple_KeyframeType keytype = BEZT_KEYTYPE_KEYFRAME);
|
||||
/**
|
||||
* Removes all the frames with \a frame_numbers in the \a layer.
|
||||
* \returns true if any frame was removed.
|
||||
*/
|
||||
bool remove_frames(bke::greasepencil::Layer &layer, Span<int> frame_numbers);
|
||||
|
||||
void copy_frames_from_layer(bke::greasepencil::Layer &dst_layer,
|
||||
const GreasePencil &src_grease_pencil,
|
||||
const bke::greasepencil::Layer &src_layer,
|
||||
const std::optional<int> frame_select = std::nullopt);
|
||||
/**
|
||||
* Adds multiple layers each with its own empty drawing. This can be more efficient than adding
|
||||
* every layer and drawing one by one.
|
||||
*/
|
||||
void add_layers_with_empty_drawings_for_eval(int num);
|
||||
|
||||
/**
|
||||
* Low-level resizing of drawings array. Only allocates new entries in the array, no drawings are
|
||||
* created in case of size increase. In case of size decrease, the removed drawings are deleted.
|
||||
*/
|
||||
void resize_drawings(int new_num);
|
||||
/** Add `add_num` new empty geometry drawings. */
|
||||
void add_empty_drawings(int add_num);
|
||||
void add_duplicate_drawings(int duplicate_num, const bke::greasepencil::Drawing &drawing);
|
||||
bool insert_duplicate_frame(bke::greasepencil::Layer &layer,
|
||||
int src_frame_number,
|
||||
int dst_frame_number,
|
||||
bool do_instance);
|
||||
|
||||
/**
|
||||
* Move a set of frames in a \a layer.
|
||||
*
|
||||
* \param frame_number_destinations: describes all transformations that should be applied on the
|
||||
* frame keys.
|
||||
*
|
||||
* If a transformation overlaps another frames, the frame will be overwritten, and the
|
||||
* corresponding drawing may be removed, if it no longer has users.
|
||||
*/
|
||||
void move_frames(bke::greasepencil::Layer &layer,
|
||||
const Map<int, int> &frame_number_destinations);
|
||||
|
||||
/**
|
||||
* Moves and/or inserts duplicates of a set of frames in a \a layer.
|
||||
*
|
||||
* \param frame_number_destinations: describes all transformations that should be applied on the
|
||||
* frame keys.
|
||||
* \param duplicate_frames: the frames that should be duplicated instead of moved.
|
||||
* Keys of the map are the keys of the corresponding source frames.
|
||||
* Frames will be inserted at the key given by the map \a frame_number_destination.
|
||||
*
|
||||
* If a transformation overlaps another frames, the frame will be overwritten, and the
|
||||
* corresponding drawing may be removed, if it no longer has users.
|
||||
*/
|
||||
void move_duplicate_frames(bke::greasepencil::Layer &layer,
|
||||
const Map<int, int> &frame_number_destinations,
|
||||
const Map<int, GreasePencilFrame> &duplicate_frames);
|
||||
|
||||
/**
|
||||
* Removes all the drawings that have no users. Will free the drawing data and shrink the
|
||||
* drawings array.
|
||||
*/
|
||||
void remove_drawings_with_no_users();
|
||||
/**
|
||||
* Makes sure all the drawings that the layer points to have a user.
|
||||
*/
|
||||
void update_drawing_users_for_layer(const bke::greasepencil::Layer &layer);
|
||||
|
||||
/**
|
||||
* Returns a drawing on \a layer at frame \a frame_number or `nullptr` if no such
|
||||
* drawing exists.
|
||||
*/
|
||||
const bke::greasepencil::Drawing *get_drawing_at(const bke::greasepencil::Layer &layer,
|
||||
int frame_number) const;
|
||||
bke::greasepencil::Drawing *get_drawing_at(const bke::greasepencil::Layer &layer,
|
||||
int frame_number);
|
||||
/**
|
||||
* Returns an editable drawing on \a layer at frame \a frame_number or `nullptr` if no such
|
||||
* drawing exists.
|
||||
*/
|
||||
bke::greasepencil::Drawing *get_editable_drawing_at(const bke::greasepencil::Layer &layer,
|
||||
int frame_number);
|
||||
|
||||
/**
|
||||
* Returns a drawing on \a layer at the frame this grease pencil was evaluated at or `nullptr` if
|
||||
* no such drawing exists.
|
||||
*/
|
||||
const bke::greasepencil::Drawing *get_eval_drawing(const bke::greasepencil::Layer &layer) const;
|
||||
bke::greasepencil::Drawing *get_eval_drawing(const bke::greasepencil::Layer &layer);
|
||||
|
||||
std::optional<Bounds<float3>> bounds_min_max(int frame, bool use_radius = true) const;
|
||||
std::optional<Bounds<float3>> bounds_min_max_eval(bool use_radius = true) const;
|
||||
|
||||
bke::AttributeAccessor attributes() const;
|
||||
bke::MutableAttributeAccessor attributes_for_write();
|
||||
|
||||
/**
|
||||
* Get the largest material index used by all the drawings or `nullopt` if there are no drawings.
|
||||
*/
|
||||
std::optional<int> material_index_max() const;
|
||||
|
||||
void count_memory(MemoryCounter &memory) const;
|
||||
|
||||
/**
|
||||
* Compute the user counts of the drawings by iterating through the keyframes of all the layers
|
||||
* and counting the number of references to each drawing.
|
||||
*/
|
||||
Array<int> count_frame_users_for_drawings() const;
|
||||
|
||||
/* For debugging purposes. */
|
||||
void print_layer_tree();
|
||||
void validate_drawing_user_counts();
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
20
blender-5.2.0/source/blender/makesdna/DNA_image_enums.h
Normal file
20
blender-5.2.0/source/blender/makesdna/DNA_image_enums.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/* SPDX-FileCopyrightText: 2026 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace blender {
|
||||
|
||||
enum class ImColorMode : char {
|
||||
BW = 8,
|
||||
BW_A = 16,
|
||||
RGB = 24,
|
||||
RGBA = 32,
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
280
blender-5.2.0/source/blender/makesdna/DNA_image_types.h
Normal file
280
blender-5.2.0/source/blender/makesdna/DNA_image_types.h
Normal file
@@ -0,0 +1,280 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_color_types.h" /* for color management */
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_scene_enums.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
struct ImageRuntime;
|
||||
} // namespace bke
|
||||
|
||||
struct ImBufCache;
|
||||
struct MovieReader;
|
||||
struct PackedFile;
|
||||
struct RenderResult;
|
||||
struct Scene;
|
||||
|
||||
/** #ImageUser::flag */
|
||||
enum eImageUser_Flag : short {
|
||||
IMA_ANIM_ALWAYS = 1 << 0,
|
||||
IMA_SHOW_SEQUENCER_SCENE = 1 << 1,
|
||||
// IMA_UNUSED_2 = 1 << 2,
|
||||
IMA_NEED_FRAME_RECALC = 1 << 3,
|
||||
IMA_SHOW_STEREO = 1 << 4,
|
||||
// IMA_UNUSED_5 = 1 << 5,
|
||||
IMA_USER_FRAME_IN_RANGE = (1 << 10),
|
||||
};
|
||||
ENUM_OPERATORS(eImageUser_Flag)
|
||||
|
||||
/* Used to get the correct gpu texture from an Image datablock. */
|
||||
enum eGPUTextureTarget : int {
|
||||
TEXTARGET_2D = 0,
|
||||
TEXTARGET_2D_ARRAY = 1,
|
||||
TEXTARGET_TILE_MAPPING = 2,
|
||||
TEXTARGET_COUNT = 3,
|
||||
};
|
||||
|
||||
/** #Image.flag */
|
||||
enum eImage_Flag : int {
|
||||
IMA_HIGH_BITDEPTH = (1 << 0),
|
||||
IMA_FLAG_UNUSED_1 = (1 << 1), /* cleared */
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
IMA_DO_PREMUL = (1 << 2),
|
||||
#endif
|
||||
IMA_FLAG_UNUSED_4 = (1 << 4), /* cleared */
|
||||
IMA_NOCOLLECT = (1 << 5),
|
||||
IMA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
|
||||
IMA_OLD_PREMUL = (1 << 7),
|
||||
IMA_FLAG_UNUSED_8 = (1 << 8), /* cleared */
|
||||
IMA_USED_FOR_RENDER = (1 << 9),
|
||||
/** For image user, but these flags are mixed. */
|
||||
// IMA_USER_FRAME_IN_RANGE = (1 << 10),
|
||||
IMA_VIEW_AS_RENDER = (1 << 11),
|
||||
IMA_FLAG_UNUSED_12 = (1 << 12), /* cleared */
|
||||
IMA_DEINTERLACE = (1 << 13),
|
||||
IMA_USE_VIEWS = (1 << 14),
|
||||
IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */
|
||||
IMA_FLAG_UNUSED_16 = (1 << 16), /* cleared */
|
||||
/** Indicates that the image has autosave information */
|
||||
IMA_AUTOSAVE_TEMPPACK = (1 << 17),
|
||||
};
|
||||
ENUM_OPERATORS(eImage_Flag)
|
||||
|
||||
/** #Image.gpuflag */
|
||||
enum eImage_GPUFlag : int {
|
||||
/** All mipmap levels in OpenGL texture set? */
|
||||
IMA_GPU_MIPMAP_COMPLETE = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eImage_GPUFlag)
|
||||
|
||||
/* Image.source, where the image comes from */
|
||||
enum eImageSource : short {
|
||||
/* IMA_SRC_CHECK = 0, */ /* UNUSED */
|
||||
IMA_SRC_FILE = 1,
|
||||
IMA_SRC_SEQUENCE = 2,
|
||||
IMA_SRC_MOVIE = 3,
|
||||
IMA_SRC_GENERATED = 4,
|
||||
IMA_SRC_VIEWER = 5,
|
||||
IMA_SRC_TILED = 6,
|
||||
};
|
||||
|
||||
/* Image.type, how to handle or generate the image */
|
||||
enum eImageType : short {
|
||||
IMA_TYPE_IMAGE = 0,
|
||||
IMA_TYPE_MULTILAYER = 1,
|
||||
/* generated */
|
||||
IMA_TYPE_UV_TEST = 2,
|
||||
/* viewers */
|
||||
IMA_TYPE_R_RESULT = 4,
|
||||
IMA_TYPE_COMPOSITE = 5,
|
||||
};
|
||||
|
||||
/** #Image.gen_type */
|
||||
enum eImageGenType : char {
|
||||
IMA_GENTYPE_BLANK = 0,
|
||||
IMA_GENTYPE_GRID = 1,
|
||||
IMA_GENTYPE_GRID_COLOR = 2,
|
||||
};
|
||||
|
||||
/** Size of allocated string #RenderResult::text. */
|
||||
#define IMA_MAX_RENDER_TEXT_SIZE 512
|
||||
|
||||
/** #Image.gen_flag */
|
||||
enum eImage_GenFlag : char {
|
||||
IMA_GEN_FLOAT = (1 << 0),
|
||||
IMA_GEN_TILE = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eImage_GenFlag)
|
||||
|
||||
/** #Image.alpha_mode */
|
||||
enum eImageAlphaMode : char {
|
||||
IMA_ALPHA_STRAIGHT = 0,
|
||||
IMA_ALPHA_PREMUL = 1,
|
||||
IMA_ALPHA_CHANNEL_PACKED = 2,
|
||||
IMA_ALPHA_IGNORE = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* ImageUser is in Texture, in Nodes, Background Image, Image Window, ...
|
||||
* should be used in conjunction with an ID * to Image.
|
||||
*/
|
||||
struct ImageUser {
|
||||
/** To retrieve render result. */
|
||||
struct Scene *scene = nullptr;
|
||||
|
||||
/** Movies, sequences: current to display. */
|
||||
int framenr = 0;
|
||||
/** Total amount of frames to use. */
|
||||
int frames = 0;
|
||||
/** Offset within movie, start frame in global time. */
|
||||
int offset = 0, sfra = 0;
|
||||
/** Cyclic flag. */
|
||||
char cycl = 0;
|
||||
|
||||
/** Multiview current eye - for internal use of drawing routines. */
|
||||
char multiview_eye = 0;
|
||||
short pass = 0;
|
||||
|
||||
int tile = 0;
|
||||
|
||||
/** Listbase indices, for menu browsing or retrieve buffer. */
|
||||
short multi_index = 0, view = 0, layer = 0;
|
||||
eImageUser_Flag flag = {};
|
||||
};
|
||||
|
||||
struct ImageAnim {
|
||||
struct ImageAnim *next = nullptr, *prev = nullptr;
|
||||
struct MovieReader *anim = nullptr;
|
||||
};
|
||||
|
||||
struct ImageView {
|
||||
struct ImageView *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
};
|
||||
|
||||
struct ImagePackedFile {
|
||||
struct ImagePackedFile *next = nullptr, *prev = nullptr;
|
||||
struct PackedFile *packedfile = nullptr;
|
||||
|
||||
/* Which view and tile this ImagePackedFile represents. Normal images will use 0 and 1001
|
||||
* respectively when creating their ImagePackedFile. Must be provided for each packed image. */
|
||||
int view = 0;
|
||||
int tile_number = 0;
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
};
|
||||
|
||||
struct RenderSlot {
|
||||
struct RenderSlot *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
struct RenderResult *render = nullptr;
|
||||
};
|
||||
|
||||
struct ImageTile_Runtime {
|
||||
int tilearray_layer = 0;
|
||||
int _pad = {};
|
||||
int tilearray_offset[2] = {};
|
||||
int tilearray_size[2] = {};
|
||||
};
|
||||
|
||||
struct ImageTile {
|
||||
struct ImageTile *next = nullptr, *prev = nullptr;
|
||||
|
||||
struct ImageTile_Runtime runtime;
|
||||
|
||||
int tile_number = 0;
|
||||
|
||||
/* for generated images */
|
||||
int gen_x = 0, gen_y = 0;
|
||||
eImageGenType gen_type = IMA_GENTYPE_BLANK;
|
||||
eImage_GenFlag gen_flag = {};
|
||||
short gen_depth = 0;
|
||||
float gen_color[4] = {};
|
||||
|
||||
char label[64] = "";
|
||||
};
|
||||
|
||||
struct Image {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_IM;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** File path. */
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
/* sources from: */
|
||||
ListBaseT<ImageAnim> anims = {nullptr, nullptr};
|
||||
struct RenderResult *rr = nullptr;
|
||||
|
||||
ListBaseT<RenderSlot> renderslots = {nullptr, nullptr};
|
||||
short render_slot = 0, last_render_slot = 0;
|
||||
|
||||
eImage_Flag flag = {};
|
||||
eImageSource source = {};
|
||||
eImageType type = IMA_TYPE_IMAGE;
|
||||
int lastframe = 0;
|
||||
|
||||
/* Number of iterations to perform when extracting mask for uv seam fixing. */
|
||||
short seam_margin = 8;
|
||||
|
||||
char _pad2[6] = {};
|
||||
|
||||
/** Deprecated. */
|
||||
DNA_DEPRECATED struct PackedFile *packedfile = nullptr;
|
||||
ListBaseT<ImagePackedFile> packedfiles = {nullptr, nullptr};
|
||||
struct PreviewImage *preview = nullptr;
|
||||
|
||||
ListBaseT<ImagePackedFile> autosave_packedfiles = {nullptr, nullptr};
|
||||
|
||||
char _pad3[4] = {};
|
||||
|
||||
/* for generated images */
|
||||
DNA_DEPRECATED int gen_x = 1024;
|
||||
DNA_DEPRECATED int gen_y = 1024;
|
||||
DNA_DEPRECATED eImageGenType gen_type = IMA_GENTYPE_GRID;
|
||||
DNA_DEPRECATED eImage_GenFlag gen_flag = {};
|
||||
DNA_DEPRECATED short gen_depth = 0;
|
||||
DNA_DEPRECATED float gen_color[4] = {};
|
||||
|
||||
/* display aspect - for UV editing images resized for faster openGL display */
|
||||
float aspx = 1.0, aspy = 1.0;
|
||||
|
||||
/* color management */
|
||||
ColorManagedColorspaceSettings colorspace_settings;
|
||||
eImageAlphaMode alpha_mode = IMA_ALPHA_STRAIGHT;
|
||||
|
||||
char _pad = {};
|
||||
|
||||
/* Multiview */
|
||||
/** For viewer node stereoscopy. */
|
||||
char eye = 0;
|
||||
eImageFormat_ViewsFormat views_format = {};
|
||||
|
||||
/* ImageTile list for UDIMs. */
|
||||
int active_tile_index = 0;
|
||||
ListBaseT<ImageTile> tiles = {nullptr, nullptr};
|
||||
|
||||
ListBaseT<ImageView> views = {nullptr, nullptr};
|
||||
struct Stereo3dFormat *stereo3d_format = nullptr;
|
||||
|
||||
bke::ImageRuntime *runtime = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
157
blender-5.2.0/source/blender/makesdna/DNA_key_types.h
Normal file
157
blender-5.2.0/source/blender/makesdna/DNA_key_types.h
Normal file
@@ -0,0 +1,157 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
#pragma once
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* This file defines structures for Shape-Keys (not animation keyframes),
|
||||
* attached to Mesh, Curve and Lattice Data. Even though Key's are ID blocks they
|
||||
* aren't intended to be shared between multiple data blocks as with other ID types.
|
||||
*/
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
|
||||
/* Key::type: KeyBlocks are interpreted as... */
|
||||
enum ShapekeyContainerType : char {
|
||||
/* Sequential positions over time (using KeyBlock::pos and Key::ctime) */
|
||||
KEY_NORMAL = 0,
|
||||
|
||||
/* States to blend between (default) */
|
||||
KEY_RELATIVE = 1,
|
||||
};
|
||||
|
||||
/* Key::flag */
|
||||
enum ShapekeyContainerFlag : short {
|
||||
KEY_DS_EXPAND = 1,
|
||||
};
|
||||
ENUM_OPERATORS(ShapekeyContainerFlag)
|
||||
|
||||
/* The obvious name would be `KeyBlockType` but this enum is actually used in places outside of
|
||||
* Shape Keys (NURBS, particles, etc.). */
|
||||
enum KeyInterpolationType : short {
|
||||
KEY_LINEAR = 0,
|
||||
KEY_CARDINAL = 1,
|
||||
KEY_BSPLINE = 2,
|
||||
KEY_CATMULL_ROM = 3,
|
||||
};
|
||||
|
||||
enum KeyBlockFlag : short {
|
||||
KEYBLOCK_MUTE = (1 << 0),
|
||||
KEYBLOCK_SEL = (1 << 1),
|
||||
KEYBLOCK_LOCKED = (1 << 2),
|
||||
KEYBLOCK_LOCKED_SHAPE = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(KeyBlockFlag)
|
||||
|
||||
#define KEYELEM_FLOAT_LEN_COORD 3
|
||||
|
||||
/* Curve key data layout constants */
|
||||
#define KEYELEM_ELEM_SIZE_CURVE 3
|
||||
|
||||
#define KEYELEM_ELEM_LEN_BPOINT 2
|
||||
#define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
|
||||
|
||||
#define KEYELEM_ELEM_LEN_BEZTRIPLE 4
|
||||
#define KEYELEM_FLOAT_LEN_BEZTRIPLE (KEYELEM_ELEM_LEN_BEZTRIPLE * KEYELEM_ELEM_SIZE_CURVE)
|
||||
|
||||
/**
|
||||
* The struct that holds the data for an individual Shape Key. Depending on which object owns the
|
||||
* `Key`, the contained data type can vary (see `void *data;`).
|
||||
*/
|
||||
struct KeyBlock {
|
||||
struct KeyBlock *next = nullptr, *prev = nullptr;
|
||||
|
||||
/**
|
||||
* A point in time used in case of `(Key::type == KEY_NORMAL)` only,
|
||||
* for historic reasons this is relative to (Key::ctime / 100),
|
||||
* so this value increments by 0.1f per frame.
|
||||
*/
|
||||
float pos = 0;
|
||||
/** Influence (typically [0 - 1] but can be more), `(Key::type == KEY_RELATIVE)` only. */
|
||||
float curval = 0;
|
||||
|
||||
/** Interpolation type. Used for `(Key::type == KEY_NORMAL)` only. */
|
||||
KeyInterpolationType type = KEY_LINEAR;
|
||||
char _pad1[2] = {};
|
||||
|
||||
/** `relative == 0` means first key is reference, otherwise the index of Key::blocks. */
|
||||
short relative = 0;
|
||||
KeyBlockFlag flag = {};
|
||||
|
||||
/** Total number of items in the keyblock (compare with mesh/curve verts to check we match). */
|
||||
int totelem = 0;
|
||||
/** For meshes only, match the unique number with the customdata layer. */
|
||||
int uid = 0;
|
||||
|
||||
/** Array of shape key values, size is `(Key::elemsize * KeyBlock->totelem)`.
|
||||
* E.g. meshes use float3. */
|
||||
void *data = nullptr;
|
||||
/** Unique name, user assigned. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
/** Optional vertex group, array gets allocated into 'weights' when set. */
|
||||
char vgroup[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
|
||||
/** Ranges, for RNA and UI only to clamp 'curval'. */
|
||||
float slidermin = 0;
|
||||
float slidermax = 0;
|
||||
};
|
||||
|
||||
struct Key {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_KE;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/**
|
||||
* Commonly called 'Basis', `(Key::type == KEY_RELATIVE)` only.
|
||||
* Looks like this is _always_ 'key->block.first',
|
||||
* perhaps later on it could be defined as some other KeyBlock - campbell.
|
||||
*/
|
||||
KeyBlock *refkey = nullptr;
|
||||
|
||||
/**
|
||||
* This is not a regular string, although it is \0 terminated
|
||||
* this is an array of (element_array_size, element_type) pairs
|
||||
* (each one char) used for calculating shape key-blocks. */
|
||||
char elemstr[32] = "";
|
||||
/** Size of each element in #KeyBlock.data, use for allocation and stride. */
|
||||
int elemsize = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
/** A list of KeyBlock's. */
|
||||
ListBaseT<KeyBlock> block = {nullptr, nullptr};
|
||||
|
||||
ID *from = nullptr;
|
||||
|
||||
/** (totkey == key->block.count()). */
|
||||
int totkey = 0;
|
||||
ShapekeyContainerFlag flag = {};
|
||||
/** Absolute or relative shape key. */
|
||||
ShapekeyContainerType type = KEY_NORMAL;
|
||||
char _pad2 = {};
|
||||
|
||||
/** Only used when (Key::type == KEY_NORMAL), this value is used as a time slider,
|
||||
* rather than using the scene's time, this value can be animated to give greater control */
|
||||
float ctime = 0;
|
||||
|
||||
/**
|
||||
* Can never be 0, this is used for detecting old data.
|
||||
* current free UID for key-blocks.
|
||||
*/
|
||||
int uidgen = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
93
blender-5.2.0/source/blender/makesdna/DNA_lattice_types.h
Normal file
93
blender-5.2.0/source/blender/makesdna/DNA_lattice_types.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_key_types.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct BPoint;
|
||||
struct Key;
|
||||
struct MDeformVert;
|
||||
|
||||
namespace draw {
|
||||
struct LatticeBatchCache;
|
||||
}
|
||||
|
||||
/** #Lattice::flag */
|
||||
enum eLattice_Flag : short {
|
||||
LT_GRID = 1 << 0,
|
||||
LT_OUTSIDE = 1 << 1,
|
||||
|
||||
LT_DS_EXPAND = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eLattice_Flag)
|
||||
|
||||
#define LT_ACTBP_NONE -1
|
||||
|
||||
#
|
||||
#
|
||||
struct EditLatt {
|
||||
DNA_DEFINE_CXX_METHODS(EditLatt)
|
||||
|
||||
struct Lattice *latt = nullptr;
|
||||
|
||||
int shapenr = 0;
|
||||
|
||||
/**
|
||||
* ID data is older than edit-mode data.
|
||||
* Set #Main.is_memfile_undo_flush_needed when enabling.
|
||||
*/
|
||||
char needs_flush_to_id = 0;
|
||||
};
|
||||
|
||||
struct Lattice {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Lattice)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_LT;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
short pntsu = 0, pntsv = 0, pntsw = 0;
|
||||
eLattice_Flag flag = LT_GRID;
|
||||
short opntsu = 0, opntsv = 0, opntsw = 0;
|
||||
char _pad2[3] = {};
|
||||
/* KeyInterpolationType */
|
||||
char typeu = KEY_BSPLINE, typev = KEY_BSPLINE, typew = KEY_BSPLINE;
|
||||
/** Active element index, unset with LT_ACTBP_NONE. */
|
||||
int actbp = LT_ACTBP_NONE;
|
||||
|
||||
float fu = 0, fv = 0, fw = 0, du = 0, dv = 0, dw = 0;
|
||||
|
||||
struct BPoint *def = nullptr;
|
||||
|
||||
struct Key *key = nullptr;
|
||||
|
||||
struct MDeformVert *dvert = nullptr;
|
||||
/** Multiply the influence. */
|
||||
char vgroup[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
/** List of bDeformGroup names and flag only. */
|
||||
ListBaseT<struct bDeformGroup> vertex_group_names = {nullptr, nullptr};
|
||||
int vertex_group_active_index = 0;
|
||||
|
||||
char _pad0[4] = {};
|
||||
|
||||
struct EditLatt *editlatt = nullptr;
|
||||
draw::LatticeBatchCache *batch_cache = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
289
blender-5.2.0/source/blender/makesdna/DNA_layer_types.h
Normal file
289
blender-5.2.0/source/blender/makesdna/DNA_layer_types.h
Normal file
@@ -0,0 +1,289 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_freestyle_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_scene_enums.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_map.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct Base;
|
||||
struct Object;
|
||||
|
||||
using ObjectBasesMap = Map<const Object *, Base *>;
|
||||
|
||||
/**
|
||||
* Render-passes for EEVEE.
|
||||
* #ViewLayerEEVEE.render_passes
|
||||
*/
|
||||
enum eViewLayerEEVEEPassType : int {
|
||||
EEVEE_RENDER_PASS_COMBINED = (1 << 0),
|
||||
EEVEE_RENDER_PASS_DEPTH = (1 << 1),
|
||||
EEVEE_RENDER_PASS_MIST = (1 << 2),
|
||||
EEVEE_RENDER_PASS_NORMAL = (1 << 3),
|
||||
EEVEE_RENDER_PASS_DIFFUSE_LIGHT = (1 << 4),
|
||||
EEVEE_RENDER_PASS_DIFFUSE_COLOR = (1 << 5),
|
||||
EEVEE_RENDER_PASS_SPECULAR_LIGHT = (1 << 6),
|
||||
EEVEE_RENDER_PASS_SPECULAR_COLOR = (1 << 7),
|
||||
EEVEE_RENDER_PASS_UNUSED_8 = (1 << 8),
|
||||
EEVEE_RENDER_PASS_VOLUME_LIGHT = (1 << 9),
|
||||
EEVEE_RENDER_PASS_EMIT = (1 << 10),
|
||||
EEVEE_RENDER_PASS_ENVIRONMENT = (1 << 11),
|
||||
EEVEE_RENDER_PASS_SHADOW = (1 << 12),
|
||||
EEVEE_RENDER_PASS_AO = (1 << 13),
|
||||
EEVEE_RENDER_PASS_UNUSED_14 = (1 << 14), /* EEVEE_RENDER_PASS_BLOOM */
|
||||
EEVEE_RENDER_PASS_AOV = (1 << 15),
|
||||
/*
|
||||
* TODO(@jbakker): Clean up conflicting bits after EEVEE has been removed.
|
||||
* #EEVEE_RENDER_PASS_CRYPTOMATTE is for EEVEE, `EEVEE_RENDER_PASS_CRYTPOMATTE_*` are for
|
||||
* EEVEE-Next.
|
||||
*/
|
||||
EEVEE_RENDER_PASS_CRYPTOMATTE = (1 << 16),
|
||||
EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT = (1 << 16),
|
||||
EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET = (1 << 17),
|
||||
EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL = (1 << 18),
|
||||
EEVEE_RENDER_PASS_VECTOR = (1 << 19),
|
||||
EEVEE_RENDER_PASS_TRANSPARENT = (1 << 20),
|
||||
EEVEE_RENDER_PASS_POSITION = (1 << 21),
|
||||
};
|
||||
#define EEVEE_RENDER_PASS_MAX_BIT 21
|
||||
ENUM_OPERATORS(eViewLayerEEVEEPassType)
|
||||
|
||||
/* #ViewLayer::grease_pencil_flags */
|
||||
enum eViewLayerGreasePencilFlags : int {
|
||||
GREASE_PENCIL_AS_SEPARATE_PASS = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eViewLayerGreasePencilFlags)
|
||||
|
||||
/* #ViewLayerAOV.type */
|
||||
enum eViewLayerAOVType : int {
|
||||
AOV_TYPE_VALUE = 0,
|
||||
AOV_TYPE_COLOR = 1,
|
||||
};
|
||||
|
||||
/* #ViewLayerAOV.flag */
|
||||
enum eViewLayerAOVFlag : int {
|
||||
AOV_CONFLICT = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eViewLayerAOVFlag)
|
||||
|
||||
/* #ViewLayer.cryptomatte_flag */
|
||||
enum eViewLayerCryptomatteFlags : short {
|
||||
VIEW_LAYER_CRYPTOMATTE_OBJECT = (1 << 0),
|
||||
VIEW_LAYER_CRYPTOMATTE_MATERIAL = (1 << 1),
|
||||
VIEW_LAYER_CRYPTOMATTE_ASSET = (1 << 2),
|
||||
VIEW_LAYER_CRYPTOMATTE_ACCURATE = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eViewLayerCryptomatteFlags)
|
||||
#define VIEW_LAYER_CRYPTOMATTE_ALL \
|
||||
(VIEW_LAYER_CRYPTOMATTE_OBJECT | VIEW_LAYER_CRYPTOMATTE_MATERIAL | VIEW_LAYER_CRYPTOMATTE_ASSET)
|
||||
|
||||
/* Base->flag */
|
||||
enum eBase_Flag : short {
|
||||
/* User controlled flags. */
|
||||
BASE_SELECTED = (1 << 0), /* Object is selected. */
|
||||
BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
|
||||
|
||||
/* Runtime evaluated flags. */
|
||||
|
||||
/* Object is enabled and potentially visible in a viewport. Layer collection
|
||||
* visibility, local collection visibility, and local view are not part of this
|
||||
* and may cause the object to be hidden depending on the 3D viewport settings.
|
||||
*
|
||||
* Objects with this flag will be considered visible by the viewport depsgraph
|
||||
* and be evaluated as a result.
|
||||
*
|
||||
* This implies BASE_ENABLED_VIEWPORT. */
|
||||
BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT = (1 << 1),
|
||||
|
||||
/* Object can be selected. */
|
||||
BASE_SELECTABLE = (1 << 2),
|
||||
|
||||
/* Object comes from a duplicator. */
|
||||
BASE_FROM_DUPLI = (1 << 3),
|
||||
|
||||
/* Object is enabled and visible in a viewport with default viewport settings,
|
||||
* (so without any local view or local collection visibility overrides). Used
|
||||
* when editors other than the 3D viewport need to know if an object is visible. */
|
||||
BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT = (1 << 4),
|
||||
|
||||
/* Object comes from a scene set. */
|
||||
BASE_FROM_SET = (1 << 5),
|
||||
|
||||
/* Object is enabled for viewport or final render respectively. Only enabled
|
||||
* objects can be pulled into the depsgraph for evaluation, either through being
|
||||
* directly visible, as a dependency of another object, or as part of colliders
|
||||
* and effectors for physics. */
|
||||
BASE_ENABLED_VIEWPORT = (1 << 6),
|
||||
BASE_ENABLED_RENDER = (1 << 7),
|
||||
|
||||
/* BASE_DEPRECATED = (1 << 9), */
|
||||
|
||||
/* Object masked out from render */
|
||||
BASE_HOLDOUT = (1 << 10),
|
||||
/* Object only contributes indirectly to render */
|
||||
BASE_INDIRECT_ONLY = (1 << 11),
|
||||
};
|
||||
ENUM_OPERATORS(eBase_Flag)
|
||||
|
||||
/* LayerCollection->flag */
|
||||
enum eLayerCollection_Flag : short {
|
||||
/* LAYER_COLLECTION_DEPRECATED0 = (1 << 0), */
|
||||
/* LAYER_COLLECTION_DEPRECATED1 = (1 << 1), */
|
||||
/* LAYER_COLLECTION_DEPRECATED2 = (1 << 2), */
|
||||
/* LAYER_COLLECTION_DEPRECATED3 = (1 << 3), */
|
||||
LAYER_COLLECTION_EXCLUDE = (1 << 4),
|
||||
LAYER_COLLECTION_HOLDOUT = (1 << 5),
|
||||
LAYER_COLLECTION_INDIRECT_ONLY = (1 << 6),
|
||||
LAYER_COLLECTION_HIDE = (1 << 7),
|
||||
LAYER_COLLECTION_PREVIOUSLY_EXCLUDED = (1 << 8),
|
||||
};
|
||||
ENUM_OPERATORS(eLayerCollection_Flag)
|
||||
|
||||
/* Layer Collection->runtime_flag
|
||||
* Keep it synced with base->flag based on g_base_collection_flags. */
|
||||
enum eLayerCollection_RuntimeFlag : short {
|
||||
LAYER_COLLECTION_HAS_OBJECTS = (1 << 0),
|
||||
/* LAYER_COLLECTION_VISIBLE_DEPSGRAPH = (1 << 1), */ /* UNUSED */
|
||||
LAYER_COLLECTION_HIDE_VIEWPORT = (1 << 2),
|
||||
LAYER_COLLECTION_VISIBLE_VIEW_LAYER = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eLayerCollection_RuntimeFlag)
|
||||
|
||||
/* ViewLayer->flag */
|
||||
enum eViewLayer_Flag : short {
|
||||
VIEW_LAYER_RENDER = (1 << 0),
|
||||
/* VIEW_LAYER_DEPRECATED = (1 << 1), */
|
||||
VIEW_LAYER_FREESTYLE = (1 << 2),
|
||||
VIEW_LAYER_OUT_OF_SYNC = (1 << 3),
|
||||
VIEW_LAYER_HAS_EXPORT_COLLECTIONS = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eViewLayer_Flag)
|
||||
|
||||
struct Base {
|
||||
struct Base *next = nullptr, *prev = nullptr;
|
||||
|
||||
struct Object *object = nullptr;
|
||||
|
||||
/* Pointer to an original base. Is initialized for evaluated view layer.
|
||||
* NOTE: Only allowed to be accessed from within active dependency graph. */
|
||||
struct Base *base_orig = nullptr;
|
||||
|
||||
DNA_DEPRECATED unsigned int lay = 0;
|
||||
/* Final flags, including both accumulated collection flags and object's
|
||||
* restriction flags. */
|
||||
eBase_Flag flag = {};
|
||||
/* Flags which are based on the collections flags evaluation, does not
|
||||
* include flags from object's restrictions. */
|
||||
eBase_Flag flag_from_collection = {};
|
||||
short flag_legacy = 0;
|
||||
unsigned short local_view_bits = 0;
|
||||
unsigned short local_collections_bits = 0;
|
||||
char _pad1[2] = {};
|
||||
};
|
||||
|
||||
struct LayerCollection {
|
||||
struct LayerCollection *next = nullptr, *prev = nullptr;
|
||||
struct Collection *collection = nullptr;
|
||||
void *_pad1 = nullptr;
|
||||
eLayerCollection_Flag flag = {};
|
||||
eLayerCollection_RuntimeFlag runtime_flag = {};
|
||||
char _pad[4] = {};
|
||||
|
||||
/** Synced with collection->children. */
|
||||
ListBaseT<LayerCollection> layer_collections = {nullptr, nullptr};
|
||||
|
||||
unsigned short local_collections_bits = 0;
|
||||
short _pad2[3] = {};
|
||||
};
|
||||
|
||||
/* Type containing EEVEE settings per view-layer */
|
||||
struct ViewLayerEEVEE {
|
||||
eViewLayerEEVEEPassType render_passes = {};
|
||||
float ambient_occlusion_distance = 10.0f;
|
||||
};
|
||||
|
||||
/** AOV Render-pass definition. */
|
||||
struct ViewLayerAOV {
|
||||
struct ViewLayerAOV *next = nullptr, *prev = nullptr;
|
||||
|
||||
/* Name of the AOV */
|
||||
char name[64] = "";
|
||||
eViewLayerAOVFlag flag = {};
|
||||
/* Type of AOV (color/value). */
|
||||
eViewLayerAOVType type = AOV_TYPE_VALUE;
|
||||
};
|
||||
|
||||
/** Light-group Render-pass definition. */
|
||||
struct ViewLayerLightgroup {
|
||||
struct ViewLayerLightgroup *next = nullptr, *prev = nullptr;
|
||||
|
||||
/* Name of the Light-group. */
|
||||
char name[64] = "";
|
||||
};
|
||||
|
||||
/* Light-group membership information. */
|
||||
struct LightgroupMembership {
|
||||
/* Name of the Light-group. */
|
||||
char name[64] = "";
|
||||
};
|
||||
|
||||
struct ViewLayer {
|
||||
struct ViewLayer *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
eViewLayer_Flag flag = VIEW_LAYER_RENDER | VIEW_LAYER_FREESTYLE;
|
||||
char _pad[6] = {};
|
||||
ListBaseT<Base> object_bases = {nullptr, nullptr};
|
||||
/** Default allocated now. */
|
||||
struct SceneStats *stats = nullptr;
|
||||
struct Base *basact = nullptr;
|
||||
|
||||
/** A view layer has one top level layer collection, because a scene has only one top level
|
||||
* collection. The layer_collections list always contains a single element. ListBaseT is
|
||||
* convenient when applying functions to all layer collections recursively. */
|
||||
ListBaseT<LayerCollection> layer_collections = {nullptr, nullptr};
|
||||
LayerCollection *active_collection = nullptr;
|
||||
|
||||
/* Old SceneRenderLayer data. */
|
||||
int layflag = SCE_LAY_FLAG_DEFAULT;
|
||||
/** Pass_xor has to be after passflag. */
|
||||
int passflag = SCE_PASS_COMBINED;
|
||||
float pass_alpha_threshold = 0.5f;
|
||||
eViewLayerCryptomatteFlags cryptomatte_flag = VIEW_LAYER_CRYPTOMATTE_ACCURATE;
|
||||
short cryptomatte_levels = 6;
|
||||
eViewLayerGreasePencilFlags grease_pencil_flags = {};
|
||||
|
||||
int samples = 0;
|
||||
|
||||
struct Material *mat_override = nullptr;
|
||||
struct World *world_override = nullptr;
|
||||
/** Equivalent to data-blocks user-defined ID properties. */
|
||||
struct IDProperty *id_properties = nullptr;
|
||||
/** Equivalent to data-blocks system-defined ID properties. */
|
||||
struct IDProperty *system_properties = nullptr;
|
||||
|
||||
struct FreestyleConfig freestyle_config;
|
||||
struct ViewLayerEEVEE eevee;
|
||||
|
||||
ListBaseT<ViewLayerAOV> aovs = {nullptr, nullptr};
|
||||
ViewLayerAOV *active_aov = nullptr;
|
||||
|
||||
ListBaseT<ViewLayerLightgroup> lightgroups = {nullptr, nullptr};
|
||||
ViewLayerLightgroup *active_lightgroup = nullptr;
|
||||
|
||||
/* Runtime data */
|
||||
struct Base **object_bases_array = nullptr;
|
||||
ObjectBasesMap *object_bases_hash = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
176
blender-5.2.0/source/blender/makesdna/DNA_light_types.h
Normal file
176
blender-5.2.0/source/blender/makesdna/DNA_light_types.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_constants.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_defs.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
#ifndef MAX_MTEX
|
||||
# define MAX_MTEX 18
|
||||
#endif
|
||||
|
||||
struct AnimData;
|
||||
struct bNodeTree;
|
||||
|
||||
/** #Light::flag */
|
||||
enum eLight_Flag : short {
|
||||
LA_DS_EXPAND = 1 << 0,
|
||||
/**
|
||||
* NOTE: this must have the same value as #MA_DS_SHOW_TEXS,
|
||||
* otherwise anim-editors will not read correctly.
|
||||
*/
|
||||
LA_DS_SHOW_TEXS = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eLight_Flag)
|
||||
|
||||
/** #Light::type */
|
||||
enum eLightType : short {
|
||||
LA_LOCAL = 0,
|
||||
LA_SUN = 1,
|
||||
LA_SPOT = 2,
|
||||
// LA_HEMI = 3, /* Deprecated. */
|
||||
LA_AREA = 4,
|
||||
};
|
||||
|
||||
/** #Light::mode */
|
||||
enum eLight_Mode : int {
|
||||
LA_SHADOW = 1 << 0,
|
||||
// LA_HALO = 1 << 1, /* Deprecated. */
|
||||
// LA_LAYER = 1 << 2, /* Deprecated. */
|
||||
// LA_QUAD = 1 << 3, /* Deprecated. */
|
||||
// LA_NEG = 1 << 4, /* Deprecated. */
|
||||
// LA_ONLYSHADOW = 1 << 5, /* Deprecated. */
|
||||
// LA_SPHERE = 1 << 6, /* Deprecated. */
|
||||
LA_SQUARE = 1 << 7,
|
||||
// LA_TEXTURE = 1 << 8, /* Deprecated. */
|
||||
// LA_OSATEX = 1 << 9, /* Deprecated. */
|
||||
// LA_DEEP_SHADOW = 1 << 10, /* Deprecated. */
|
||||
// LA_NO_DIFF = 1 << 11, /* Deprecated. */
|
||||
// LA_NO_SPEC = 1 << 12, /* Deprecated. */
|
||||
LA_SHAD_RAY = 1 << 13, /* Deprecated, cleaned. */
|
||||
/**
|
||||
* YAFRAY: light shadow-buffer flag, soft-light.
|
||||
* Since it is used with LOCAL light, can't use LA_SHAD.
|
||||
*/
|
||||
// LA_YF_SOFT = 1 << 14, /* Deprecated. */
|
||||
// LA_LAYER_SHADOW = 1 << 15, /* Deprecated. */
|
||||
// LA_SHAD_TEX = 1 << 16, /* Deprecated. */
|
||||
LA_SHOW_CONE = 1 << 17,
|
||||
// LA_SHOW_SHADOW_BOX = 1 << 18,
|
||||
// LA_SHAD_CONTACT = 1 << 19, /* Deprecated. */
|
||||
LA_CUSTOM_ATTENUATION = 1 << 20,
|
||||
LA_USE_SOFT_FALLOFF = 1 << 21,
|
||||
/** Use absolute resolution clamping instead of relative. */
|
||||
LA_SHAD_RES_ABSOLUTE = 1 << 22,
|
||||
LA_SHADOW_JITTER = 1 << 23,
|
||||
LA_USE_TEMPERATURE = 1 << 24,
|
||||
LA_UNNORMALIZED = 1 << 25,
|
||||
};
|
||||
ENUM_OPERATORS(eLight_Mode)
|
||||
|
||||
/** #Light::falloff_type */
|
||||
enum eLightFalloffType : short {
|
||||
LA_FALLOFF_CONSTANT = 0,
|
||||
LA_FALLOFF_INVLINEAR = 1,
|
||||
LA_FALLOFF_INVSQUARE = 2,
|
||||
LA_FALLOFF_CURVE = 3,
|
||||
LA_FALLOFF_SLIDERS = 4,
|
||||
LA_FALLOFF_INVCOEFFICIENTS = 5,
|
||||
};
|
||||
|
||||
/** #Light::area_shape */
|
||||
enum eLightAreaShape : short {
|
||||
LA_AREA_SQUARE = 0,
|
||||
LA_AREA_RECT = 1,
|
||||
// LA_AREA_CUBE = 2, /* Deprecated. */
|
||||
// LA_AREA_BOX = 3, /* Deprecated. */
|
||||
LA_AREA_DISK = 4,
|
||||
LA_AREA_ELLIPSE = 5,
|
||||
};
|
||||
|
||||
struct Light {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Light)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_LA;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/* Type and flags. */
|
||||
eLightType type = LA_LOCAL;
|
||||
eLight_Flag flag = {};
|
||||
eLight_Mode mode = LA_SHADOW | LA_USE_SOFT_FALLOFF;
|
||||
|
||||
/* Color, temperature and energy. */
|
||||
float r = 1.0f, g = 1.0f, b = 1.0f;
|
||||
float temperature = 6500.0f;
|
||||
float energy = 10.0f;
|
||||
float exposure = 0;
|
||||
|
||||
/* Point light. */
|
||||
float radius = 0;
|
||||
|
||||
/* Spot Light. */
|
||||
float spotsize = DEG2RADF(45.0f);
|
||||
float spotblend = 0.15f;
|
||||
|
||||
/* Area light. */
|
||||
eLightAreaShape area_shape = LA_AREA_SQUARE;
|
||||
short _pad1 = {};
|
||||
float area_size = 0.25f;
|
||||
float area_sizey = 0.25f;
|
||||
float area_sizez = 0.25f;
|
||||
float area_spread = DEG2RADF(180.0f);
|
||||
|
||||
/* Sun light. */
|
||||
float sun_angle = DEG2RADF(0.526f);
|
||||
|
||||
/* Nodes. */
|
||||
short pr_texture = 0;
|
||||
DNA_DEPRECATED short use_nodes = 0;
|
||||
|
||||
/* Eevee */
|
||||
float clipsta = 0.05f;
|
||||
float clipend_deprecated = 0;
|
||||
|
||||
float cascade_max_dist = 200.0f;
|
||||
float cascade_exponent = 0.8f;
|
||||
float cascade_fade = 0.1f;
|
||||
int cascade_count = 4;
|
||||
|
||||
float diff_fac = 1.0f;
|
||||
float spec_fac = 1.0f;
|
||||
float transmission_fac = 1.0f;
|
||||
float volume_fac = 1.0f;
|
||||
|
||||
float att_dist = 40.0f;
|
||||
float shadow_filter_radius = 1.0f;
|
||||
float shadow_maximum_resolution = 0.001f;
|
||||
float shadow_jitter_overblur = 10.0f;
|
||||
|
||||
/* Preview */
|
||||
struct PreviewImage *preview = nullptr;
|
||||
|
||||
/* Nodes */
|
||||
struct bNodeTree *nodetree = nullptr;
|
||||
|
||||
/* Deprecated. */
|
||||
DNA_DEPRECATED float energy_deprecated = 10.0f;
|
||||
float _pad2 = 0.0f;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
377
blender-5.2.0/source/blender/makesdna/DNA_lightprobe_types.h
Normal file
377
blender-5.2.0/source/blender/makesdna/DNA_lightprobe_types.h
Normal file
@@ -0,0 +1,377 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
#include "BLI_assert.h"
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct Object;
|
||||
namespace gpu {
|
||||
class Texture;
|
||||
} // namespace gpu
|
||||
|
||||
/** Bump the version number for light-cache data structure changes. */
|
||||
#define LIGHTCACHE_STATIC_VERSION 2
|
||||
|
||||
/* Probe->type */
|
||||
enum eLightProbeType : char {
|
||||
LIGHTPROBE_TYPE_SPHERE = 0,
|
||||
LIGHTPROBE_TYPE_PLANE = 1,
|
||||
LIGHTPROBE_TYPE_VOLUME = 2,
|
||||
};
|
||||
|
||||
/* Probe->flag */
|
||||
enum eLightProbe_Flag : char {
|
||||
LIGHTPROBE_FLAG_CUSTOM_PARALLAX = (1 << 0),
|
||||
LIGHTPROBE_FLAG_SHOW_INFLUENCE = (1 << 1),
|
||||
LIGHTPROBE_FLAG_SHOW_PARALLAX = (1 << 2),
|
||||
LIGHTPROBE_FLAG_SHOW_CLIP_DIST = (1 << 3),
|
||||
LIGHTPROBE_FLAG_SHOW_DATA = (1 << 4),
|
||||
LIGHTPROBE_FLAG_INVERT_GROUP = (1 << 5),
|
||||
LIGHTPROBE_DS_EXPAND = (1 << 6),
|
||||
};
|
||||
ENUM_OPERATORS(eLightProbe_Flag)
|
||||
|
||||
/* Probe->grid_flag */
|
||||
enum eLightProbe_GridFlag : char {
|
||||
LIGHTPROBE_GRID_CAPTURE_WORLD = (1 << 0),
|
||||
LIGHTPROBE_GRID_CAPTURE_INDIRECT = (1 << 1),
|
||||
LIGHTPROBE_GRID_CAPTURE_EMISSION = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eLightProbe_GridFlag)
|
||||
|
||||
/* Probe->display */
|
||||
enum eLightProbeDisplay : char {
|
||||
LIGHTPROBE_DISP_WIRE = 0,
|
||||
LIGHTPROBE_DISP_SHADED = 1,
|
||||
LIGHTPROBE_DISP_DIFFUSE = 2,
|
||||
LIGHTPROBE_DISP_REFLECTIVE = 3,
|
||||
};
|
||||
|
||||
/* Probe->parallax && Probe->attenuation_type. */
|
||||
enum eLightProbeShape : char {
|
||||
LIGHTPROBE_SHAPE_ELIPSOID = 0,
|
||||
LIGHTPROBE_SHAPE_BOX = 1,
|
||||
};
|
||||
|
||||
/* LightCache->type */
|
||||
enum eLightCacheType : int {
|
||||
LIGHTCACHE_TYPE_STATIC = 0,
|
||||
};
|
||||
|
||||
/* LightCache->flag */
|
||||
enum eLightCache_Flag : int {
|
||||
LIGHTCACHE_BAKED = (1 << 0),
|
||||
LIGHTCACHE_BAKING = (1 << 1),
|
||||
LIGHTCACHE_CUBE_READY = (1 << 2),
|
||||
LIGHTCACHE_GRID_READY = (1 << 3),
|
||||
/* Update tagging */
|
||||
LIGHTCACHE_UPDATE_CUBE = (1 << 4),
|
||||
LIGHTCACHE_UPDATE_GRID = (1 << 5),
|
||||
LIGHTCACHE_UPDATE_WORLD = (1 << 6),
|
||||
LIGHTCACHE_UPDATE_AUTO = (1 << 7),
|
||||
/** Invalid means we tried to alloc it but failed. */
|
||||
LIGHTCACHE_INVALID = (1 << 8),
|
||||
/** The data present in the cache is valid but unusable on this GPU. */
|
||||
LIGHTCACHE_NOT_USABLE = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(eLightCache_Flag)
|
||||
|
||||
/* EEVEE_LightCacheTexture->data_type */
|
||||
enum eLightCacheTexture_DataType : char {
|
||||
LIGHTCACHETEX_BYTE = (1 << 0),
|
||||
LIGHTCACHETEX_FLOAT = (1 << 1),
|
||||
LIGHTCACHETEX_UINT = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eLightCacheTexture_DataType)
|
||||
|
||||
/** #LightProbeGridCacheFrame.data_layout (int) */
|
||||
enum eLightProbeGridCacheLayout : int {
|
||||
/** Simple uniform grid. Raw output from GPU. Used during the baking process. */
|
||||
LIGHTPROBE_CACHE_UNIFORM_GRID = 0,
|
||||
/** Fills the space with different level of resolution. More efficient storage. */
|
||||
LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION = 1,
|
||||
};
|
||||
|
||||
/** #LightProbeObjectCache.type (int) */
|
||||
enum eLightProbeObjectCacheType : int {
|
||||
/** Light cache was just created and is not yet baked. Keep as 0 for default value. */
|
||||
LIGHTPROBE_CACHE_TYPE_NONE = 0,
|
||||
/** Light cache is baked for one specific frame and capture all indirect lighting. */
|
||||
LIGHTPROBE_CACHE_TYPE_STATIC = 1,
|
||||
};
|
||||
|
||||
struct LightProbe {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_LP;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
/** For realtime probe objects. */
|
||||
eLightProbeType type = LIGHTPROBE_TYPE_SPHERE;
|
||||
/** General purpose flags for probes. */
|
||||
eLightProbe_Flag flag = LIGHTPROBE_FLAG_SHOW_INFLUENCE;
|
||||
/** Attenuation type. */
|
||||
eLightProbeShape attenuation_type = LIGHTPROBE_SHAPE_ELIPSOID;
|
||||
/** Parallax type. */
|
||||
eLightProbeShape parallax_type = LIGHTPROBE_SHAPE_ELIPSOID;
|
||||
/** Grid specific flags. */
|
||||
eLightProbe_GridFlag grid_flag = LIGHTPROBE_GRID_CAPTURE_INDIRECT |
|
||||
LIGHTPROBE_GRID_CAPTURE_EMISSION;
|
||||
char _pad0[3] = {};
|
||||
|
||||
/** Influence Radius. */
|
||||
float distinf = 2.5f;
|
||||
/** Parallax Radius. */
|
||||
float distpar = 2.5f;
|
||||
/** Influence falloff. */
|
||||
float falloff = 0.2f;
|
||||
|
||||
float clipsta = 0.8f, clipend = 20.0f;
|
||||
|
||||
/** VSM visibility biases. */
|
||||
float vis_bias = 1.0f, vis_bleedbias = 0;
|
||||
float vis_blur = 0.2f;
|
||||
|
||||
/** Intensity multiplier. */
|
||||
float intensity = 1.0f;
|
||||
|
||||
/** Irradiance grid resolution. */
|
||||
int grid_resolution_x = 4;
|
||||
int grid_resolution_y = 4;
|
||||
int grid_resolution_z = 4;
|
||||
/** Irradiance grid: number of directions to evaluate light transfer in. */
|
||||
int grid_bake_samples = 2048;
|
||||
/** Irradiance grid: Virtual offset parameters. */
|
||||
float grid_surface_bias = 0.05;
|
||||
float grid_escape_bias = 0.1;
|
||||
/** Irradiance grid: Sampling biases. */
|
||||
float grid_normal_bias = 0.3f;
|
||||
float grid_view_bias = 0.0f;
|
||||
float grid_facing_bias = 0.5f;
|
||||
float grid_validity_threshold = 0.40f;
|
||||
/** Irradiance grid: Dilation. */
|
||||
float grid_dilation_threshold = 0.5f;
|
||||
float grid_dilation_radius = 1.0f;
|
||||
|
||||
/** Light intensity clamp. */
|
||||
float grid_clamp_direct = 0.0f;
|
||||
float grid_clamp_indirect = 10.0f;
|
||||
|
||||
/** Surface element density for scene surface cache. In surfel per unit distance. */
|
||||
int grid_surfel_density = 20;
|
||||
|
||||
/** Object visibility group, inclusive or exclusive. */
|
||||
struct Collection *visibility_grp = nullptr;
|
||||
|
||||
/** LIGHTPROBE_FLAG_SHOW_DATA display size. */
|
||||
float data_display_size = 0.1f;
|
||||
char _pad1[4] = {};
|
||||
};
|
||||
|
||||
/* ------- Eevee LightProbes ------- */
|
||||
/* Needs to be there because written to file with the light-cache. */
|
||||
|
||||
/* IMPORTANT Padding in these structs is essential. It must match
|
||||
* GLSL struct definition in lightprobe_lib.glsl. */
|
||||
|
||||
/* Must match CubeData. */
|
||||
struct LightProbeCache {
|
||||
float position[3] = {}, parallax_type = 0;
|
||||
float attenuation_fac = 0;
|
||||
float attenuation_type = 0;
|
||||
float _pad3[2] = {};
|
||||
float attenuationmat[4][4] = {};
|
||||
float parallaxmat[4][4] = {};
|
||||
};
|
||||
|
||||
/* Must match GridData. */
|
||||
struct LightGridCache {
|
||||
float mat[4][4] = {};
|
||||
/** Offset to the first irradiance sample in the pool. */
|
||||
int resolution[3] = {}, offset = 0;
|
||||
float corner[3] = {}, attenuation_scale = 0;
|
||||
/** World space vector between 2 opposite cells. */
|
||||
float increment_x[3] = {}, attenuation_bias = 0;
|
||||
float increment_y[3] = {}, level_bias = 0;
|
||||
float increment_z[3] = {}, _pad4 = 0;
|
||||
float visibility_bias = 0, visibility_bleed = 0, visibility_range = 0, _pad5 = 0;
|
||||
};
|
||||
|
||||
/* These are used as UBO data. They need to be aligned to size of vec4. */
|
||||
BLI_STATIC_ASSERT_ALIGN(LightProbeCache, 16)
|
||||
BLI_STATIC_ASSERT_ALIGN(LightGridCache, 16)
|
||||
|
||||
/* ------ Eevee Lightcache ------- */
|
||||
|
||||
struct LightCacheTexture {
|
||||
gpu::Texture *tex = nullptr;
|
||||
/** Copy of GPU data to create gpu::Textures on file read. */
|
||||
char *data = nullptr;
|
||||
int tex_size[3] = {};
|
||||
eLightCacheTexture_DataType data_type = {};
|
||||
char components = 0;
|
||||
char _pad[2] = {};
|
||||
};
|
||||
|
||||
struct LightCache {
|
||||
eLightCache_Flag flag = {};
|
||||
/** Version number to know if the cache data is compatible with this version of blender. */
|
||||
int version = 0;
|
||||
/** Type of data this cache contains. */
|
||||
eLightCacheType type = LIGHTCACHE_TYPE_STATIC;
|
||||
/* only a single cache for now */
|
||||
/** Number of probes to use for rendering. */
|
||||
int cube_len = 0, grid_len = 0;
|
||||
/** Number of mipmap level to use. */
|
||||
int mips_len = 0;
|
||||
/** Size of a visibility/reflection sample. */
|
||||
int vis_res = 0, ref_res = 0;
|
||||
char _pad[4][2] = {};
|
||||
/* In the future, we could create a bigger texture containing
|
||||
* multiple caches (for animation) and interpolate between the
|
||||
* caches overtime to another texture. */
|
||||
LightCacheTexture grid_tx;
|
||||
/** Contains data for mipmap level 0. */
|
||||
LightCacheTexture cube_tx;
|
||||
/** Does not contains valid gpu::Texture, only data. */
|
||||
LightCacheTexture *cube_mips = nullptr;
|
||||
/* All light-probes data contained in the cache. */
|
||||
LightProbeCache *cube_data = nullptr;
|
||||
LightGridCache *grid_data = nullptr;
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Irradiance grid data storage
|
||||
*
|
||||
* Each spherical harmonic band is stored separately. This allow loading only a specific band.
|
||||
* The layout of each array is set by the #LightProbeGridType.
|
||||
* Any unavailable data is be set to nullptr.
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Irradiance data (RGB) stored along visibility (A).
|
||||
* This is the format used during baking and is used for visualizing the baking process.
|
||||
*/
|
||||
struct LightProbeBakingData {
|
||||
float (*L0)[4] = {};
|
||||
float (*L1_a)[4] = {};
|
||||
float (*L1_b)[4] = {};
|
||||
float (*L1_c)[4] = {};
|
||||
float *validity = nullptr;
|
||||
/* Capture offset. Only for debugging. */
|
||||
float (*virtual_offset)[4] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Irradiance stored as RGB triple using scene linear color space.
|
||||
*/
|
||||
struct LightProbeIrradianceData {
|
||||
float (*L0)[3] = {};
|
||||
float (*L1_a)[3] = {};
|
||||
float (*L1_b)[3] = {};
|
||||
float (*L1_c)[3] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalized visibility of distant light. Used for compositing grids together.
|
||||
*/
|
||||
struct LightProbeVisibilityData {
|
||||
float *L0 = nullptr;
|
||||
float *L1_a = nullptr;
|
||||
float *L1_b = nullptr;
|
||||
float *L1_c = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Used to avoid light leaks. Validate visibility between each grid sample.
|
||||
*/
|
||||
struct LightProbeConnectivityData {
|
||||
/** Stores validity of the lighting for each grid sample. */
|
||||
uint8_t *validity = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines one block of data inside the grid cache data arrays.
|
||||
* The block size if the same for all the blocks.
|
||||
*/
|
||||
struct LightProbeBlockData {
|
||||
/* Offset inside the level-of-detail this block starts. */
|
||||
int offset[3] = {};
|
||||
/* Level-of-detail this block is from. */
|
||||
int level = 0;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name LightProbeGridCacheFrame
|
||||
*
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* A frame worth of baked lighting data.
|
||||
*/
|
||||
struct LightProbeGridCacheFrame {
|
||||
/** Number of samples in the highest level of detail. */
|
||||
int size[3] = {};
|
||||
/** Spatial layout type of the data stored inside the data arrays. */
|
||||
eLightProbeGridCacheLayout data_layout = LIGHTPROBE_CACHE_UNIFORM_GRID;
|
||||
|
||||
/** Sparse or adaptive layout only: number of blocks inside data arrays. */
|
||||
int block_len = 0;
|
||||
/** Sparse or adaptive layout only: size of a block in samples. All 3 dimensions are equal. */
|
||||
int block_size = 0;
|
||||
/** Sparse or adaptive layout only: specify the blocks positions. */
|
||||
LightProbeBlockData *block_infos = nullptr;
|
||||
|
||||
/** In-progress baked data. Not stored in file. */
|
||||
LightProbeBakingData baking;
|
||||
/** Baked data. */
|
||||
LightProbeIrradianceData irradiance;
|
||||
LightProbeVisibilityData visibility;
|
||||
LightProbeConnectivityData connectivity;
|
||||
|
||||
char _pad[4] = {};
|
||||
|
||||
/** Number of debug surfels. */
|
||||
int surfels_len = 0;
|
||||
/** Debug surfels used to visualize the baking process. Not stored in file. */
|
||||
void *surfels = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Per object container of baked data.
|
||||
* Should be called #LightProbeCache but name is already taken.
|
||||
*/
|
||||
struct LightProbeObjectCache {
|
||||
/** Allow correct versioning / different types of data for the same layout. */
|
||||
eLightProbeObjectCacheType cache_type = LIGHTPROBE_CACHE_TYPE_NONE;
|
||||
/** True if this cache references the original object's cache. */
|
||||
char shared = 0;
|
||||
/** True if the cache has been tagged for automatic baking. */
|
||||
char dirty = 0;
|
||||
|
||||
char _pad0[2] = {};
|
||||
|
||||
struct LightProbeGridCacheFrame *grid_static_cache = nullptr;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
} // namespace blender
|
||||
82
blender-5.2.0/source/blender/makesdna/DNA_lineart_types.h
Normal file
82
blender-5.2.0/source/blender/makesdna/DNA_lineart_types.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/* SPDX-FileCopyrightText: 2010 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* Notice that we need to have this file although no struct defines.
|
||||
* 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. */
|
||||
enum eLineartMainFlags : int {
|
||||
MOD_LINEART_INTERSECTION_AS_CONTOUR = (1 << 0),
|
||||
MOD_LINEART_EVERYTHING_AS_CONTOUR = (1 << 1),
|
||||
MOD_LINEART_ALLOW_DUPLI_OBJECTS = (1 << 2),
|
||||
MOD_LINEART_ALLOW_OVERLAPPING_EDGES = (1 << 3),
|
||||
MOD_LINEART_ALLOW_CLIPPING_BOUNDARIES = (1 << 4),
|
||||
/* LRT_REMOVE_DOUBLES = (1 << 5), Deprecated */
|
||||
MOD_LINEART_LOOSE_AS_CONTOUR = (1 << 6),
|
||||
MOD_LINEART_INVERT_SOURCE_VGROUP = (1 << 7),
|
||||
MOD_LINEART_MATCH_OUTPUT_VGROUP = (1 << 8),
|
||||
MOD_LINEART_FILTER_FACE_MARK = (1 << 9),
|
||||
MOD_LINEART_FILTER_FACE_MARK_INVERT = (1 << 10),
|
||||
MOD_LINEART_FILTER_FACE_MARK_BOUNDARIES = (1 << 11),
|
||||
MOD_LINEART_CHAIN_LOOSE_EDGES = (1 << 12),
|
||||
MOD_LINEART_CHAIN_GEOMETRY_SPACE = (1 << 13),
|
||||
MOD_LINEART_ALLOW_OVERLAP_EDGE_TYPES = (1 << 14),
|
||||
MOD_LINEART_USE_CREASE_ON_SMOOTH_SURFACES = (1 << 15),
|
||||
MOD_LINEART_USE_CREASE_ON_SHARP_EDGES = (1 << 16),
|
||||
MOD_LINEART_USE_CUSTOM_CAMERA = (1 << 17),
|
||||
MOD_LINEART_FILTER_FACE_MARK_KEEP_CONTOUR = (1 << 18),
|
||||
MOD_LINEART_USE_BACK_FACE_CULLING = (1 << 19),
|
||||
MOD_LINEART_USE_IMAGE_BOUNDARY_TRIMMING = (1 << 20),
|
||||
MOD_LINEART_CHAIN_PRESERVE_DETAILS = (1 << 22),
|
||||
MOD_LINEART_SHADOW_USE_SILHOUETTE = (1 << 24),
|
||||
};
|
||||
ENUM_OPERATORS(eLineartMainFlags)
|
||||
|
||||
enum eLineartEdgeFlag : int {
|
||||
MOD_LINEART_EDGE_FLAG_EDGE_MARK = (1 << 0),
|
||||
MOD_LINEART_EDGE_FLAG_CONTOUR = (1 << 1),
|
||||
MOD_LINEART_EDGE_FLAG_CREASE = (1 << 2),
|
||||
MOD_LINEART_EDGE_FLAG_MATERIAL = (1 << 3),
|
||||
MOD_LINEART_EDGE_FLAG_INTERSECTION = (1 << 4),
|
||||
MOD_LINEART_EDGE_FLAG_LOOSE = (1 << 5),
|
||||
MOD_LINEART_EDGE_FLAG_LIGHT_CONTOUR = (1 << 6),
|
||||
/* MOD_LINEART_EDGE_FLAG_FOR_FUTURE = (1 << 7), */
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
MOD_LINEART_EDGE_FLAG_PROJECTED_SHADOW = (1 << 8),
|
||||
/* To determine an edge to be occluded from the front or back face it's lying on. */
|
||||
MOD_LINEART_EDGE_FLAG_SHADOW_FACING_LIGHT = (1 << 9),
|
||||
/** Also used as discarded line mark. */
|
||||
MOD_LINEART_EDGE_FLAG_CHAIN_PICKED = (1 << 10),
|
||||
MOD_LINEART_EDGE_FLAG_CLIPPED = (1 << 11),
|
||||
/** Used to specify contour from viewing camera when computing shadows. */
|
||||
MOD_LINEART_EDGE_FLAG_CONTOUR_SECONDARY = (1 << 12),
|
||||
/** Limited to 16 bits for the entire thing. */
|
||||
|
||||
/** For object loading code to use only. */
|
||||
MOD_LINEART_EDGE_FLAG_INHIBIT = (1 << 14),
|
||||
/** For discarding duplicated edge types in culling stage. */
|
||||
MOD_LINEART_EDGE_FLAG_NEXT_IS_DUPLICATION = (1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eLineartEdgeFlag)
|
||||
|
||||
#define MOD_LINEART_EDGE_FLAG_ALL_TYPE 0x01ff
|
||||
#define MOD_LINEART_EDGE_FLAG_INIT_TYPE 0x37 /* Without material & light contour */
|
||||
#define MOD_LINEART_EDGE_FLAG_TYPE_MAX_BITS 7
|
||||
|
||||
} // namespace blender
|
||||
699
blender-5.2.0/source/blender/makesdna/DNA_linestyle_types.h
Normal file
699
blender-5.2.0/source/blender/makesdna/DNA_linestyle_types.h
Normal file
@@ -0,0 +1,699 @@
|
||||
/* SPDX-FileCopyrightText: 2010 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#include "BLI_math_constants.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_texture_types.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
#ifndef MAX_MTEX
|
||||
# define MAX_MTEX 18
|
||||
#endif
|
||||
|
||||
/* texco (also in DNA_material_types.h) */
|
||||
#define TEXCO_STROKE 16 /* actually its UV */
|
||||
|
||||
struct AnimData;
|
||||
struct ColorBand;
|
||||
struct CurveMapping;
|
||||
struct MTex;
|
||||
struct Object;
|
||||
struct bNodeTree;
|
||||
|
||||
/** #LineStyleModifier::type */
|
||||
enum eLineStyleModifier_Type : int {
|
||||
LS_MODIFIER_ALONG_STROKE = 1,
|
||||
LS_MODIFIER_DISTANCE_FROM_CAMERA = 2,
|
||||
LS_MODIFIER_DISTANCE_FROM_OBJECT = 3,
|
||||
LS_MODIFIER_MATERIAL = 4,
|
||||
LS_MODIFIER_SAMPLING = 5,
|
||||
LS_MODIFIER_BEZIER_CURVE = 6,
|
||||
LS_MODIFIER_SINUS_DISPLACEMENT = 7,
|
||||
LS_MODIFIER_SPATIAL_NOISE = 8,
|
||||
LS_MODIFIER_PERLIN_NOISE_1D = 9,
|
||||
LS_MODIFIER_PERLIN_NOISE_2D = 10,
|
||||
LS_MODIFIER_BACKBONE_STRETCHER = 11,
|
||||
LS_MODIFIER_TIP_REMOVER = 12,
|
||||
LS_MODIFIER_CALLIGRAPHY = 13,
|
||||
LS_MODIFIER_POLYGONIZATION = 14,
|
||||
LS_MODIFIER_GUIDING_LINES = 15,
|
||||
LS_MODIFIER_BLUEPRINT = 16,
|
||||
LS_MODIFIER_2D_OFFSET = 17,
|
||||
LS_MODIFIER_2D_TRANSFORM = 18,
|
||||
LS_MODIFIER_TANGENT = 19,
|
||||
LS_MODIFIER_NOISE = 20,
|
||||
LS_MODIFIER_CREASE_ANGLE = 21,
|
||||
LS_MODIFIER_SIMPLIFICATION = 22,
|
||||
LS_MODIFIER_CURVATURE_3D = 23,
|
||||
LS_MODIFIER_NUM = 24,
|
||||
};
|
||||
|
||||
/** #LineStyleModifier::flags */
|
||||
enum eLineStyleModifier_Flag : int {
|
||||
LS_MODIFIER_ENABLED = 1,
|
||||
LS_MODIFIER_EXPANDED = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyleModifier_Flag)
|
||||
|
||||
/** #LineStyleColorModifier_Material::flags and similar color modifier flags. */
|
||||
enum eLineStyleColorModifier_Flag : int {
|
||||
LS_MODIFIER_USE_RAMP = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyleColorModifier_Flag)
|
||||
|
||||
/** Flags (for alpha & thickness modifiers). */
|
||||
enum eLineStyleAlphaThicknessModifier_Flag : int {
|
||||
LS_MODIFIER_USE_CURVE = 1,
|
||||
LS_MODIFIER_INVERT = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyleAlphaThicknessModifier_Flag)
|
||||
|
||||
/** Flags (for asymmetric thickness application). */
|
||||
enum eLineStyleThicknessNoise_Flag : int {
|
||||
LS_THICKNESS_ASYMMETRIC = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyleThicknessNoise_Flag)
|
||||
|
||||
/** Blend (for alpha & thickness). */
|
||||
enum eLineStyleBlend : int {
|
||||
LS_VALUE_BLEND = 0,
|
||||
LS_VALUE_ADD = 1,
|
||||
LS_VALUE_MULT = 2,
|
||||
LS_VALUE_SUB = 3,
|
||||
LS_VALUE_DIV = 4,
|
||||
LS_VALUE_DIFF = 5,
|
||||
LS_VALUE_MIN = 6,
|
||||
LS_VALUE_MAX = 7,
|
||||
};
|
||||
|
||||
/* mat_attr */
|
||||
enum eLineStyleMaterialAttr : int {
|
||||
LS_MODIFIER_MATERIAL_DIFF = 1,
|
||||
LS_MODIFIER_MATERIAL_DIFF_R = 2,
|
||||
LS_MODIFIER_MATERIAL_DIFF_G = 3,
|
||||
LS_MODIFIER_MATERIAL_DIFF_B = 4,
|
||||
LS_MODIFIER_MATERIAL_SPEC = 5,
|
||||
LS_MODIFIER_MATERIAL_SPEC_R = 6,
|
||||
LS_MODIFIER_MATERIAL_SPEC_G = 7,
|
||||
LS_MODIFIER_MATERIAL_SPEC_B = 8,
|
||||
LS_MODIFIER_MATERIAL_SPEC_HARD = 9,
|
||||
LS_MODIFIER_MATERIAL_ALPHA = 10,
|
||||
LS_MODIFIER_MATERIAL_LINE = 11,
|
||||
LS_MODIFIER_MATERIAL_LINE_R = 12,
|
||||
LS_MODIFIER_MATERIAL_LINE_G = 13,
|
||||
LS_MODIFIER_MATERIAL_LINE_B = 14,
|
||||
LS_MODIFIER_MATERIAL_LINE_A = 15,
|
||||
};
|
||||
|
||||
/** #LineStyleGeometryModifier_SpatialNoise::flags */
|
||||
enum eLineStyleGeomSpatialNoise_Flag : int {
|
||||
LS_MODIFIER_SPATIAL_NOISE_SMOOTH = 1,
|
||||
LS_MODIFIER_SPATIAL_NOISE_PURERANDOM = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyleGeomSpatialNoise_Flag)
|
||||
|
||||
/** #LineStyleGeometryModifier_Blueprint::flags */
|
||||
enum eLineStyleGeomBlueprint_Flag : int {
|
||||
LS_MODIFIER_BLUEPRINT_CIRCLES = 1,
|
||||
LS_MODIFIER_BLUEPRINT_ELLIPSES = 2,
|
||||
LS_MODIFIER_BLUEPRINT_SQUARES = 4,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyleGeomBlueprint_Flag)
|
||||
|
||||
/** #LineStyleGeometryModifier_2DTransform::pivot */
|
||||
enum eLineStyleGeom2DTransform_Pivot : int {
|
||||
LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER = 1,
|
||||
LS_MODIFIER_2D_TRANSFORM_PIVOT_START = 2,
|
||||
LS_MODIFIER_2D_TRANSFORM_PIVOT_END = 3,
|
||||
LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM = 4,
|
||||
LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE = 5,
|
||||
};
|
||||
|
||||
/** #FreestyleLineStyle::panel */
|
||||
enum eLineStyle_Panel : int {
|
||||
LS_PANEL_STROKES = 1,
|
||||
LS_PANEL_COLOR = 2,
|
||||
LS_PANEL_ALPHA = 3,
|
||||
LS_PANEL_THICKNESS = 4,
|
||||
LS_PANEL_GEOMETRY = 5,
|
||||
LS_PANEL_TEXTURE = 6,
|
||||
LS_PANEL_MISC = 7,
|
||||
};
|
||||
|
||||
/** #FreestyleLineStyle::flag */
|
||||
enum eLineStyle_Flag : int {
|
||||
LS_DS_EXPAND = 1 << 0, /* for animation editors */
|
||||
LS_SAME_OBJECT = 1 << 1,
|
||||
LS_DASHED_LINE = 1 << 2,
|
||||
LS_MATERIAL_BOUNDARY = 1 << 3,
|
||||
LS_MIN_2D_LENGTH = 1 << 4,
|
||||
LS_MAX_2D_LENGTH = 1 << 5,
|
||||
LS_NO_CHAINING = 1 << 6,
|
||||
LS_MIN_2D_ANGLE = 1 << 7,
|
||||
LS_MAX_2D_ANGLE = 1 << 8,
|
||||
LS_SPLIT_LENGTH = 1 << 9,
|
||||
LS_SPLIT_PATTERN = 1 << 10,
|
||||
LS_NO_SORTING = 1 << 11,
|
||||
LS_REVERSE_ORDER = 1 << 12, /* for sorting */
|
||||
LS_TEXTURE = 1 << 13,
|
||||
LS_CHAIN_COUNT = 1 << 14,
|
||||
};
|
||||
ENUM_OPERATORS(eLineStyle_Flag)
|
||||
|
||||
/** #FreestyleLineStyle::chaining */
|
||||
enum eLineStyle_Chaining : int {
|
||||
LS_CHAINING_PLAIN = 1,
|
||||
LS_CHAINING_SKETCHY = 2,
|
||||
};
|
||||
|
||||
/** #FreestyleLineStyle::caps */
|
||||
enum eLineStyle_Caps : int {
|
||||
LS_CAPS_BUTT = 1,
|
||||
LS_CAPS_ROUND = 2,
|
||||
LS_CAPS_SQUARE = 3,
|
||||
};
|
||||
|
||||
/** #FreestyleLineStyle::thickness_position */
|
||||
enum eLineStyle_ThicknessPosition : int {
|
||||
LS_THICKNESS_CENTER = 1,
|
||||
LS_THICKNESS_INSIDE = 2,
|
||||
LS_THICKNESS_OUTSIDE = 3,
|
||||
/** Thickness_ratio is used. */
|
||||
LS_THICKNESS_RELATIVE = 4,
|
||||
};
|
||||
|
||||
/** #FreestyleLineStyle::sort_key */
|
||||
enum eLineStyle_SortKey : int {
|
||||
LS_SORT_KEY_DISTANCE_FROM_CAMERA = 1,
|
||||
LS_SORT_KEY_2D_LENGTH = 2,
|
||||
LS_SORT_KEY_PROJECTED_X = 3,
|
||||
LS_SORT_KEY_PROJECTED_Y = 4,
|
||||
};
|
||||
|
||||
/** #FreestyleLineStyle::integration_type */
|
||||
enum eLineStyle_IntegrationType : int {
|
||||
LS_INTEGRATION_MEAN = 1,
|
||||
LS_INTEGRATION_MIN = 2,
|
||||
LS_INTEGRATION_MAX = 3,
|
||||
LS_INTEGRATION_FIRST = 4,
|
||||
LS_INTEGRATION_LAST = 5,
|
||||
};
|
||||
|
||||
struct LineStyleModifier {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleModifier)
|
||||
|
||||
struct LineStyleModifier *next = nullptr, *prev = nullptr;
|
||||
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
eLineStyleModifier_Type type = {};
|
||||
float influence = 0;
|
||||
eLineStyleModifier_Flag flags = {};
|
||||
eLineStyleBlend blend = LS_VALUE_BLEND;
|
||||
};
|
||||
|
||||
/* Along Stroke modifiers */
|
||||
|
||||
struct LineStyleColorModifier_AlongStroke {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_AlongStroke)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_AlongStroke {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_AlongStroke)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_AlongStroke {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_AlongStroke)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float value_min = 0, value_max = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* Distance from Camera modifiers */
|
||||
|
||||
struct LineStyleColorModifier_DistanceFromCamera {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_DistanceFromCamera)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
float range_min = 0, range_max = 0;
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_DistanceFromCamera {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_DistanceFromCamera)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float range_min = 0, range_max = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_DistanceFromCamera {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_DistanceFromCamera)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float range_min = 0, range_max = 0;
|
||||
float value_min = 0, value_max = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* Distance from Object modifiers */
|
||||
|
||||
struct LineStyleColorModifier_DistanceFromObject {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_DistanceFromObject)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct Object *target = nullptr;
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
float range_min = 0, range_max = 0;
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_DistanceFromObject {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_DistanceFromObject)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct Object *target = nullptr;
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float range_min = 0, range_max = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_DistanceFromObject {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_DistanceFromObject)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct Object *target = nullptr;
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float range_min = 0, range_max = 0;
|
||||
float value_min = 0, value_max = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* 3D curvature modifiers */
|
||||
|
||||
struct LineStyleColorModifier_Curvature_3D {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_Curvature_3D)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float min_curvature = 0, max_curvature = 0;
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
float range_min = 0, range_max = 0;
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_Curvature_3D {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_Curvature_3D)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float min_curvature = 0, max_curvature = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_Curvature_3D {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_Curvature_3D)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
char _pad[4] = {};
|
||||
float min_curvature = 0, max_curvature = 0;
|
||||
float min_thickness = 0, max_thickness = 0;
|
||||
};
|
||||
|
||||
/* Noise modifiers (for color, alpha and thickness) */
|
||||
|
||||
struct LineStyleColorModifier_Noise {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_Noise)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
float period = 0, amplitude = 0;
|
||||
int seed = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_Noise {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_Noise)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float period = 0, amplitude = 0;
|
||||
int seed = 0;
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_Noise {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_Noise)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float period = 0, amplitude = 0;
|
||||
eLineStyleThicknessNoise_Flag flags = {};
|
||||
int seed = 0;
|
||||
};
|
||||
|
||||
/* Crease Angle modifiers */
|
||||
|
||||
struct LineStyleColorModifier_CreaseAngle {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_CreaseAngle)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
float min_angle = 0, max_angle = 0;
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_CreaseAngle {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_CreaseAngle)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float min_angle = 0, max_angle = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_CreaseAngle {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_CreaseAngle)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
char _pad[4] = {};
|
||||
float min_angle = 0, max_angle = 0;
|
||||
float min_thickness = 0, max_thickness = 0;
|
||||
};
|
||||
|
||||
/* Tangent modifiers */
|
||||
|
||||
struct LineStyleColorModifier_Tangent {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_Tangent)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_Tangent {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_Tangent)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_Tangent {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_Tangent)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float min_thickness = 0, max_thickness = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* Material modifiers */
|
||||
|
||||
struct LineStyleColorModifier_Material {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleColorModifier_Material)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct ColorBand *color_ramp = nullptr;
|
||||
eLineStyleColorModifier_Flag flags = {};
|
||||
eLineStyleMaterialAttr mat_attr = {};
|
||||
};
|
||||
|
||||
struct LineStyleAlphaModifier_Material {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleAlphaModifier_Material)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
eLineStyleMaterialAttr mat_attr = {};
|
||||
};
|
||||
|
||||
struct LineStyleThicknessModifier_Material {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_Material)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
struct CurveMapping *curve = nullptr;
|
||||
eLineStyleAlphaThicknessModifier_Flag flags = {};
|
||||
float value_min = 0, value_max = 0;
|
||||
eLineStyleMaterialAttr mat_attr = {};
|
||||
};
|
||||
|
||||
/* Geometry modifiers */
|
||||
|
||||
struct LineStyleGeometryModifier_Sampling {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_Sampling)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float sampling = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_BezierCurve {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_BezierCurve)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float error = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_SinusDisplacement {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_SinusDisplacement)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float wavelength = 0, amplitude = 0, phase = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_SpatialNoise {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_SpatialNoise)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float amplitude = 0, scale = 0;
|
||||
unsigned int octaves = 0;
|
||||
eLineStyleGeomSpatialNoise_Flag flags = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_PerlinNoise1D {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_PerlinNoise1D)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float frequency = 0, amplitude = 0;
|
||||
/** In radians. */
|
||||
float angle = 0;
|
||||
unsigned int octaves = 0;
|
||||
int seed = 0;
|
||||
char _pad1[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_PerlinNoise2D {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_PerlinNoise2D)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float frequency = 0, amplitude = 0;
|
||||
/** In radians. */
|
||||
float angle = 0;
|
||||
unsigned int octaves = 0;
|
||||
int seed = 0;
|
||||
char _pad1[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_BackboneStretcher {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_BackboneStretcher)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float backbone_length = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_TipRemover {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_TipRemover)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float tip_length = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_Polygonalization {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_Polygonalization)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float error = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_GuidingLines {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_GuidingLines)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float offset = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_Blueprint {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_Blueprint)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
eLineStyleGeomBlueprint_Flag flags = {};
|
||||
unsigned int rounds = 0;
|
||||
float backbone_length = 0;
|
||||
unsigned int random_radius = 0;
|
||||
unsigned int random_center = 0;
|
||||
unsigned int random_backbone = 0;
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_2DOffset {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_2DOffset)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float start = 0, end = 0;
|
||||
float x = 0, y = 0;
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_2DTransform {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_2DTransform)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
eLineStyleGeom2DTransform_Pivot pivot = {};
|
||||
float scale_x = 0, scale_y = 0;
|
||||
/** In radians. */
|
||||
float angle = 0;
|
||||
float pivot_u = 0;
|
||||
float pivot_x = 0, pivot_y = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct LineStyleGeometryModifier_Simplification {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleGeometryModifier_Simplification)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float tolerance = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/* Calligraphic thickness modifier */
|
||||
|
||||
struct LineStyleThicknessModifier_Calligraphy {
|
||||
DNA_DEFINE_CXX_METHODS(LineStyleThicknessModifier_Calligraphy)
|
||||
|
||||
struct LineStyleModifier modifier;
|
||||
|
||||
float min_thickness = 0, max_thickness = 0;
|
||||
/** In radians. */
|
||||
float orientation = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct FreestyleLineStyle {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(FreestyleLineStyle)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_LS;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
float r = 0, g = 0, b = 0, alpha = 1.0f;
|
||||
float thickness = 3.0f;
|
||||
eLineStyle_ThicknessPosition thickness_position = LS_THICKNESS_CENTER;
|
||||
float thickness_ratio = 0.5f;
|
||||
eLineStyle_Flag flag = LS_SAME_OBJECT | LS_NO_SORTING | LS_TEXTURE;
|
||||
eLineStyle_Caps caps = LS_CAPS_BUTT;
|
||||
eLineStyle_Chaining chaining = LS_CHAINING_PLAIN;
|
||||
unsigned int rounds = 3;
|
||||
float split_length = 100;
|
||||
/** In radians, for splitting. */
|
||||
float min_angle = DEG2RADF(0.0f), max_angle = DEG2RADF(0.0f);
|
||||
float min_length = 0.0f, max_length = 10000.0f;
|
||||
unsigned int chain_count = 10;
|
||||
unsigned short split_dash1 = 0, split_gap1 = 0;
|
||||
unsigned short split_dash2 = 0, split_gap2 = 0;
|
||||
unsigned short split_dash3 = 0, split_gap3 = 0;
|
||||
eLineStyle_SortKey sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
|
||||
eLineStyle_IntegrationType integration_type = LS_INTEGRATION_MEAN;
|
||||
float texstep = 1.0f;
|
||||
short texact = 0, pr_texture = TEX_PR_TEXTURE;
|
||||
short use_nodes = 0;
|
||||
char _pad[6] = {};
|
||||
unsigned short dash1 = 0, gap1 = 0, dash2 = 0, gap2 = 0, dash3 = 0, gap3 = 0;
|
||||
/** For UI. */
|
||||
eLineStyle_Panel panel = LS_PANEL_STROKES;
|
||||
struct MTex *mtex[/*MAX_MTEX*/ 18] = {};
|
||||
/* nodes */
|
||||
struct bNodeTree *nodetree = nullptr;
|
||||
|
||||
ListBaseT<LineStyleModifier> color_modifiers = {nullptr, nullptr};
|
||||
ListBaseT<LineStyleModifier> alpha_modifiers = {nullptr, nullptr};
|
||||
ListBaseT<LineStyleModifier> thickness_modifiers = {nullptr, nullptr};
|
||||
ListBaseT<LineStyleModifier> geometry_modifiers = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
164
blender-5.2.0/source/blender/makesdna/DNA_listBase.h
Normal file
164
blender-5.2.0/source/blender/makesdna/DNA_listBase.h
Normal file
@@ -0,0 +1,164 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* \brief These structs are the foundation for all linked lists in the library system.
|
||||
*
|
||||
* Doubly-linked lists start from a ListBase and contain elements beginning
|
||||
* with Link.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** Generic - all structs which are put into linked lists begin with this. */
|
||||
struct Link {
|
||||
struct Link *next, *prev;
|
||||
};
|
||||
|
||||
/** Simple subclass of Link. Use this when it is not worth defining a custom one. */
|
||||
struct LinkData {
|
||||
struct LinkData *next, *prev;
|
||||
void *data;
|
||||
};
|
||||
|
||||
/**
|
||||
* The basic double linked-list structure.
|
||||
*
|
||||
* \warning Never change the size/definition of this struct! The #init_structDNA
|
||||
* function (from dna_genfile.cc) uses it to compute the #pointer_size.
|
||||
*/
|
||||
struct ListBase {
|
||||
void *first, *last;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
template<typename T> struct ListBaseTIterator;
|
||||
template<typename T> struct ListBaseEnumerateWrapper;
|
||||
template<typename T> struct ListBaseMutableWrapper;
|
||||
template<typename T> struct ListBaseBackwardWrapper;
|
||||
template<typename T> struct ListBaseMutableBackwardWrapper;
|
||||
|
||||
/**
|
||||
* This is a thin wrapper around #ListBase to make it type-safe. It's designed to be used in DNA
|
||||
* structs. It is written as untyped #ListBase in .blend files for compatibility.
|
||||
*/
|
||||
template<typename T> struct ListBaseT : public ListBase {
|
||||
/** True when there is no item in the list. */
|
||||
bool is_empty() const
|
||||
{
|
||||
return this->first == nullptr;
|
||||
}
|
||||
|
||||
/** True when there is exactly one item in the list. */
|
||||
bool is_single() const
|
||||
{
|
||||
return this->first != nullptr && this->last == this->first;
|
||||
}
|
||||
|
||||
/**
|
||||
* Just set the first and last pointer to null, forgetting all data that was in the list before.
|
||||
*/
|
||||
void clear_no_delete()
|
||||
{
|
||||
this->first = nullptr;
|
||||
this->last = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free all items in the list using the guarded allocator. Does not call the destructor.
|
||||
*/
|
||||
void free_no_destruct()
|
||||
{
|
||||
for ([[maybe_unused]] T &item : this->items_mutable()) {
|
||||
MEM_delete_void(static_cast<void *>(&item));
|
||||
}
|
||||
this->first = nullptr;
|
||||
this->last = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items in the list. Note that this requires iterating over the whole list.
|
||||
*/
|
||||
int count() const
|
||||
{
|
||||
int count = 0;
|
||||
for ([[maybe_unused]] const T &item : *this) {
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* TODO: Add const and non-const iterators. However this will require some refactoring
|
||||
* as some places rely on being able to get a mutable list element from a const list. */
|
||||
ListBaseTIterator<T> begin() const
|
||||
{
|
||||
return ListBaseTIterator<T>{static_cast<T *>(this->first)};
|
||||
}
|
||||
|
||||
ListBaseTIterator<T> end() const
|
||||
{
|
||||
/* Don't use `this->last` because this iterator has to point to one-past-the-end. */
|
||||
return ListBaseTIterator<T>{nullptr};
|
||||
}
|
||||
|
||||
/** Iterator that returns also gives an index for every item. This helps prevent mistakes
|
||||
* where continue mistakenly skips the incrementation.
|
||||
*
|
||||
* Usage: `for(auto [index, item] : list.enumerate())` */
|
||||
ListBaseEnumerateWrapper<T> enumerate()
|
||||
{
|
||||
return {this->first};
|
||||
}
|
||||
|
||||
ListBaseEnumerateWrapper<const T> enumerate() const
|
||||
{
|
||||
return {this->first};
|
||||
}
|
||||
|
||||
/** Iterator that supports removing the item we're looping over. */
|
||||
ListBaseMutableWrapper<T> items_mutable()
|
||||
{
|
||||
return {this->first};
|
||||
}
|
||||
|
||||
/** Iterator that runs in reverse order. */
|
||||
ListBaseBackwardWrapper<T> items_reversed()
|
||||
{
|
||||
return {this->last};
|
||||
}
|
||||
|
||||
ListBaseBackwardWrapper<const T> items_reversed() const
|
||||
{
|
||||
return {this->last};
|
||||
}
|
||||
|
||||
/** Iterator that runs in reverse order and supports removing the item we're looping over. */
|
||||
ListBaseMutableBackwardWrapper<T> items_reversed_mutable()
|
||||
{
|
||||
return {this->last};
|
||||
}
|
||||
|
||||
/* Cast for opaque types and C style subclasses. */
|
||||
template<typename OtherT> const ListBaseT<OtherT> &cast() const
|
||||
{
|
||||
return *reinterpret_cast<const ListBaseT<OtherT> *>(this);
|
||||
}
|
||||
|
||||
template<typename OtherT> ListBaseT<OtherT> &cast()
|
||||
{
|
||||
return *reinterpret_cast<ListBaseT<OtherT> *>(this);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* 8 byte alignment! */
|
||||
|
||||
} // namespace blender
|
||||
283
blender-5.2.0/source/blender/makesdna/DNA_mask_types.h
Normal file
283
blender-5.2.0/source/blender/makesdna/DNA_mask_types.h
Normal file
@@ -0,0 +1,283 @@
|
||||
/* SPDX-FileCopyrightText: 2012 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Mask data-blocks are collections of 2D curves to be used
|
||||
* for image masking in the compositor and sequencer.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
enum MaskParentType : int {
|
||||
MASK_PARENT_POINT_TRACK = 0, /* parenting happens to point track */
|
||||
MASK_PARENT_PLANE_TRACK = 1, /* parenting happens to plane track */
|
||||
};
|
||||
|
||||
enum MaskSplineFlag : short {
|
||||
MASK_SPLINE_SELECT = (1 << 0),
|
||||
MASK_SPLINE_CYCLIC = (1 << 1),
|
||||
MASK_SPLINE_NOFILL = (1 << 2),
|
||||
MASK_SPLINE_NOINTERSECT = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(MaskSplineFlag)
|
||||
|
||||
enum MaskSplineInterp : char {
|
||||
MASK_SPLINE_INTERP_LINEAR = 1,
|
||||
MASK_SPLINE_INTERP_EASE = 2,
|
||||
};
|
||||
|
||||
enum MaskSplineOffset : char {
|
||||
MASK_SPLINE_OFFSET_EVEN = 0,
|
||||
MASK_SPLINE_OFFSET_SMOOTH = 1,
|
||||
};
|
||||
|
||||
enum MaskLayerVisibility : char {
|
||||
MASK_HIDE_VIEW = 1 << 0, /* Note: match #OB_HIDE_VIEWPORT value. */
|
||||
MASK_HIDE_SELECT = 1 << 1, /* Note: match #OB_HIDE_SELECT value. */
|
||||
MASK_HIDE_RENDER = 1 << 2, /* Note: match #OB_HIDE_RENDER value. */
|
||||
};
|
||||
ENUM_OPERATORS(MaskLayerVisibility)
|
||||
|
||||
/* #MaskSpaceInfo.draw_flag */
|
||||
enum MaskDrawFlag : char {
|
||||
MASK_DRAWFLAG_SMOOTH_DEPRECATED = 1 << 0, /* Deprecated. */
|
||||
MASK_DRAWFLAG_OVERLAY = 1 << 1,
|
||||
MASK_DRAWFLAG_SPLINE = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(MaskDrawFlag)
|
||||
|
||||
/* #MaskSpaceInfo.draw_type. Note: match values of #eSpaceImage_UVDT. */
|
||||
enum MaskDrawType : char {
|
||||
MASK_DT_OUTLINE = 0,
|
||||
MASK_DT_DASH = 1,
|
||||
MASK_DT_BLACK = 2,
|
||||
MASK_DT_WHITE = 3,
|
||||
};
|
||||
|
||||
/* #MaskSpaceInfo.overlay_mode */
|
||||
enum MaskOverlayMode : char {
|
||||
MASK_OVERLAY_ALPHACHANNEL = 0,
|
||||
MASK_OVERLAY_COMBINED = 1,
|
||||
};
|
||||
|
||||
enum MaskLayerBlend : char {
|
||||
MASK_BLEND_ADD = 0,
|
||||
MASK_BLEND_SUBTRACT = 1,
|
||||
MASK_BLEND_LIGHTEN = 2,
|
||||
MASK_BLEND_DARKEN = 3,
|
||||
MASK_BLEND_MUL = 4,
|
||||
MASK_BLEND_REPLACE = 5,
|
||||
MASK_BLEND_DIFFERENCE = 6,
|
||||
MASK_BLEND_MERGE_ADD = 7,
|
||||
MASK_BLEND_MERGE_SUBTRACT = 8,
|
||||
};
|
||||
|
||||
enum MaskLayerBlendFlag : char {
|
||||
MASK_BLENDFLAG_INVERT = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(MaskLayerBlendFlag)
|
||||
|
||||
enum MaskLayerFlag : char {
|
||||
MASK_LAYERFLAG_LOCKED = (1 << 4),
|
||||
MASK_LAYERFLAG_SELECT = (1 << 5),
|
||||
|
||||
/* no holes */
|
||||
MASK_LAYERFLAG_FILL_DISCRETE = (1 << 6),
|
||||
/** Only for #the MASK_FILL_SOLVER_SWEEP_LINE solver. */
|
||||
MASK_LAYERFLAG_FILL_OVERLAP = static_cast<char>(1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(MaskLayerFlag)
|
||||
|
||||
/* masklay_shape->flag */
|
||||
enum MaskLayerShapeFlag : char {
|
||||
MASK_SHAPE_SELECT = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(MaskLayerShapeFlag)
|
||||
|
||||
enum MaskAnimFlag : int {
|
||||
MASK_ANIMF_EXPAND = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(MaskAnimFlag)
|
||||
|
||||
/** #Mask.fill_solver */
|
||||
enum MaskLayerFillSolverType : char {
|
||||
/**
|
||||
* Fast filling without support for self-intersections.
|
||||
* Uses `BLI_scanfill`.
|
||||
*/
|
||||
MASK_FILL_SOLVER_SWEEP_LINE = 0,
|
||||
/**
|
||||
* Constrained Delaunay Triangulation with self-intersection and fill rule support.
|
||||
*/
|
||||
MASK_FILL_SOLVER_CDT = 1,
|
||||
};
|
||||
|
||||
struct MaskLayerShapeElem;
|
||||
|
||||
struct Mask_Runtime {
|
||||
/* The Depsgraph::update_count when this ID was last updated. Covers any IDRecalcFlag. */
|
||||
uint64_t last_update = 0;
|
||||
};
|
||||
|
||||
struct Mask {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_MSK;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
/** Mask layers. */
|
||||
ListBaseT<struct MaskLayer> masklayers = {nullptr, nullptr};
|
||||
/** Index of active mask layer (-1 == None). */
|
||||
int masklay_act = 0;
|
||||
/** Total number of mask layers. */
|
||||
int masklay_tot = 0;
|
||||
|
||||
/** Frames, used by the sequencer. */
|
||||
int sfra = 0, efra = 0;
|
||||
|
||||
/** For anim info. */
|
||||
MaskAnimFlag flag = {};
|
||||
char _pad[4] = {};
|
||||
|
||||
Mask_Runtime runtime;
|
||||
};
|
||||
|
||||
struct MaskParent {
|
||||
/** Type of parenting. */
|
||||
int id_type = 0;
|
||||
/** Type of parenting. */
|
||||
MaskParentType type = MASK_PARENT_POINT_TRACK;
|
||||
/**
|
||||
* ID block of entity to which mask/spline is parented to.
|
||||
* In case of parenting to movie tracking data set to MovieClip datablock.
|
||||
*/
|
||||
ID *id = nullptr;
|
||||
/**
|
||||
* Entity of parent to which parenting happened.
|
||||
* In case of parenting to movie tracking data contains name of layer.
|
||||
*/
|
||||
char parent[64] = "";
|
||||
/**
|
||||
* Sub-entity of parent to which parenting happened.
|
||||
* In case of parenting to movie tracking data contains name of track.
|
||||
*/
|
||||
char sub_parent[64] = "";
|
||||
/**
|
||||
* Track location at the moment of parenting,
|
||||
* stored in mask space.
|
||||
*/
|
||||
float parent_orig[2] = {};
|
||||
|
||||
/** Original corners of plane track at the moment of parenting. */
|
||||
float parent_corners_orig[4][2] = {};
|
||||
};
|
||||
|
||||
struct MaskSplinePointUW {
|
||||
/** U coordinate along spline segment and weight of this point. */
|
||||
float u = 0, w = 0;
|
||||
/** Different flags of this point. */
|
||||
int flag = 0;
|
||||
};
|
||||
|
||||
struct MaskSplinePoint {
|
||||
/** Actual point coordinates and its handles. */
|
||||
BezTriple bezt = {};
|
||||
char _pad[4] = {};
|
||||
/** Number of uv feather values. */
|
||||
int tot_uw = 0;
|
||||
/** Feather UV values. */
|
||||
MaskSplinePointUW *uw = nullptr;
|
||||
/** Parenting information of particular spline point. */
|
||||
MaskParent parent;
|
||||
};
|
||||
|
||||
struct MaskSpline {
|
||||
struct MaskSpline *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Spline flags. */
|
||||
MaskSplineFlag flag = {};
|
||||
/** Feather offset method. */
|
||||
MaskSplineOffset offset_mode = MASK_SPLINE_OFFSET_EVEN;
|
||||
/** Weight interpolation. */
|
||||
MaskSplineInterp weight_interp = {};
|
||||
|
||||
/** Total number of points. */
|
||||
int tot_point = 0;
|
||||
/** Points which defines spline itself. */
|
||||
MaskSplinePoint *points = nullptr;
|
||||
/** Parenting information of the whole spline. */
|
||||
MaskParent parent;
|
||||
|
||||
/** Deformed copy of 'points' BezTriple data - not saved. */
|
||||
MaskSplinePoint *points_deform = nullptr;
|
||||
};
|
||||
|
||||
/* one per frame */
|
||||
struct MaskLayerShape {
|
||||
struct MaskLayerShape *next = nullptr, *prev = nullptr;
|
||||
|
||||
float *data = nullptr; /* Internally a #MaskLayerShapeElem struct for each vertex. */
|
||||
int tot_vert = 0;
|
||||
int frame = 0;
|
||||
MaskLayerShapeFlag flag = {};
|
||||
char _pad[7] = {};
|
||||
|
||||
#ifdef __cplusplus
|
||||
const MaskLayerShapeElem *vertices() const
|
||||
{
|
||||
return reinterpret_cast<const MaskLayerShapeElem *>(this->data);
|
||||
}
|
||||
MaskLayerShapeElem *vertices()
|
||||
{
|
||||
return reinterpret_cast<MaskLayerShapeElem *>(this->data);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
struct MaskLayer {
|
||||
struct MaskLayer *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Name of the mask layer. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** List of splines which defines this mask layer. */
|
||||
ListBaseT<MaskSpline> splines = {nullptr, nullptr};
|
||||
ListBaseT<MaskLayerShape> splines_shapes = {nullptr, nullptr};
|
||||
|
||||
/** Active spline. */
|
||||
struct MaskSpline *act_spline = nullptr;
|
||||
/**
|
||||
* Active point.
|
||||
*
|
||||
* \note By convention the active-point will be a point in `act_spline` however this isn't
|
||||
* guaranteed and cannot be assumed by logic that validates memory.
|
||||
*/
|
||||
struct MaskSplinePoint *act_point = nullptr;
|
||||
|
||||
/* blending options */
|
||||
float alpha = 0;
|
||||
MaskLayerBlend blend = MASK_BLEND_ADD;
|
||||
MaskLayerBlendFlag blend_flag = {};
|
||||
char falloff = 0;
|
||||
MaskLayerFillSolverType fill_solver = MASK_FILL_SOLVER_CDT;
|
||||
char _pad[6] = {};
|
||||
|
||||
MaskLayerFlag flag = {};
|
||||
/** Matching 'Object' flag of the same name - eventually use in the outliner. */
|
||||
MaskLayerVisibility visibility_flag = {};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
463
blender-5.2.0/source/blender/makesdna/DNA_material_types.h
Normal file
463
blender-5.2.0/source/blender/makesdna/DNA_material_types.h
Normal file
@@ -0,0 +1,463 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
#ifndef MAX_MTEX
|
||||
# define MAX_MTEX 18
|
||||
#endif
|
||||
|
||||
struct AnimData;
|
||||
struct Image;
|
||||
struct bNodeTree;
|
||||
|
||||
/* MaterialGPencilStyle->flag */
|
||||
enum eMaterialGPencilStyle_Flag : short {
|
||||
/* Fill Texture is a pattern */
|
||||
GP_MATERIAL_FILL_PATTERN = (1 << 0),
|
||||
/* don't display color */
|
||||
GP_MATERIAL_HIDE = (1 << 1),
|
||||
/* protected from further editing */
|
||||
GP_MATERIAL_LOCKED = (1 << 2),
|
||||
/* do onion skinning */
|
||||
GP_MATERIAL_HIDE_ONIONSKIN = (1 << 3),
|
||||
/* clamp texture */
|
||||
GP_MATERIAL_TEX_CLAMP = (1 << 4),
|
||||
/* mix fill texture */
|
||||
GP_MATERIAL_FILL_TEX_MIX = (1 << 5),
|
||||
/* Flip fill colors */
|
||||
GP_MATERIAL_FLIP_FILL = (1 << 6),
|
||||
/* Stroke Texture is a pattern */
|
||||
GP_MATERIAL_STROKE_PATTERN = (1 << 7),
|
||||
GP_MATERIAL_STROKE_SHOW = (1 << 8), /* Deprecated. Only used for compatibility. */
|
||||
GP_MATERIAL_FILL_SHOW = (1 << 9), /* Deprecated. Only used for compatibility. */
|
||||
/* mix stroke texture */
|
||||
GP_MATERIAL_STROKE_TEX_MIX = (1 << 11),
|
||||
/* disable stencil clipping (overlap) */
|
||||
GP_MATERIAL_DISABLE_STENCIL = (1 << 12),
|
||||
/* Material used as stroke masking. */
|
||||
GP_MATERIAL_IS_STROKE_HOLDOUT = (1 << 13),
|
||||
/* Material used as fill masking. */
|
||||
GP_MATERIAL_IS_FILL_HOLDOUT = (1 << 14),
|
||||
/* Material use randomization. */
|
||||
GP_MATERIAL_USE_DOTS_RANDOMIZATION = static_cast<short>(1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eMaterialGPencilStyle_Flag)
|
||||
|
||||
enum eMaterialGPencilStyle_Mode : int {
|
||||
GP_MATERIAL_MODE_LINE = 0,
|
||||
GP_MATERIAL_MODE_DOT = 1,
|
||||
GP_MATERIAL_MODE_SQUARE = 2,
|
||||
};
|
||||
|
||||
enum eMaterialLineArtFlags : int {
|
||||
LRT_MATERIAL_MASK_ENABLED = (1 << 0),
|
||||
LRT_MATERIAL_CUSTOM_OCCLUSION_EFFECTIVENESS = (1 << 1),
|
||||
LRT_MATERIAL_CUSTOM_INTERSECTION_PRIORITY = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eMaterialLineArtFlags)
|
||||
|
||||
/* maximum number of materials per material array.
|
||||
* (on object, mesh, light, etc.). limited by
|
||||
* short mat_nr in verts, faces.
|
||||
* -1 because for active material we store the index + 1 */
|
||||
#define MAXMAT (32767 - 1)
|
||||
|
||||
/** #Material::flag */
|
||||
enum eMaterial_Flag : short {
|
||||
/** For render. */
|
||||
MA_IS_USED = 1 << 0, /* UNUSED */
|
||||
/** For dope-sheet. */
|
||||
MA_DS_EXPAND = 1 << 1,
|
||||
/**
|
||||
* For dope-sheet (texture stack expander)
|
||||
* NOTE: this must have the same value as other texture stacks,
|
||||
* otherwise anim-editors will not read correctly.
|
||||
*/
|
||||
MA_DS_SHOW_TEXS = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eMaterial_Flag)
|
||||
|
||||
/* ramps */
|
||||
enum eMaterial_RampBlend : int {
|
||||
MA_RAMP_BLEND = 0,
|
||||
MA_RAMP_ADD = 1,
|
||||
MA_RAMP_MULT = 2,
|
||||
MA_RAMP_SUB = 3,
|
||||
MA_RAMP_SCREEN = 4,
|
||||
MA_RAMP_DIV = 5,
|
||||
MA_RAMP_DIFF = 6,
|
||||
MA_RAMP_DARK = 7,
|
||||
MA_RAMP_LIGHT = 8,
|
||||
MA_RAMP_OVERLAY = 9,
|
||||
MA_RAMP_DODGE = 10,
|
||||
MA_RAMP_BURN = 11,
|
||||
MA_RAMP_HUE = 12,
|
||||
MA_RAMP_SAT = 13,
|
||||
MA_RAMP_VAL = 14,
|
||||
MA_RAMP_COLOR = 15,
|
||||
MA_RAMP_SOFT = 16,
|
||||
MA_RAMP_LINEAR = 17,
|
||||
MA_RAMP_EXCLUSION = 18,
|
||||
};
|
||||
|
||||
/** #MTex::texco */
|
||||
enum eMTex_TexCo : int {
|
||||
TEXCO_ORCO = 1 << 0,
|
||||
// TEXCO_REFL = 1 << 1, /* Deprecated. */
|
||||
// TEXCO_NORM = 1 << 2, /* Deprecated. */
|
||||
TEXCO_GLOB = 1 << 3,
|
||||
TEXCO_UV = 1 << 4,
|
||||
TEXCO_OBJECT = 1 << 5,
|
||||
// TEXCO_LAVECTOR = 1 << 6, /* Deprecated. */
|
||||
// TEXCO_VIEW = 1 << 7, /* Deprecated. */
|
||||
// TEXCO_STICKY = 1 << 8, /* Deprecated. */
|
||||
// TEXCO_OSA = 1 << 9, /* Deprecated. */
|
||||
TEXCO_WINDOW = 1 << 10,
|
||||
// NEED_UV = 1 << 11, /* Deprecated. */
|
||||
// TEXCO_TANGENT = 1 << 12, /* Deprecated. */
|
||||
/** still stored in `vertex->accum`, 1 D. */
|
||||
TEXCO_STRAND = 1 << 13,
|
||||
/** strand is used for normal materials, particle for halo materials */
|
||||
TEXCO_PARTICLE = 1 << 13,
|
||||
// TEXCO_STRESS = 1 << 14, /* Deprecated. */
|
||||
// TEXCO_SPEED = 1 << 15, /* Deprecated. */
|
||||
};
|
||||
ENUM_OPERATORS(eMTex_TexCo)
|
||||
|
||||
/** #MTex::mapto */
|
||||
enum eMTex_MapTo : int {
|
||||
MAP_COL = 1 << 0,
|
||||
MAP_ALPHA = 1 << 7,
|
||||
};
|
||||
ENUM_OPERATORS(eMTex_MapTo)
|
||||
|
||||
/** #Material::pr_type */
|
||||
enum ePreviewType : char {
|
||||
MA_FLAT = 0,
|
||||
MA_SPHERE = 1,
|
||||
MA_CUBE = 2,
|
||||
MA_SHADERBALL = 3,
|
||||
MA_SPHERE_A = 4, /* Used for icon renders only. */
|
||||
MA_TEXTURE = 5,
|
||||
MA_LAMP = 6,
|
||||
MA_SKY = 7,
|
||||
MA_HAIR = 10,
|
||||
MA_ATMOS = 11,
|
||||
MA_CLOTH = 12,
|
||||
MA_FLUID = 13,
|
||||
};
|
||||
|
||||
/** #Material::pr_flag */
|
||||
enum eMaterial_PreviewFlag : short {
|
||||
MA_PREVIEW_WORLD = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eMaterial_PreviewFlag)
|
||||
|
||||
/** #Material::surface_render_method */
|
||||
enum eMaterial_SurfaceRenderMethod : char {
|
||||
MA_SURFACE_METHOD_DEFERRED = 0,
|
||||
MA_SURFACE_METHOD_FORWARD = 1,
|
||||
};
|
||||
|
||||
/** #Material::volume_intersection_method */
|
||||
enum eMaterial_VolumeIntersectionMethod : char {
|
||||
MA_VOLUME_ISECT_FAST = 0,
|
||||
MA_VOLUME_ISECT_ACCURATE = 1,
|
||||
};
|
||||
|
||||
/** #Material::blend_method */
|
||||
enum eMaterial_BlendMethod : char {
|
||||
MA_BM_SOLID = 0,
|
||||
// MA_BM_ADD = 1, /* deprecated */
|
||||
// MA_BM_MULTIPLY = 2, /* deprecated */
|
||||
MA_BM_CLIP = 3,
|
||||
MA_BM_HASHED = 4,
|
||||
MA_BM_BLEND = 5,
|
||||
};
|
||||
|
||||
/** #Material::blend_flag */
|
||||
enum eMaterial_BlendFlag : char {
|
||||
MA_BL_HIDE_BACKFACE = (1 << 0),
|
||||
MA_BL_SS_REFRACTION = (1 << 1),
|
||||
MA_BL_CULL_BACKFACE = (1 << 2),
|
||||
MA_BL_TRANSLUCENCY = (1 << 3),
|
||||
MA_BL_LIGHTPROBE_VOLUME_DOUBLE_SIDED = (1 << 4),
|
||||
MA_BL_CULL_BACKFACE_SHADOW = (1 << 5),
|
||||
MA_BL_TRANSPARENT_SHADOW = (1 << 6),
|
||||
MA_BL_THICKNESS_FROM_SHADOW = static_cast<char>(1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eMaterial_BlendFlag)
|
||||
|
||||
/** #Material::blend_shadow */
|
||||
enum eMaterial_BlendShadow : char {
|
||||
MA_BS_NONE = 0,
|
||||
MA_BS_SOLID = 1,
|
||||
MA_BS_CLIP = 2,
|
||||
MA_BS_HASHED = 3,
|
||||
};
|
||||
|
||||
/** #Material::displacement_method */
|
||||
enum eMaterial_DisplacementMethod : char {
|
||||
MA_DISPLACEMENT_BUMP = 0,
|
||||
MA_DISPLACEMENT_DISPLACE = 1,
|
||||
MA_DISPLACEMENT_BOTH = 2,
|
||||
};
|
||||
|
||||
/** #Material::thickness_mode */
|
||||
enum eMaterial_ThicknessMode : char {
|
||||
MA_THICKNESS_SPHERE = 0,
|
||||
MA_THICKNESS_SLAB = 1,
|
||||
};
|
||||
|
||||
/* Grease Pencil Stroke styles */
|
||||
enum eMaterialGPencilStyle_StrokeStyle : short {
|
||||
GP_MATERIAL_STROKE_STYLE_SOLID = 0,
|
||||
GP_MATERIAL_STROKE_STYLE_TEXTURE = 1,
|
||||
};
|
||||
|
||||
/* Grease Pencil Fill styles */
|
||||
enum eMaterialGPencilStyle_FillStyle : short {
|
||||
GP_MATERIAL_FILL_STYLE_SOLID = 0,
|
||||
GP_MATERIAL_FILL_STYLE_GRADIENT = 1,
|
||||
GP_MATERIAL_FILL_STYLE_CHECKER = 2, /* DEPRECATED (only for convert old files) */
|
||||
GP_MATERIAL_FILL_STYLE_TEXTURE = 3,
|
||||
};
|
||||
|
||||
/* Grease Pencil Gradient Types */
|
||||
enum eMaterialGPencilStyle_GradientType : int {
|
||||
GP_MATERIAL_GRADIENT_LINEAR = 0,
|
||||
GP_MATERIAL_GRADIENT_RADIAL = 1,
|
||||
};
|
||||
|
||||
/* Grease Pencil Follow Drawing Modes */
|
||||
enum eMaterialGPencilStyle_FollowMode : int {
|
||||
GP_MATERIAL_FOLLOW_PATH = 0,
|
||||
GP_MATERIAL_FOLLOW_OBJ = 1,
|
||||
GP_MATERIAL_FOLLOW_FIXED = 2,
|
||||
};
|
||||
|
||||
/* Grease Pencil Placement Drawing Modes */
|
||||
enum eMaterialGPencilPlacementMode : int {
|
||||
GP_MATERIAL_PLACEMENT_COUNT = 0,
|
||||
GP_MATERIAL_PLACEMENT_RADIUS = 1,
|
||||
GP_MATERIAL_PLACEMENT_DENSITY = 2,
|
||||
};
|
||||
|
||||
struct TexPaintSlot {
|
||||
DNA_DEFINE_CXX_METHODS(TexPaintSlot)
|
||||
|
||||
/** Image to be painted on. Mutual exclusive with attribute_name. */
|
||||
struct Image *ima = nullptr;
|
||||
struct ImageUser *image_user = nullptr;
|
||||
|
||||
/**
|
||||
* Custom-data index for uv layer, #MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX.
|
||||
* May reference #NodeShaderUVMap::uv_name.
|
||||
*/
|
||||
char *uvname = nullptr;
|
||||
/**
|
||||
* Color attribute name when painting using color attributes. Mutual exclusive with ima.
|
||||
* Points to the name of a CustomDataLayer.
|
||||
*/
|
||||
char *attribute_name = nullptr;
|
||||
/** Do we have a valid image and UV map or attribute. */
|
||||
int valid = 0;
|
||||
/** Copy of node interpolation setting. */
|
||||
int interp = 0;
|
||||
};
|
||||
|
||||
struct MaterialGPencilStyle {
|
||||
DNA_DEFINE_CXX_METHODS(MaterialGPencilStyle)
|
||||
|
||||
/** Texture image for strokes. */
|
||||
struct Image *sima = nullptr;
|
||||
/** Texture image for filling. */
|
||||
struct Image *ima = nullptr;
|
||||
/** Color for paint and strokes (alpha included). */
|
||||
float stroke_rgba[4] = {};
|
||||
/** Color that should be used for drawing "fills" for strokes (alpha included). */
|
||||
float fill_rgba[4] = {};
|
||||
/** Secondary color used for gradients and other stuff. */
|
||||
float mix_rgba[4] = {};
|
||||
/** Settings. */
|
||||
eMaterialGPencilStyle_Flag flag = {};
|
||||
/** Custom index for passes. */
|
||||
short index = 0;
|
||||
/** Style for drawing strokes (used to select shader type). */
|
||||
eMaterialGPencilStyle_StrokeStyle stroke_style = GP_MATERIAL_STROKE_STYLE_SOLID;
|
||||
/** Style for filling areas (used to select shader type). */
|
||||
eMaterialGPencilStyle_FillStyle fill_style = GP_MATERIAL_FILL_STYLE_SOLID;
|
||||
/** Factor used to define shader behavior (several uses). */
|
||||
float mix_factor = 0;
|
||||
/** Angle used for gradients orientation. */
|
||||
DNA_DEPRECATED float gradient_angle = 0;
|
||||
/** Radius for radial gradients. */
|
||||
DNA_DEPRECATED float gradient_radius = 0;
|
||||
char _pad2[4] = {};
|
||||
/** UV coordinates scale. */
|
||||
DNA_DEPRECATED float gradient_scale[2] = {};
|
||||
/** Factor to shift filling in 2d space. */
|
||||
DNA_DEPRECATED float gradient_shift[2] = {};
|
||||
/** Angle used for texture orientation. */
|
||||
float texture_angle = 0;
|
||||
/** Texture scale (separated of uv scale). */
|
||||
float texture_scale[2] = {};
|
||||
/** Factor to shift texture in 2d space. */
|
||||
float texture_offset[2] = {};
|
||||
/** Texture opacity. */
|
||||
DNA_DEPRECATED float texture_opacity = 0;
|
||||
/** Pixel size for uv along the stroke. */
|
||||
float texture_pixsize = 0;
|
||||
/** Drawing mode (line or dots). */
|
||||
eMaterialGPencilStyle_Mode mode = GP_MATERIAL_MODE_LINE;
|
||||
|
||||
/** Type of gradient. */
|
||||
eMaterialGPencilStyle_GradientType gradient_type = GP_MATERIAL_GRADIENT_LINEAR;
|
||||
|
||||
/** Factor used to mix texture and stroke color. */
|
||||
float mix_stroke_factor = 0;
|
||||
/** Mode used to align Dots and Boxes with stroke drawing path and object rotation */
|
||||
eMaterialGPencilStyle_FollowMode alignment_mode = GP_MATERIAL_FOLLOW_PATH;
|
||||
/** Rotation for texture for Dots and Squares. */
|
||||
float alignment_rotation = 0;
|
||||
/** Placement mode for Dots and Squares. */
|
||||
eMaterialGPencilPlacementMode placement_mode = GP_MATERIAL_PLACEMENT_COUNT;
|
||||
/* Number of points per segment when placement mode is `GP_MATERIAL_PLACEMENT_COUNT` */
|
||||
int placement_count = 0;
|
||||
/* Radius factor for points when placement mode is `GP_MATERIAL_PLACEMENT_RADIUS` */
|
||||
float placement_radius_spacing = 0;
|
||||
/* Point density per unit when placement mode is `GP_MATERIAL_PLACEMENT_DENSITY` */
|
||||
float placement_density = 0;
|
||||
|
||||
float random_size_factor = 0;
|
||||
float random_strength_factor = 0;
|
||||
float random_rotation_factor = 0;
|
||||
|
||||
float random_hue_factor = 0;
|
||||
float random_saturation_factor = 0;
|
||||
float random_value_factor = 0;
|
||||
|
||||
float random_noise_scale = 0;
|
||||
char _pad3[4] = {};
|
||||
};
|
||||
|
||||
struct MaterialLineArt {
|
||||
eMaterialLineArtFlags flags = {};
|
||||
|
||||
/* Used to filter line art occlusion edges */
|
||||
unsigned char material_mask_bits = 0;
|
||||
|
||||
/** Maximum 255 levels of equivalent occlusion. */
|
||||
unsigned char mat_occlusion = 1;
|
||||
|
||||
unsigned char intersection_priority = 0;
|
||||
|
||||
char _pad = {};
|
||||
};
|
||||
|
||||
struct Material {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Material)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_MA;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
eMaterial_Flag flag = {};
|
||||
/** Rendering modes for EEVEE. */
|
||||
eMaterial_SurfaceRenderMethod surface_render_method = MA_SURFACE_METHOD_DEFERRED;
|
||||
char _pad1[1] = {};
|
||||
|
||||
/* Colors from Blender Internal that we are still using. */
|
||||
float r = 0.8, g = 0.8, b = 0.8, a = 1.0f;
|
||||
float specr = 1.0, specg = 1.0, specb = 1.0;
|
||||
DNA_DEPRECATED float alpha = 0;
|
||||
DNA_DEPRECATED float ray_mirror = 0;
|
||||
float spec = 0.5;
|
||||
/** Renamed and inversed to roughness. */
|
||||
DNA_DEPRECATED float gloss_mir = 0;
|
||||
float roughness = 0.4f;
|
||||
float metallic = 0;
|
||||
|
||||
/** Nodes */
|
||||
DNA_DEPRECATED char use_nodes = 0;
|
||||
|
||||
/** Preview render. */
|
||||
ePreviewType pr_type = MA_SPHERE;
|
||||
short pr_texture = 0;
|
||||
eMaterial_PreviewFlag pr_flag = {};
|
||||
|
||||
/** Index for render passes. */
|
||||
short index = 0;
|
||||
|
||||
/* #Material::use_nodes is deprecated so it's not possible to create an embedded node tree from
|
||||
* the UI or Python API by setting `use_nodes = True`. Therefore, #nodetree is required to never
|
||||
* be nullptr. */
|
||||
struct bNodeTree *nodetree = nullptr;
|
||||
struct PreviewImage *preview = nullptr;
|
||||
|
||||
/* Freestyle line settings. */
|
||||
float line_col[4] = {};
|
||||
short line_priority = 0;
|
||||
short vcol_alpha = 0;
|
||||
|
||||
/* Texture painting slots. */
|
||||
short paint_active_slot = 0;
|
||||
short paint_clone_slot = 0;
|
||||
short tot_slots = 0;
|
||||
|
||||
/* Displacement. */
|
||||
eMaterial_DisplacementMethod displacement_method = MA_DISPLACEMENT_BUMP;
|
||||
|
||||
/* Thickness. */
|
||||
eMaterial_ThicknessMode thickness_mode = MA_THICKNESS_SPHERE;
|
||||
|
||||
/* Transparency. */
|
||||
float alpha_threshold = 0.5f;
|
||||
float refract_depth = 0;
|
||||
eMaterial_BlendMethod blend_method =
|
||||
MA_BM_SOLID; /* TODO(fclem): Deprecate once we remove legacy EEVEE. */
|
||||
eMaterial_BlendShadow blend_shadow =
|
||||
MA_BS_SOLID; /* TODO(fclem): Deprecate once we remove legacy EEVEE. */
|
||||
eMaterial_BlendFlag blend_flag = MA_BL_TRANSPARENT_SHADOW;
|
||||
|
||||
/* Volume. */
|
||||
eMaterial_VolumeIntersectionMethod volume_intersection_method = MA_VOLUME_ISECT_FAST;
|
||||
|
||||
/* Displacement. */
|
||||
float inflate_bounds = 0;
|
||||
|
||||
char _pad3[4] = {};
|
||||
|
||||
/**
|
||||
* Cached slots for texture painting, must be refreshed via
|
||||
* BKE_texpaint_slot_refresh_cache before using.
|
||||
*/
|
||||
struct TexPaintSlot *texpaintslot = nullptr;
|
||||
|
||||
/** Runtime cache for GLSL materials. */
|
||||
ListBaseT<LinkData> gpumaterial = {nullptr, nullptr};
|
||||
|
||||
/** Grease pencil color. */
|
||||
struct MaterialGPencilStyle *gp_style = nullptr;
|
||||
struct MaterialLineArt lineart;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
598
blender-5.2.0/source/blender/makesdna/DNA_mesh_types.h
Normal file
598
blender-5.2.0/source/blender/makesdna/DNA_mesh_types.h
Normal file
@@ -0,0 +1,598 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_attribute_types.h"
|
||||
#include "DNA_customdata_types.h"
|
||||
#include "DNA_defs.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "BLI_index_mask_fwd.hh"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
#include "BLI_memory_counter_fwd.hh"
|
||||
#include "BLI_vector_set.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
template<typename T> struct Bounds;
|
||||
namespace offset_indices {
|
||||
template<typename T> struct GroupedSpan;
|
||||
template<typename T> class OffsetIndices;
|
||||
} // namespace offset_indices
|
||||
using offset_indices::GroupedSpan;
|
||||
using offset_indices::OffsetIndices;
|
||||
template<typename T> class MutableSpan;
|
||||
template<typename T> class Span;
|
||||
namespace bke {
|
||||
struct BVHTreeFromMesh;
|
||||
struct MeshRuntime;
|
||||
class AttributeAccessor;
|
||||
class MutableAttributeAccessor;
|
||||
enum class MeshNormalDomain : int8_t;
|
||||
} // namespace bke
|
||||
|
||||
struct AnimData;
|
||||
struct bDeformGroup;
|
||||
struct Ipo;
|
||||
struct Key;
|
||||
struct Material;
|
||||
struct MCol;
|
||||
struct MEdge;
|
||||
struct MFace;
|
||||
|
||||
/** #Mesh.texspace_flag */
|
||||
enum eMesh_TexSpaceFlag : char {
|
||||
ME_TEXSPACE_FLAG_AUTO = 1 << 0,
|
||||
ME_TEXSPACE_FLAG_AUTO_EVALUATED = 1 << 1,
|
||||
};
|
||||
ENUM_OPERATORS(eMesh_TexSpaceFlag)
|
||||
|
||||
/** #Mesh.editflag */
|
||||
enum eMesh_EditFlag : char {
|
||||
ME_EDIT_MIRROR_VERTEX_GROUPS = 1 << 0,
|
||||
ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */
|
||||
ME_EDIT_MIRROR_Z = 1 << 2, /* unused so far */
|
||||
|
||||
ME_EDIT_PAINT_FACE_SEL = 1 << 3,
|
||||
ME_EDIT_MIRROR_TOPO = 1 << 4,
|
||||
ME_EDIT_PAINT_VERT_SEL = 1 << 5,
|
||||
};
|
||||
ENUM_OPERATORS(eMesh_EditFlag)
|
||||
|
||||
/* Helper macro to see if vertex group X mirror is on. */
|
||||
#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me) \
|
||||
(((_me)->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && ((_me)->symmetry & ME_SYMMETRY_X))
|
||||
|
||||
/* We can't have both flags enabled at once,
|
||||
* flags defined in DNA_scene_types.h */
|
||||
#define ME_EDIT_PAINT_SEL_MODE(_me) \
|
||||
(((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? SCE_SELECT_FACE : \
|
||||
((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \
|
||||
0)
|
||||
|
||||
/** #Mesh.flag */
|
||||
enum eMesh_Flag : uint16_t {
|
||||
ME_FLAG_UNUSED_0 = 1 << 0, /* cleared */
|
||||
ME_FLAG_UNUSED_1 = 1 << 1, /* cleared */
|
||||
ME_FLAG_DEPRECATED_2 = 1 << 2, /* deprecated */
|
||||
/**
|
||||
* The UV selection is marked as synchronized.
|
||||
* See #BMesh::uv_select_sync_valid for details.
|
||||
*/
|
||||
ME_FLAG_UV_SELECT_SYNC_VALID = 1 << 3,
|
||||
ME_FLAG_UNUSED_4 = 1 << 4, /* cleared */
|
||||
ME_AUTOSMOOTH_LEGACY = 1 << 5, /* deprecated */
|
||||
ME_FLAG_UNUSED_6 = 1 << 6, /* cleared */
|
||||
ME_FLAG_UNUSED_7 = 1 << 7, /* cleared */
|
||||
ME_REMESH_REPROJECT_ATTRIBUTES = 1 << 8,
|
||||
ME_DS_EXPAND = 1 << 9,
|
||||
ME_SCULPT_DYNAMIC_TOPOLOGY = 1 << 10,
|
||||
/**
|
||||
* Used to tag that the mesh has no overlapping topology (see #Mesh::no_overlapping_topology()).
|
||||
* Theoretically this is runtime data that could always be recalculated, but since the intent is
|
||||
* to improve performance and it only takes one bit, it is stored in the mesh instead.
|
||||
*/
|
||||
ME_NO_OVERLAPPING_TOPOLOGY = 1 << 11,
|
||||
ME_FLAG_UNUSED_8 = 1 << 12, /* deprecated */
|
||||
ME_REMESH_FIX_POLES = 1 << 13,
|
||||
ME_REMESH_REPROJECT_VOLUME = 1 << 14,
|
||||
ME_FLAG_UNUSED_9 = 1 << 15, /* deprecated */
|
||||
};
|
||||
ENUM_OPERATORS(eMesh_Flag)
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** #Mesh.cd_flag */
|
||||
enum eMesh_CDFlag : char {
|
||||
ME_CDFLAG_VERT_BWEIGHT = 1 << 0,
|
||||
ME_CDFLAG_EDGE_BWEIGHT = 1 << 1,
|
||||
ME_CDFLAG_EDGE_CREASE = 1 << 2,
|
||||
ME_CDFLAG_VERT_CREASE = 1 << 3,
|
||||
};
|
||||
ENUM_OPERATORS(eMesh_CDFlag)
|
||||
#endif
|
||||
|
||||
/** #Mesh.remesh_mode */
|
||||
enum eMesh_RemeshMode : char {
|
||||
REMESH_VOXEL = 0,
|
||||
REMESH_QUAD = 1,
|
||||
};
|
||||
|
||||
/** #SubsurfModifierData.subdivType */
|
||||
enum MeshSubdivType : int {
|
||||
ME_CC_SUBSURF = 0,
|
||||
ME_SIMPLE_SUBSURF = 1,
|
||||
};
|
||||
|
||||
/** #Mesh.symmetry */
|
||||
enum eMeshSymmetryType : char {
|
||||
ME_SYMMETRY_X = 1 << 0,
|
||||
ME_SYMMETRY_Y = 1 << 1,
|
||||
ME_SYMMETRY_Z = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eMeshSymmetryType)
|
||||
|
||||
struct Mesh {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Mesh)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_ME;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
struct Key *key = nullptr;
|
||||
|
||||
/**
|
||||
* An array of materials, with length #totcol. These can be overridden by material slots
|
||||
* on #Object. Indices in the "material_index" attribute control which material is used for every
|
||||
* face.
|
||||
*/
|
||||
struct Material **mat = nullptr;
|
||||
|
||||
/** The number of vertices in the mesh, and the size of #vert_data. */
|
||||
int verts_num = 0;
|
||||
/** The number of edges in the mesh, and the size of #edge_data. */
|
||||
int edges_num = 0;
|
||||
/** The number of faces in the mesh, and the size of #face_data. */
|
||||
int faces_num = 0;
|
||||
/** The number of face corners in the mesh, and the size of #corner_data. */
|
||||
int corners_num = 0;
|
||||
|
||||
/**
|
||||
* Array owned by mesh. See #Mesh::faces() and #OffsetIndices.
|
||||
*
|
||||
* This array is shared based on the bke::MeshRuntime::face_offsets_sharing_info.
|
||||
* Avoid accessing directly when possible.
|
||||
*/
|
||||
int *face_offset_indices = nullptr;
|
||||
|
||||
/**
|
||||
* Vertex, edge, face, and corner generic attributes.
|
||||
*/
|
||||
struct AttributeStorage attribute_storage;
|
||||
|
||||
/** Store for non-generic layer data on each domain. */
|
||||
CustomData vert_data;
|
||||
CustomData edge_data;
|
||||
CustomData face_data;
|
||||
CustomData corner_data;
|
||||
|
||||
/**
|
||||
* List of vertex group (#bDeformGroup) names and flags only. Actual weights are stored in dvert.
|
||||
* \note This pointer is for convenient access to the #CD_MDEFORMVERT layer in #vert_data.
|
||||
*/
|
||||
ListBaseT<bDeformGroup> vertex_group_names = {nullptr, nullptr};
|
||||
/** The active index in the #vertex_group_names list. */
|
||||
int vertex_group_active_index = 0;
|
||||
|
||||
/**
|
||||
* The index of the active attribute in the UI. The attribute list is a combination of the
|
||||
* generic type attributes from vertex, edge, face, and corner custom data.
|
||||
*
|
||||
* Set to -1 when none is active.
|
||||
*
|
||||
* This default should actually be -1, and setting this to 0 can lead to internal attributes
|
||||
* being active. However changing would need quite some research into where this index is used
|
||||
* and on top of that other object types also use this same index, also set to 0.
|
||||
* As we plan to store the active attribute as a string in the future we leave it at 0
|
||||
* for now.
|
||||
*/
|
||||
int attributes_active_index = 0;
|
||||
|
||||
/**
|
||||
* This array represents the selection order when the user manually picks elements in edit-mode,
|
||||
* some tools take advantage of this information. All elements in this array are expected to be
|
||||
* selected, see #BKE_mesh_mselect_validate which ensures this. For procedurally created meshes,
|
||||
* this is generally empty (selections are stored as boolean attributes in the corresponding
|
||||
* custom data).
|
||||
*/
|
||||
struct MSelect *mselect = nullptr;
|
||||
|
||||
/** The length of the #mselect array. */
|
||||
int totselect = 0;
|
||||
|
||||
/**
|
||||
* In most cases the last selected element (see #mselect) represents the active element.
|
||||
* For faces we make an exception and store the active face separately so it can be active
|
||||
* even when no faces are selected. This is done to prevent flickering in the material properties
|
||||
* and UV Editor which base the content they display on the current material which is controlled
|
||||
* by the active face.
|
||||
*
|
||||
* \note This is mainly stored for use in edit-mode.
|
||||
*/
|
||||
int act_face = 0;
|
||||
|
||||
/**
|
||||
* An optional mesh owned elsewhere (by #Main) that can be used to override
|
||||
* the texture space #loc and #size.
|
||||
* \note Vertex indices should be aligned for this to work usefully.
|
||||
*/
|
||||
struct Mesh *texcomesh = nullptr;
|
||||
|
||||
/** Texture space location and size, used for procedural coordinates when rendering. */
|
||||
float texspace_location[3] = {};
|
||||
float texspace_size[3] = {1.0f, 1.0f, 1.0f};
|
||||
char texspace_flag = ME_TEXSPACE_FLAG_AUTO;
|
||||
|
||||
/** Various flags used when editing the mesh. */
|
||||
eMesh_EditFlag editflag = ME_EDIT_MIRROR_VERTEX_GROUPS;
|
||||
/** Mostly more flags used when editing or displaying the mesh. */
|
||||
eMesh_Flag flag = ME_REMESH_REPROJECT_VOLUME | ME_REMESH_REPROJECT_ATTRIBUTES;
|
||||
|
||||
DNA_DEPRECATED float smoothresh_legacy = 0;
|
||||
|
||||
/** Per-mesh settings for voxel remesh. */
|
||||
float remesh_voxel_size = 0.1f;
|
||||
float remesh_voxel_adaptivity = 0.0f;
|
||||
|
||||
int face_sets_color_seed = 0;
|
||||
/* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
|
||||
* default and Face Sets can be used without affecting the color of the mesh. */
|
||||
int face_sets_color_default = 1;
|
||||
|
||||
/** The color attribute currently selected in the list and edited by a user. */
|
||||
char *active_color_attribute = nullptr;
|
||||
/** The color attribute used by default (i.e. for rendering) if no name is given explicitly. */
|
||||
char *default_color_attribute = nullptr;
|
||||
|
||||
/**
|
||||
* The UV map currently selected in the list and edited by a user.
|
||||
* \note While the edit BMesh (`edit_mesh.bm`) is non null, that is the source of truth instead.
|
||||
* Typical access should be through #Mesh::active_uv_map_name() rather than direct.
|
||||
*/
|
||||
char *active_uv_map_attribute = nullptr;
|
||||
/**
|
||||
* The UV map used by default (i.e. for rendering) if no name is given explicitly.
|
||||
* \note While the edit BMesh (`edit_mesh.bm`) is non null, that is the source of truth instead.
|
||||
* Typical access should be through #Mesh::default_uv_map_name() rather than direct.
|
||||
*/
|
||||
char *default_uv_map_attribute = nullptr;
|
||||
/** UV map selection used for texture paint masking. */
|
||||
char *stencil_uv_map_attribute = nullptr;
|
||||
/** UV map selection used for texture paint clone brush. */
|
||||
char *clone_uv_map_attribute = nullptr;
|
||||
|
||||
/**
|
||||
* User-defined symmetry flag that causes editing operations to maintain
|
||||
* symmetrical geometry. Supported by operations such as transform and weight-painting.
|
||||
*/
|
||||
eMeshSymmetryType symmetry = {};
|
||||
|
||||
/** Choice between different remesh methods in the UI. */
|
||||
eMesh_RemeshMode remesh_mode = REMESH_VOXEL;
|
||||
|
||||
/** The length of the #mat array. */
|
||||
short totcol = 0;
|
||||
|
||||
/**
|
||||
* Deprecated flag for choosing whether to store specific custom data that was built into #Mesh
|
||||
* structs in edit mode. Replaced by separating that data to separate layers. Kept for forward
|
||||
* and backwards compatibility.
|
||||
*/
|
||||
DNA_DEPRECATED char cd_flag = 0;
|
||||
DNA_DEPRECATED char subdiv = 0;
|
||||
DNA_DEPRECATED char subdivr = 0;
|
||||
DNA_DEPRECATED char subsurftype = 0;
|
||||
|
||||
/** Deprecated pointer to mesh polygons, kept for forward compatibility. */
|
||||
DNA_DEPRECATED struct MPoly *mpoly = nullptr;
|
||||
/** Deprecated pointer to face corners, kept for forward compatibility. */
|
||||
DNA_DEPRECATED struct MLoop *mloop = nullptr;
|
||||
|
||||
/** Deprecated array of mesh vertices, kept for reading old files, now stored in #CustomData. */
|
||||
DNA_DEPRECATED struct MVert *mvert = nullptr;
|
||||
/** Deprecated array of mesh edges, kept for reading old files, now stored in #CustomData. */
|
||||
DNA_DEPRECATED struct MEdge *medge = nullptr;
|
||||
/** Deprecated "Vertex group" data. Kept for reading old files, now stored in #CustomData. */
|
||||
DNA_DEPRECATED struct MDeformVert *dvert = nullptr;
|
||||
/** Deprecated runtime data for tessellation face UVs and texture, kept for reading old files. */
|
||||
DNA_DEPRECATED struct MTFace *mtface = nullptr;
|
||||
/** Deprecated, use mtface. */
|
||||
DNA_DEPRECATED struct TFace *tface = nullptr;
|
||||
/** Deprecated array of colors for the tessellated faces, kept for reading old files. */
|
||||
DNA_DEPRECATED struct MCol *mcol = nullptr;
|
||||
/** Deprecated face storage (quads & triangles only). Kept for reading old files. */
|
||||
DNA_DEPRECATED struct MFace *mface = nullptr;
|
||||
|
||||
/**
|
||||
* Deprecated storage of old faces (only triangles or quads).
|
||||
*
|
||||
* \note This would be marked deprecated, however the particles still use this at run-time
|
||||
* for placing particles on the mesh (something which should be eventually upgraded).
|
||||
*/
|
||||
CustomData fdata_legacy;
|
||||
/* Deprecated size of #fdata. */
|
||||
int totface_legacy = 0;
|
||||
|
||||
char _pad1 = {};
|
||||
int8_t radial_symmetry[3] = {1, 1, 1};
|
||||
|
||||
/**
|
||||
* Data that isn't saved in files, including caches of derived data, temporary data to improve
|
||||
* the editing experience, etc. The struct is created when reading files and can be accessed
|
||||
* without null checks, with the exception of some temporary meshes which should allocate and
|
||||
* free the data if they are passed to functions that expect run-time data.
|
||||
*/
|
||||
bke::MeshRuntime *runtime = nullptr;
|
||||
#ifdef __cplusplus
|
||||
/**
|
||||
* Array of vertex positions. Edges and face corners are defined by indices into this array.
|
||||
*/
|
||||
Span<float3> vert_positions() const;
|
||||
/** Write access to vertex data. */
|
||||
MutableSpan<float3> vert_positions_for_write();
|
||||
/**
|
||||
* Array of edges, containing vertex indices, stored in the ".edge_verts" attribute. For simple
|
||||
* triangle or quad meshes, edges could be calculated from the face and #corner_edge arrays.
|
||||
* However, edges need to be stored explicitly for edge domain attributes and to support loose
|
||||
* edges that aren't connected to faces.
|
||||
*/
|
||||
Span<int2> edges() const;
|
||||
/** Write access to edge data. */
|
||||
MutableSpan<int2> edges_for_write();
|
||||
/**
|
||||
* Face topology information (using the same internal data as #face_offsets()). Each face is a
|
||||
* contiguous chunk of face corners represented as an #IndexRange. Each face can be used to slice
|
||||
* the #corner_verts or #corner_edges arrays to find the vertices or edges that each face uses.
|
||||
*/
|
||||
OffsetIndices<int> faces() const;
|
||||
/**
|
||||
* Return an array containing the first corner of each face. and the size of the face encoded as
|
||||
* the next offset. The total number of corners is the final value, and the first value is always
|
||||
* zero. May be empty if there are no faces.
|
||||
*/
|
||||
Span<int> face_offsets() const;
|
||||
/** Write access to #face_offsets data. */
|
||||
MutableSpan<int> face_offsets_for_write();
|
||||
|
||||
/**
|
||||
* Array of vertices for every face corner, stored in the ".corner_vert" integer attribute.
|
||||
* For example, the vertices in a face can be retrieved with the #slice method:
|
||||
* \code{.cc}
|
||||
* const Span<int> face_verts = corner_verts.slice(face);
|
||||
* \endcode
|
||||
* This span can often be passed as an argument in lieu of a face and the entire corner verts
|
||||
* array.
|
||||
*/
|
||||
Span<int> corner_verts() const;
|
||||
/** Write access to the #corner_verts data. */
|
||||
MutableSpan<int> corner_verts_for_write();
|
||||
|
||||
/**
|
||||
* Array of edges following every face corner traveling around each face, stored in the
|
||||
* ".corner_edge" attribute. The array sliced the same way as the #corner_verts data. The edge
|
||||
* previous to a corner must be accessed with the index of the previous face corner.
|
||||
*/
|
||||
Span<int> corner_edges() const;
|
||||
/** Write access to the #corner_edges data. */
|
||||
MutableSpan<int> corner_edges_for_write();
|
||||
|
||||
bke::AttributeAccessor attributes() const;
|
||||
bke::MutableAttributeAccessor attributes_for_write();
|
||||
|
||||
/**
|
||||
* The names of all UV map attributes, in the order of the internal storage.
|
||||
* This is useful when UV maps are referenced by index.
|
||||
*
|
||||
* \warning Adding or removing attributes will invalidate the referenced memory.
|
||||
*/
|
||||
VectorSet<StringRefNull> uv_map_names() const;
|
||||
|
||||
/** The name of the active UV map attribute, if any. */
|
||||
StringRefNull active_uv_map_name() const;
|
||||
/** The name of the default UV map (e.g. for rendering) attribute, if any. */
|
||||
StringRefNull default_uv_map_name() const;
|
||||
/** The active UV map name, falling back to the default if no active map is set. */
|
||||
StringRefNull active_or_default_uv_map_name() const;
|
||||
|
||||
void uv_maps_active_set(StringRef name);
|
||||
void uv_maps_default_set(StringRef name);
|
||||
|
||||
/**
|
||||
* Vertex group data, encoded as an array of indices and weights for every vertex.
|
||||
* \warning: May be empty.
|
||||
*/
|
||||
Span<MDeformVert> deform_verts() const;
|
||||
/** Write access to vertex group data. */
|
||||
MutableSpan<MDeformVert> deform_verts_for_write();
|
||||
|
||||
/**
|
||||
* Cached triangulation of mesh faces, depending on the face topology and the vertex positions.
|
||||
*/
|
||||
Span<int3> corner_tris() const;
|
||||
|
||||
/**
|
||||
* A map containing the face index that each cached triangle from #Mesh::corner_tris() came from.
|
||||
*/
|
||||
Span<int> corner_tri_faces() const;
|
||||
|
||||
/**
|
||||
* Calculate the largest and smallest position values of vertices.
|
||||
*/
|
||||
std::optional<Bounds<float3>> bounds_min_max() const;
|
||||
|
||||
/** Set cached mesh bounds to a known-correct value to avoid their lazy calculation later on. */
|
||||
void bounds_set_eager(const Bounds<float3> &bounds);
|
||||
|
||||
/** Get the largest material index used by the mesh or `nullopt` if it has no faces. */
|
||||
std::optional<int> material_index_max() const;
|
||||
|
||||
/** Get all the material indices actually used by the mesh. */
|
||||
const VectorSet<int> &material_indices_used() const;
|
||||
|
||||
/**
|
||||
* Cached map containing the index of the face using each face corner.
|
||||
*/
|
||||
Span<int> corner_to_face_map() const;
|
||||
/**
|
||||
* Offsets per vertex used to slice arrays containing data for connected faces or face corners.
|
||||
*/
|
||||
OffsetIndices<int> vert_to_face_map_offsets() const;
|
||||
/**
|
||||
* Cached map from each vertex to the corners using it.
|
||||
*/
|
||||
GroupedSpan<int> vert_to_corner_map() const;
|
||||
/**
|
||||
* Cached map from each vertex to the faces using it.
|
||||
*/
|
||||
GroupedSpan<int> vert_to_face_map() const;
|
||||
|
||||
/**
|
||||
* Cached information about loose edges, calculated lazily when necessary.
|
||||
*/
|
||||
const IndexMask &loose_edges() const;
|
||||
/**
|
||||
* Cached information about vertices that aren't used by any edges.
|
||||
*/
|
||||
const IndexMask &loose_verts() const;
|
||||
/**
|
||||
* Cached information about vertices that aren't used by faces (but may be used by loose edges).
|
||||
*/
|
||||
const IndexMask &verts_no_face() const;
|
||||
/**
|
||||
* True if the mesh has no faces or edges "inside" of other faces. Those edges or faces would
|
||||
* reuse a subset of the vertices of a face. Knowing the mesh is "clean" or "good" can mean
|
||||
* algorithms can skip checking for duplicate edges and faces when they create new edges and
|
||||
* faces inside of faces.
|
||||
*
|
||||
* \note This is just a hint, so there still might be no overlapping geometry if it is false.
|
||||
*/
|
||||
bool no_overlapping_topology() const;
|
||||
|
||||
/**
|
||||
* Explicitly set the cached number of loose edges to zero. This can improve performance
|
||||
* later on, because finding loose edges lazily can be skipped entirely.
|
||||
*
|
||||
* \note To allow setting this status on meshes without changing them, this does not tag the
|
||||
* cache dirty. If the mesh was changed first, the relevant dirty tags should be called first.
|
||||
*/
|
||||
void tag_loose_edges_none() const;
|
||||
/**
|
||||
* Set the number of vertices not connected to edges to zero. Similar to #tag_loose_edges_none().
|
||||
* There may still be vertices only used by loose edges though.
|
||||
*
|
||||
* \note If both #tag_loose_edges_none() and #tag_loose_verts_none() are called,
|
||||
* all vertices are used by faces, so #verts_no_faces() will be tagged empty as well.
|
||||
*/
|
||||
void tag_loose_verts_none() const;
|
||||
/** Set the #no_overlapping_topology() hint when the mesh is "clean." */
|
||||
void tag_overlapping_none();
|
||||
|
||||
/**
|
||||
* Returns the least complex attribute domain needed to store normals encoding all relevant mesh
|
||||
* data. When all edges or faces are sharp, face normals are enough. When all are smooth, vertex
|
||||
* normals are enough. With a combination of sharp and smooth, normals may be "split",
|
||||
* requiring face corner storage.
|
||||
*
|
||||
* When possible, it's preferred to use face normals over vertex normals and vertex normals over
|
||||
* face corner normals, since there is a 2-4x performance cost increase for each more complex
|
||||
* domain.
|
||||
*/
|
||||
bke::MeshNormalDomain normals_domain() const;
|
||||
/**
|
||||
* Normal direction of faces, defined by positions and the winding direction of face corners.
|
||||
*/
|
||||
Span<float3> face_normals() const;
|
||||
Span<float3> face_normals_true() const;
|
||||
/**
|
||||
* Normal direction of vertices, defined as the weighted average of face normals
|
||||
* surrounding each vertex and the normalized position for loose vertices.
|
||||
*/
|
||||
Span<float3> vert_normals() const;
|
||||
Span<float3> vert_normals_true() const;
|
||||
/**
|
||||
* Normal direction at each face corner. Defined by a combination of face normals, vertex
|
||||
* normals, the `sharp_edge` and `sharp_face` attributes, and potentially by custom normals.
|
||||
*
|
||||
* \note Because of the large memory requirements of storing normals per face corner, prefer
|
||||
* using #face_normals() or #vert_normals() when possible (see #normals_domain()). For this
|
||||
* reason, the "true" face corner normals aren't cached, since they're just the same as the
|
||||
* corresponding face normals.
|
||||
*/
|
||||
Span<float3> corner_normals() const;
|
||||
|
||||
bke::BVHTreeFromMesh bvh_verts() const;
|
||||
bke::BVHTreeFromMesh bvh_edges() const;
|
||||
bke::BVHTreeFromMesh bvh_legacy_faces() const;
|
||||
bke::BVHTreeFromMesh bvh_corner_tris() const;
|
||||
bke::BVHTreeFromMesh bvh_corner_tris_no_hidden() const;
|
||||
bke::BVHTreeFromMesh bvh_loose_verts() const;
|
||||
bke::BVHTreeFromMesh bvh_loose_edges() const;
|
||||
bke::BVHTreeFromMesh bvh_loose_no_hidden_verts() const;
|
||||
bke::BVHTreeFromMesh bvh_loose_no_hidden_edges() const;
|
||||
|
||||
void count_memory(MemoryCounter &memory) const;
|
||||
|
||||
/** Call after changing vertex positions to tag lazily calculated caches for recomputation. */
|
||||
void tag_positions_changed();
|
||||
/** Call after moving every mesh vertex by the same translation. */
|
||||
void tag_positions_changed_uniformly();
|
||||
/** Like #tag_positions_changed but doesn't tag normals; they must be updated separately. */
|
||||
void tag_positions_changed_no_normals();
|
||||
/** Call when changing "sharp_face" or "sharp_edge" data. */
|
||||
void tag_sharpness_changed();
|
||||
/** Call when changing "custom_normal" data. */
|
||||
void tag_custom_normals_changed();
|
||||
/** Call when face vertex order has changed but positions and faces haven't changed. */
|
||||
void tag_face_winding_changed();
|
||||
/** Call when new edges and vertices have been created but vertices and faces haven't changed. */
|
||||
void tag_edges_split();
|
||||
/** Call for topology updates not described by other update tags. */
|
||||
void tag_topology_changed();
|
||||
/** Call when changing the ".hide_vert", ".hide_edge", or ".hide_poly" attributes. */
|
||||
void tag_visibility_changed();
|
||||
/** Call when changing the "material_index" attribute. */
|
||||
void tag_material_index_changed();
|
||||
#endif
|
||||
};
|
||||
|
||||
/* deprecated by MTFace, only here for file reading */
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
struct TFace {
|
||||
DNA_DEFINE_CXX_METHODS(TFace)
|
||||
|
||||
/** The faces image for the active UVLayer. */
|
||||
void *tpage = nullptr;
|
||||
float uv[4][2] = {};
|
||||
unsigned int col[4] = {};
|
||||
char flag = 0, transp = 0;
|
||||
short mode = 0, tile = 0, unwrap = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
#define MESH_MAX_VERTS 2000000000L
|
||||
|
||||
} // namespace blender
|
||||
458
blender-5.2.0/source/blender/makesdna/DNA_meshdata_types.h
Normal file
458
blender-5.2.0/source/blender/makesdna/DNA_meshdata_types.h
Normal file
@@ -0,0 +1,458 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Ordered Selection Storage
|
||||
* \{ */
|
||||
|
||||
/** #MSelect.type */
|
||||
enum eMSelect_Type : int {
|
||||
ME_VSEL = 0,
|
||||
ME_ESEL = 1,
|
||||
ME_FSEL = 2,
|
||||
};
|
||||
|
||||
enum eMVertSkinFlag : int {
|
||||
/**
|
||||
* Marks a vertex as the edge-graph root, used for calculating rotations for all connected
|
||||
* edges (recursively). Also used to choose a root when generating an armature.
|
||||
*/
|
||||
MVERT_SKIN_ROOT = 1,
|
||||
|
||||
/**
|
||||
* Marks a branch vertex (vertex with more than two connected edges), so that its neighbors
|
||||
* are directly hulled together, rather than the default of generating intermediate frames.
|
||||
*/
|
||||
MVERT_SKIN_LOOSE = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eMVertSkinFlag)
|
||||
|
||||
/** #MFace.edcode */
|
||||
enum eMFace_EdgeCode : char {
|
||||
ME_V1V2 = (1 << 0),
|
||||
ME_V2V3 = (1 << 1),
|
||||
ME_V3V1 = (1 << 2),
|
||||
ME_V3V4 = ME_V3V1,
|
||||
ME_V4V1 = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eMFace_EdgeCode)
|
||||
|
||||
/**
|
||||
* Optionally store the order of selected elements.
|
||||
* This won't always be set since only some selection operations have an order.
|
||||
*
|
||||
* Typically accessed from #Mesh.mselect
|
||||
*/
|
||||
struct MSelect {
|
||||
/** Index in the vertex, edge or polygon array. */
|
||||
int index;
|
||||
eMSelect_Type type;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Loop Tessellation Runtime Data
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* #Mesh::corner_tris() gives access to runtime triangulation data for #Mesh, for functionality
|
||||
* that doesn't support ngons.
|
||||
*
|
||||
* Typical usage includes:
|
||||
* - Viewport drawing.
|
||||
* - #BVHTree creation.
|
||||
* - Physics/collision detection.
|
||||
*
|
||||
* A mesh's triangulation data, which uses a cache that is lazily calculated from faces, corner
|
||||
* vert, and position arrays. In rare cases it is calculated directly too, with
|
||||
* #bke::mesh::corner_tris_calc. When the underlying mesh data changes, the array is recalculated
|
||||
* from scratch; there is no extra attempt to maintain the validity over time.
|
||||
*
|
||||
* Triangles are stored in an array, where triangles from each face are stored sequentially. The
|
||||
* triangles order is guaranteed to match the face order where the first triangle will always be
|
||||
* from the first face, and the last triangle from the last face. The number of triangles for each
|
||||
* polygon is guaranteed to be the corner count - 2, even for degenerate geometry (see
|
||||
* #bke::mesh::face_triangles_num).
|
||||
*
|
||||
* Storing corner indices (instead of vertex indices) gives more flexibility for accessing mesh
|
||||
* data stored per-corner, though it does often add an extra level of indirection. The index of the
|
||||
* corresponding face for each triangle is stored in a separate array, accessed with
|
||||
* #Mesh::corner_tri_faces().
|
||||
*
|
||||
* Examples:
|
||||
* \code{.cc}
|
||||
* // Access vertex locations.
|
||||
* std::array<float3, 3> tri_positions{
|
||||
* positions[corner_verts[tri[0]]],
|
||||
* positions[corner_verts[tri[1]]],
|
||||
* positions[corner_verts[tri[2]]],
|
||||
* };
|
||||
*
|
||||
* // Access UV coordinates (works for all face corner data, vertex colors... etc).
|
||||
* std::array<float2, 3> tri_uvs{
|
||||
* uv_map[tri[0]],
|
||||
* uv_map[tri[1]],
|
||||
* uv_map[tri[2]],
|
||||
* };
|
||||
*
|
||||
* // Access all triangles in a given face.
|
||||
* const Span<int3> corner_tris = corner_tris.slice(face_triangles_range(faces, i));
|
||||
* \endcode
|
||||
*
|
||||
* It may also be useful to check whether or not two vertices of a triangle form an edge in the
|
||||
* underlying mesh. See #bke::mesh::corner_tri for a utility that does this. Note
|
||||
* that a triangle may be in the middle of an ngon and not reference **any**
|
||||
* real edges.
|
||||
*/
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Custom Data (Generic)
|
||||
* \{ */
|
||||
|
||||
/** Custom Data Properties */
|
||||
struct MFloatProperty {
|
||||
float f;
|
||||
};
|
||||
|
||||
struct MIntProperty {
|
||||
int i;
|
||||
};
|
||||
|
||||
/** Byte string, no encoding implied. May not be null terminated. */
|
||||
struct MStringProperty {
|
||||
char s[255], s_len;
|
||||
};
|
||||
|
||||
struct MBoolProperty {
|
||||
uint8_t b;
|
||||
};
|
||||
|
||||
struct MInt8Property {
|
||||
int8_t i;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Custom Data (Vertex)
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Vertex group index and weight for #MDeformVert.dw
|
||||
*/
|
||||
struct MDeformWeight {
|
||||
/** The index for the vertex group, must *always* be unique when in an array. */
|
||||
unsigned int def_nr;
|
||||
/** Weight between 0.0 and 1.0. */
|
||||
float weight;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stores all of an element's vertex groups, and their weight values.
|
||||
*/
|
||||
struct MDeformVert {
|
||||
/**
|
||||
* Array of weight indices and values.
|
||||
* - There must not be any duplicate #def_nr indices.
|
||||
* - Groups in the array are unordered.
|
||||
* - Indices outside the usable range of groups are ignored.
|
||||
*/
|
||||
struct MDeformWeight *dw;
|
||||
/**
|
||||
* The length of the #dw array.
|
||||
* \note This is not necessarily the same length as the total number of vertex groups.
|
||||
* However, generally it isn't larger.
|
||||
*/
|
||||
int totweight;
|
||||
/** Flag is only in use as a run-time tag at the moment. */
|
||||
int flag;
|
||||
};
|
||||
|
||||
struct MVertSkin {
|
||||
/**
|
||||
* Radii of the skin, define how big the generated frames are.
|
||||
* Currently only the first two elements are used.
|
||||
*/
|
||||
float radius[3];
|
||||
|
||||
eMVertSkinFlag flag;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Custom Data (Loop)
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* \note While alpha is not currently in the 3D Viewport,
|
||||
* this may eventually be added back, keep this value set to 255.
|
||||
*/
|
||||
struct MLoopCol {
|
||||
unsigned char r, g, b, a;
|
||||
};
|
||||
|
||||
struct MPropCol {
|
||||
float color[4];
|
||||
};
|
||||
|
||||
/** Multi-Resolution loop data. */
|
||||
struct MDisps {
|
||||
/* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */
|
||||
int totdisp;
|
||||
int level;
|
||||
float (*disps)[3];
|
||||
|
||||
/**
|
||||
* Used for hiding parts of a multires mesh.
|
||||
* Essentially the multires equivalent of the mesh ".hide_vert" boolean attribute.
|
||||
*
|
||||
* \note This is a bitmap, keep in sync with type used in BLI_bitmap.h
|
||||
*/
|
||||
unsigned int *hidden;
|
||||
};
|
||||
|
||||
/** Multi-Resolution grid loop data. */
|
||||
struct GridPaintMask {
|
||||
/**
|
||||
* The data array contains `grid_size * grid_size` elements.
|
||||
* Where `grid_size = (1 << (level - 1)) + 1`.
|
||||
*/
|
||||
float *data;
|
||||
|
||||
/** The maximum multires level associated with this grid. */
|
||||
unsigned int level;
|
||||
|
||||
char _pad[4];
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Custom Data (Original Space for Poly, Face)
|
||||
* \{ */
|
||||
|
||||
/**
|
||||
* Original space within a face (similar to UV coordinates),
|
||||
* however they are used to determine the original position in a face.
|
||||
*
|
||||
* Unlike UVs these are not user editable and always start out using a fixed 0-1 range.
|
||||
* Currently only used for particle placement.
|
||||
*/
|
||||
#
|
||||
#
|
||||
struct OrigSpaceFace {
|
||||
float uv[4][2];
|
||||
};
|
||||
|
||||
#
|
||||
#
|
||||
struct OrigSpaceLoop {
|
||||
float uv[2];
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Custom Data (FreeStyle for Edge, Face)
|
||||
* \{ */
|
||||
|
||||
/** #FreestyleEdge.flag */
|
||||
enum eFreestyleEdge_Flag : char {
|
||||
FREESTYLE_EDGE_MARK = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eFreestyleEdge_Flag)
|
||||
|
||||
struct FreestyleEdge {
|
||||
eFreestyleEdge_Flag flag;
|
||||
};
|
||||
|
||||
/** #FreestyleFace.flag */
|
||||
enum eFreestyleFace_Flag : char {
|
||||
FREESTYLE_FACE_MARK = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eFreestyleFace_Flag)
|
||||
|
||||
struct FreestyleFace {
|
||||
eFreestyleFace_Flag flag;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Deprecated Structs
|
||||
* \{ */
|
||||
|
||||
/** #MEdge.flag */
|
||||
enum eMEdge_Flag : short {
|
||||
/** Deprecated selection status. Now stored in ".select_edge" attribute. */
|
||||
// SELECT = (1 << 0),
|
||||
ME_SEAM = (1 << 2),
|
||||
/** Deprecated hide status. Now stored in ".hide_edge" attribute. */
|
||||
// ME_HIDE = (1 << 4),
|
||||
/** Deprecated loose edge status. Now stored in #Mesh::loose_edges() runtime cache. */
|
||||
ME_LOOSEEDGE = (1 << 7),
|
||||
/** Deprecated sharp edge status. Now stored in "sharp_edge" attribute. */
|
||||
ME_SHARP = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(eMEdge_Flag)
|
||||
|
||||
/**
|
||||
* Mesh Edges.
|
||||
*
|
||||
* Typically accessed with #Mesh.edges()
|
||||
*/
|
||||
struct MEdge {
|
||||
/** Un-ordered vertex indices (cannot match). */
|
||||
unsigned int v1, v2;
|
||||
/** Deprecated edge crease, now located in `edge_crease`, except for file read and write. */
|
||||
char crease_legacy;
|
||||
/**
|
||||
* Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write.
|
||||
*/
|
||||
char bweight_legacy;
|
||||
eMEdge_Flag flag_legacy;
|
||||
};
|
||||
|
||||
/** #MPoly.flag */
|
||||
enum eMPoly_Flag : char {
|
||||
/** Deprecated smooth shading status. Now stored reversed in "sharp_face" attribute. */
|
||||
ME_SMOOTH = (1 << 0),
|
||||
/** Deprecated selection status. Now stored in ".select_poly" attribute. */
|
||||
ME_FACE_SEL = (1 << 1),
|
||||
/** Deprecated hide status. Now stored in ".hide_poly" attribute. */
|
||||
// ME_HIDE = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eMPoly_Flag)
|
||||
|
||||
/**
|
||||
* Mesh Faces.
|
||||
* This only stores the polygon size & flags, the vertex & edge indices are stored in the "corner
|
||||
* edges" array.
|
||||
*
|
||||
* Typically accessed with #Mesh.faces().
|
||||
*/
|
||||
struct MPoly {
|
||||
/** Offset into loop array and number of loops in the face. */
|
||||
int loopstart;
|
||||
/** Keep signed since we need to subtract when getting the previous loop. */
|
||||
int totloop;
|
||||
/** Deprecated material index. Now stored in the "material_index" attribute, but kept for IO. */
|
||||
short mat_nr_legacy;
|
||||
eMPoly_Flag flag_legacy;
|
||||
char _pad;
|
||||
};
|
||||
|
||||
/** #MLoopUV.flag */
|
||||
enum eMLoopUV_Flag : int {
|
||||
MLOOPUV_EDGESEL = (1 << 0),
|
||||
MLOOPUV_VERTSEL = (1 << 1),
|
||||
MLOOPUV_PINNED = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eMLoopUV_Flag)
|
||||
|
||||
/**
|
||||
* UV coordinate for a polygon face & flag for selection & other options.
|
||||
* Deprecated, but kept to read old files. UV coordinates are now stored as #CD_PROP_FLOAT2 layers.
|
||||
*/
|
||||
struct MLoopUV {
|
||||
float uv[2];
|
||||
eMLoopUV_Flag flag;
|
||||
};
|
||||
|
||||
/** #MVert.flag */
|
||||
enum eMVert_Flag : char {
|
||||
/** Deprecated selection status. Now stored in ".select_vert" attribute. */
|
||||
// SELECT = (1 << 0),
|
||||
/** Deprecated hide status. Now stored in ".hide_vert" attribute. */
|
||||
ME_HIDE = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eMVert_Flag)
|
||||
|
||||
/**
|
||||
* Deprecated mesh vertex data structure. Now stored with generic attributes.
|
||||
*/
|
||||
struct MVert {
|
||||
float co_legacy[3];
|
||||
/**
|
||||
* Deprecated flag for storing hide status and selection, which are now stored in separate
|
||||
* generic attributes. Kept for file read and write.
|
||||
*/
|
||||
eMVert_Flag flag_legacy;
|
||||
/**
|
||||
* Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write.
|
||||
*/
|
||||
char bweight_legacy;
|
||||
char _pad[2];
|
||||
};
|
||||
|
||||
/**
|
||||
* Mesh Face Corners.
|
||||
* Deprecated storage for the vertex of a face corner and the following edge.
|
||||
* Replaced by the "corner_verts" and "corner_edges" arrays.
|
||||
*/
|
||||
struct MLoop {
|
||||
/** Vertex index. */
|
||||
unsigned int v;
|
||||
/** Edge index into an #MEdge array. */
|
||||
unsigned int e;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Used in Blender pre 2.63, See #Mesh::corner_verts(), #Mesh::faces() for face data stored in the
|
||||
* blend file. Use for reading old files and in a handful of cases which should be removed
|
||||
* eventually.
|
||||
*/
|
||||
struct MFace {
|
||||
unsigned int v1, v2, v3, v4;
|
||||
short mat_nr;
|
||||
/** We keep edcode, for conversion to edges draw flags in old files. */
|
||||
eMFace_EdgeCode edcode;
|
||||
char flag;
|
||||
};
|
||||
|
||||
/** Tessellation uv face data. */
|
||||
struct MTFace {
|
||||
float uv[4][2];
|
||||
};
|
||||
|
||||
/**
|
||||
* Tessellation vertex color data.
|
||||
*
|
||||
* \note The red and blue are swapped for historical reasons.
|
||||
*/
|
||||
struct MCol {
|
||||
unsigned char a, r, g, b;
|
||||
};
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
|
||||
/** Old game engine recast navigation data, while unused 2.7x files may contain this. */
|
||||
struct MRecast {
|
||||
int i;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/** \} */
|
||||
|
||||
} // namespace blender
|
||||
141
blender-5.2.0/source/blender/makesdna/DNA_meta_types.h
Normal file
141
blender-5.2.0/source/blender/makesdna/DNA_meta_types.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct BoundBox;
|
||||
struct Material;
|
||||
|
||||
/** #MetaBall::texspace_flag */
|
||||
enum eMetaBall_TexSpaceFlag : char {
|
||||
MB_TEXSPACE_FLAG_AUTO = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eMetaBall_TexSpaceFlag)
|
||||
|
||||
/** #MetaBall::flag */
|
||||
enum eMetaBall_Flag : char {
|
||||
MB_UPDATE_ALWAYS = 0,
|
||||
MB_UPDATE_HALFRES = 1,
|
||||
MB_UPDATE_FAST = 2,
|
||||
MB_UPDATE_NEVER = 3,
|
||||
};
|
||||
|
||||
/** #MetaBall::flag2 */
|
||||
enum eMetaBall_Flag2 : char {
|
||||
MB_DS_EXPAND = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eMetaBall_Flag2)
|
||||
|
||||
/** #MetaElem::type */
|
||||
enum eMetaElem_Type : short {
|
||||
MB_BALL = 0,
|
||||
MB_TUBEX = 1, /* Deprecated. */
|
||||
MB_TUBEY = 2, /* Deprecated. */
|
||||
MB_TUBEZ = 3, /* Deprecated. */
|
||||
MB_TUBE = 4,
|
||||
MB_PLANE = 5,
|
||||
MB_ELIPSOID = 6,
|
||||
MB_CUBE = 7,
|
||||
};
|
||||
|
||||
#define MB_TYPE_SIZE_SQUARED(type) ((type) == MB_ELIPSOID)
|
||||
|
||||
/** #MetaElem::flag */
|
||||
enum eMetaElem_Flag : short {
|
||||
MB_SELECT = (1 << 0),
|
||||
MB_NEGATIVE = 1 << 1,
|
||||
MB_HIDE = 1 << 3,
|
||||
MB_SCALE_RAD = 1 << 4,
|
||||
};
|
||||
ENUM_OPERATORS(eMetaElem_Flag)
|
||||
|
||||
struct MetaElem {
|
||||
struct MetaElem *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Bound Box of MetaElem. */
|
||||
struct BoundBox *bb = nullptr;
|
||||
|
||||
eMetaElem_Type type = MB_BALL;
|
||||
eMetaElem_Flag flag = {};
|
||||
char _pad[4] = {};
|
||||
/** Position of center of MetaElem. */
|
||||
float x = 0, y = 0, z = 0;
|
||||
/** Rotation of MetaElem (MUST be kept normalized). */
|
||||
float quat[4] = {};
|
||||
/** Dimension parameters, used for some types like cubes. */
|
||||
float expx = 0;
|
||||
float expy = 0;
|
||||
float expz = 0;
|
||||
/** Radius of the meta element. */
|
||||
float rad = 0;
|
||||
/** Temp field, used only while processing. */
|
||||
float rad2 = 0;
|
||||
/** Stiffness, how much of the element to fill. */
|
||||
float s = 0;
|
||||
/** Old, only used for backwards compatibility. use dimensions now. */
|
||||
float len = 0;
|
||||
|
||||
/** Matrix and inverted matrix. */
|
||||
float *mat = nullptr, *imat = nullptr;
|
||||
};
|
||||
|
||||
struct MetaBall {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_MB;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
ListBaseT<MetaElem> elems = {nullptr, nullptr};
|
||||
/** Not saved in files, note we use pointer for editmode check. */
|
||||
ListBaseT<MetaElem> *editelems = nullptr;
|
||||
|
||||
/* material of the mother ball will define the material used of all others */
|
||||
struct Material **mat = nullptr;
|
||||
|
||||
/** Flag is enum for updates, flag2 is bit-flags for settings. */
|
||||
eMetaBall_Flag flag = MB_UPDATE_ALWAYS;
|
||||
eMetaBall_Flag2 flag2 = {};
|
||||
short totcol = 0;
|
||||
char texspace_flag = MB_TEXSPACE_FLAG_AUTO;
|
||||
char _pad[2] = {};
|
||||
|
||||
/**
|
||||
* ID data is older than edit-mode data (TODO: move to edit-mode struct).
|
||||
* Set #Main.is_memfile_undo_flush_needed when enabling.
|
||||
*/
|
||||
char needs_flush_to_id = 0;
|
||||
|
||||
float texspace_location[3] = {};
|
||||
float texspace_size[3] = {1, 1, 1};
|
||||
|
||||
/** Display and render res. */
|
||||
float wiresize = 0.4f, rendersize = 0.2f;
|
||||
|
||||
/* bias elements to have an offset volume.
|
||||
* mother ball changes will effect other objects thresholds,
|
||||
* but these may also have their own thresh as an offset */
|
||||
float thresh = 0.6f;
|
||||
|
||||
char _pad0[4] = {};
|
||||
|
||||
/** The active meta-element (used in edit-mode). */
|
||||
MetaElem *lastelem = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
348
blender-5.2.0/source/blender/makesdna/DNA_modifier_enums.h
Normal file
348
blender-5.2.0/source/blender/makesdna/DNA_modifier_enums.h
Normal file
@@ -0,0 +1,348 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* Some enums shared between mesh and grease pencil modifiers.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* Grease Pencil Modifiers */
|
||||
|
||||
enum eArrayGpencil_Flag : int {
|
||||
GP_ARRAY_INVERT_LAYER = (1 << 2),
|
||||
GP_ARRAY_INVERT_PASS = (1 << 3),
|
||||
GP_ARRAY_INVERT_LAYERPASS = (1 << 5),
|
||||
GP_ARRAY_INVERT_MATERIAL = (1 << 6),
|
||||
GP_ARRAY_USE_OFFSET = (1 << 7),
|
||||
GP_ARRAY_USE_RELATIVE = (1 << 8),
|
||||
GP_ARRAY_USE_OB_OFFSET = (1 << 9),
|
||||
GP_ARRAY_UNIFORM_RANDOM_SCALE = (1 << 10),
|
||||
};
|
||||
ENUM_OPERATORS(eArrayGpencil_Flag)
|
||||
|
||||
enum eTextureGpencil_Fit : short {
|
||||
GP_TEX_FIT_STROKE = 0,
|
||||
GP_TEX_CONSTANT_LENGTH = 1,
|
||||
};
|
||||
|
||||
enum eNoiseGpencil_Flag : int {
|
||||
GP_NOISE_USE_RANDOM = (1 << 0),
|
||||
GP_NOISE_MOD_LOCATION = (1 << 1), /* Deprecated (only for versioning). */
|
||||
GP_NOISE_MOD_STRENGTH = (1 << 2), /* Deprecated (only for versioning). */
|
||||
GP_NOISE_MOD_THICKNESS = (1 << 3), /* Deprecated (only for versioning). */
|
||||
GP_NOISE_FULL_STROKE = (1 << 4),
|
||||
GP_NOISE_CUSTOM_CURVE = (1 << 5),
|
||||
GP_NOISE_INVERT_LAYER = (1 << 6),
|
||||
GP_NOISE_INVERT_PASS = (1 << 7),
|
||||
GP_NOISE_INVERT_VGROUP = (1 << 8),
|
||||
GP_NOISE_MOD_UV = (1 << 9), /* Deprecated (only for versioning). */
|
||||
GP_NOISE_INVERT_LAYERPASS = (1 << 10),
|
||||
GP_NOISE_INVERT_MATERIAL = (1 << 11),
|
||||
};
|
||||
ENUM_OPERATORS(eNoiseGpencil_Flag)
|
||||
|
||||
enum eNoiseRandomGpencil_Mode : short {
|
||||
GP_NOISE_RANDOM_STEP = 0,
|
||||
GP_NOISE_RANDOM_KEYFRAME = 1,
|
||||
};
|
||||
|
||||
enum eLengthGpencil_Flag : int {
|
||||
GP_LENGTH_INVERT_LAYER = (1 << 0),
|
||||
GP_LENGTH_INVERT_PASS = (1 << 1),
|
||||
GP_LENGTH_INVERT_LAYERPASS = (1 << 2),
|
||||
GP_LENGTH_INVERT_MATERIAL = (1 << 3),
|
||||
GP_LENGTH_USE_CURVATURE = (1 << 4),
|
||||
GP_LENGTH_INVERT_CURVATURE = (1 << 5),
|
||||
GP_LENGTH_USE_RANDOM = (1 << 6),
|
||||
};
|
||||
ENUM_OPERATORS(eLengthGpencil_Flag)
|
||||
|
||||
enum eLengthGpencil_Type : int {
|
||||
GP_LENGTH_RELATIVE = 0,
|
||||
GP_LENGTH_ABSOLUTE = 1,
|
||||
};
|
||||
|
||||
/* Shrink-wrap Modifier */
|
||||
|
||||
/** #ShrinkwrapModifierData.shrinkType */
|
||||
enum eShrinkwrap_Type : short {
|
||||
MOD_SHRINKWRAP_NEAREST_SURFACE = 0,
|
||||
MOD_SHRINKWRAP_PROJECT = 1,
|
||||
MOD_SHRINKWRAP_NEAREST_VERTEX = 2,
|
||||
MOD_SHRINKWRAP_TARGET_PROJECT = 3,
|
||||
};
|
||||
|
||||
/** #ShrinkwrapModifierData.shrinkMode */
|
||||
enum eShrinkwrap_Mode : char {
|
||||
/** Move vertex to the surface of the target object (keepDist towards original position) */
|
||||
MOD_SHRINKWRAP_ON_SURFACE = 0,
|
||||
/** Move the vertex inside the target object; don't change if already inside */
|
||||
MOD_SHRINKWRAP_INSIDE = 1,
|
||||
/** Move the vertex outside the target object; don't change if already outside */
|
||||
MOD_SHRINKWRAP_OUTSIDE = 2,
|
||||
/** Move vertex to the surface of the target object, with keepDist towards the outside */
|
||||
MOD_SHRINKWRAP_OUTSIDE_SURFACE = 3,
|
||||
/** Move vertex to the surface of the target object, with keepDist along the normal */
|
||||
MOD_SHRINKWRAP_ABOVE_SURFACE = 4,
|
||||
};
|
||||
|
||||
/** #ShrinkwrapModifierData.shrinkOpts */
|
||||
enum eShrinkwrap_Opts : uint8_t {
|
||||
/** Allow shrink-wrap to move the vertex in the positive direction of axis. */
|
||||
MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR = (1 << 0),
|
||||
/** Allow shrink-wrap to move the vertex in the negative direction of axis. */
|
||||
MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR = (1 << 1),
|
||||
|
||||
/** ignore vertex moves if a vertex ends projected on a front face of the target */
|
||||
MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE = (1 << 3),
|
||||
/** ignore vertex moves if a vertex ends projected on a back face of the target */
|
||||
MOD_SHRINKWRAP_CULL_TARGET_BACKFACE = (1 << 4),
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** distance is measure to the front face of the target */
|
||||
MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE = (1 << 5),
|
||||
#endif
|
||||
|
||||
MOD_SHRINKWRAP_INVERT_VGROUP = (1 << 6),
|
||||
MOD_SHRINKWRAP_INVERT_CULL_TARGET = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eShrinkwrap_Opts)
|
||||
|
||||
#define MOD_SHRINKWRAP_CULL_TARGET_MASK \
|
||||
(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)
|
||||
|
||||
/** #ShrinkwrapModifierData.projAxis */
|
||||
enum eShrinkwrap_ProjAxis : char {
|
||||
/** projection over normal is used if no axis is selected */
|
||||
MOD_SHRINKWRAP_PROJECT_OVER_NORMAL = 0,
|
||||
MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS = (1 << 0),
|
||||
MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS = (1 << 1),
|
||||
MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eShrinkwrap_ProjAxis)
|
||||
|
||||
/* TransferData modifier */
|
||||
|
||||
enum eDTType : int {
|
||||
DT_TYPE_MDEFORMVERT = 1 << 0,
|
||||
DT_TYPE_SKIN = 1 << 2,
|
||||
DT_TYPE_BWEIGHT_VERT = 1 << 3,
|
||||
|
||||
DT_TYPE_SHARP_EDGE = 1 << 8,
|
||||
DT_TYPE_SEAM = 1 << 9,
|
||||
DT_TYPE_CREASE = 1 << 10,
|
||||
DT_TYPE_BWEIGHT_EDGE = 1 << 11,
|
||||
DT_TYPE_FREESTYLE_EDGE = 1 << 12,
|
||||
|
||||
DT_TYPE_MPROPCOL_VERT = 1 << 16,
|
||||
DT_TYPE_LNOR = 1 << 17,
|
||||
|
||||
DT_TYPE_UV = 1 << 24,
|
||||
DT_TYPE_SHARP_FACE = 1 << 25,
|
||||
DT_TYPE_FREESTYLE_FACE = 1 << 26,
|
||||
DT_TYPE_MLOOPCOL_VERT = 1 << 27,
|
||||
DT_TYPE_MPROPCOL_LOOP = 1 << 28,
|
||||
DT_TYPE_MLOOPCOL_LOOP = 1 << 29,
|
||||
DT_TYPE_VCOL_ALL = (1 << 16) | (1 << 27) | (1 << 28) | (1 << 29),
|
||||
#define DT_TYPE_MAX 30
|
||||
|
||||
DT_TYPE_VERT_ALL = DT_TYPE_MDEFORMVERT | DT_TYPE_SKIN | DT_TYPE_BWEIGHT_VERT |
|
||||
DT_TYPE_MPROPCOL_VERT | DT_TYPE_MLOOPCOL_VERT,
|
||||
DT_TYPE_EDGE_ALL = DT_TYPE_SHARP_EDGE | DT_TYPE_SEAM | DT_TYPE_CREASE | DT_TYPE_BWEIGHT_EDGE |
|
||||
DT_TYPE_FREESTYLE_EDGE,
|
||||
DT_TYPE_LOOP_ALL = DT_TYPE_LNOR | DT_TYPE_UV | DT_TYPE_MPROPCOL_LOOP | DT_TYPE_MLOOPCOL_LOOP,
|
||||
DT_TYPE_POLY_ALL = DT_TYPE_UV | DT_TYPE_SHARP_FACE | DT_TYPE_FREESTYLE_FACE,
|
||||
};
|
||||
ENUM_OPERATORS(eDTType)
|
||||
|
||||
#define DT_DATATYPE_IS_VERT(_dt) \
|
||||
ELEM(_dt, \
|
||||
DT_TYPE_MDEFORMVERT, \
|
||||
DT_TYPE_SKIN, \
|
||||
DT_TYPE_BWEIGHT_VERT, \
|
||||
DT_TYPE_MLOOPCOL_VERT, \
|
||||
DT_TYPE_MPROPCOL_VERT, \
|
||||
DT_TYPE_MPROPCOL_VERT | DT_TYPE_MLOOPCOL_VERT)
|
||||
#define DT_DATATYPE_IS_EDGE(_dt) \
|
||||
ELEM(_dt, \
|
||||
DT_TYPE_CREASE, \
|
||||
DT_TYPE_SHARP_EDGE, \
|
||||
DT_TYPE_SEAM, \
|
||||
DT_TYPE_BWEIGHT_EDGE, \
|
||||
DT_TYPE_FREESTYLE_EDGE)
|
||||
#define DT_DATATYPE_IS_LOOP(_dt) \
|
||||
ELEM(_dt, \
|
||||
DT_TYPE_UV, \
|
||||
DT_TYPE_LNOR, \
|
||||
DT_TYPE_MLOOPCOL_LOOP, \
|
||||
DT_TYPE_MPROPCOL_LOOP, \
|
||||
DT_TYPE_MPROPCOL_LOOP | DT_TYPE_MLOOPCOL_LOOP)
|
||||
#define DT_DATATYPE_IS_FACE(_dt) ELEM(_dt, DT_TYPE_UV, DT_TYPE_SHARP_FACE, DT_TYPE_FREESTYLE_FACE)
|
||||
#define DT_DATATYPE_IS_MULTILAYERS(_dt) \
|
||||
ELEM(_dt, \
|
||||
DT_TYPE_MDEFORMVERT, \
|
||||
DT_TYPE_MPROPCOL_VERT, \
|
||||
DT_TYPE_MLOOPCOL_VERT, \
|
||||
DT_TYPE_MPROPCOL_VERT | DT_TYPE_MLOOPCOL_VERT, \
|
||||
DT_TYPE_MPROPCOL_LOOP, \
|
||||
DT_TYPE_MLOOPCOL_LOOP, \
|
||||
DT_TYPE_MPROPCOL_LOOP | DT_TYPE_MLOOPCOL_LOOP, \
|
||||
DT_TYPE_UV)
|
||||
|
||||
enum eDTMultilayerIndex : int {
|
||||
DT_MULTILAYER_INDEX_INVALID = -1,
|
||||
DT_MULTILAYER_INDEX_MDEFORMVERT = 0,
|
||||
DT_MULTILAYER_INDEX_VCOL_LOOP = 2,
|
||||
DT_MULTILAYER_INDEX_UV = 3,
|
||||
DT_MULTILAYER_INDEX_VCOL_VERT = 4,
|
||||
DT_MULTILAYER_INDEX_MAX = 5,
|
||||
};
|
||||
|
||||
/* Below we keep positive values for real layers idx (generated dynamically). */
|
||||
|
||||
/* How to select data layers, for types supporting multi-layers.
|
||||
* Here too, some options are highly dependent on type of transferred data! */
|
||||
enum eDTLayersSrc : int {
|
||||
DT_LAYERS_ACTIVE_SRC = -1,
|
||||
DT_LAYERS_ALL_SRC = -2,
|
||||
/* Datatype-specific. */
|
||||
DT_LAYERS_VGROUP_SRC = 1 << 8,
|
||||
DT_LAYERS_VGROUP_SRC_BONE_SELECT = -(DT_LAYERS_VGROUP_SRC | 1),
|
||||
DT_LAYERS_VGROUP_SRC_BONE_DEFORM = -(DT_LAYERS_VGROUP_SRC | 2),
|
||||
/* Other types-related modes... */
|
||||
};
|
||||
|
||||
/* How to map a source layer to a destination layer, for types supporting multi-layers.
|
||||
* NOTE: if no matching layer can be found, it will be created. */
|
||||
enum eDTLayersDst : int {
|
||||
DT_LAYERS_ACTIVE_DST = -1, /* Only for DT_LAYERS_FROMSEL_ACTIVE. */
|
||||
DT_LAYERS_NAME_DST = -2,
|
||||
DT_LAYERS_INDEX_DST = -3,
|
||||
#if 0 /* TODO */
|
||||
DT_LAYERS_CREATE_DST = -4, /* Never replace existing data in dst, always create new layers. */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* TODO:
|
||||
* Add other 'from/to' mapping sources, like e.g. using a UVMap, etc.
|
||||
* https://blenderartists.org/t/619105
|
||||
*
|
||||
* We could also use similar topology mappings inside a same mesh
|
||||
* (cf. Campbell's 'select face islands from similar topology' WIP work).
|
||||
* Also, users will have to check, whether we can get rid of some modes here,
|
||||
* not sure all will be useful!
|
||||
*/
|
||||
enum eMRemapMode : int {
|
||||
MREMAP_USE_VERT = 1 << 4,
|
||||
MREMAP_USE_EDGE = 1 << 5,
|
||||
MREMAP_USE_LOOP = 1 << 6,
|
||||
MREMAP_USE_POLY = 1 << 7,
|
||||
|
||||
MREMAP_USE_NEAREST = 1 << 8,
|
||||
MREMAP_USE_NORPROJ = 1 << 9,
|
||||
MREMAP_USE_INTERP = 1 << 10,
|
||||
MREMAP_USE_NORMAL = 1 << 11,
|
||||
|
||||
/* ***** Target's vertices ***** */
|
||||
MREMAP_MODE_VERT = 1 << 24,
|
||||
/* Nearest source vert. */
|
||||
MREMAP_MODE_VERT_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_VERT | MREMAP_USE_NEAREST,
|
||||
|
||||
/* Nearest vertex of nearest edge. */
|
||||
MREMAP_MODE_VERT_EDGE_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_EDGE | MREMAP_USE_NEAREST,
|
||||
/* This one uses two verts of selected edge (weighted interpolation). */
|
||||
/* Nearest point on nearest edge. */
|
||||
MREMAP_MODE_VERT_EDGEINTERP_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_EDGE | MREMAP_USE_NEAREST |
|
||||
MREMAP_USE_INTERP,
|
||||
|
||||
/* Nearest vertex of nearest face. */
|
||||
MREMAP_MODE_VERT_FACE_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
|
||||
/* Those two use all verts of selected face (weighted interpolation). */
|
||||
/* Nearest point on nearest face. */
|
||||
MREMAP_MODE_VERT_POLYINTERP_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NEAREST |
|
||||
MREMAP_USE_INTERP,
|
||||
/* Point on nearest face hit by ray from target vertex's normal. */
|
||||
MREMAP_MODE_VERT_POLYINTERP_VNORPROJ = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NORPROJ |
|
||||
MREMAP_USE_INTERP,
|
||||
|
||||
/* ***** Target's edges ***** */
|
||||
MREMAP_MODE_EDGE = 1 << 25,
|
||||
|
||||
/* Source edge which both vertices are nearest of destination ones. */
|
||||
MREMAP_MODE_EDGE_VERT_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_VERT | MREMAP_USE_NEAREST,
|
||||
|
||||
/* Nearest source edge (using mid-point). */
|
||||
MREMAP_MODE_EDGE_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_EDGE | MREMAP_USE_NEAREST,
|
||||
|
||||
/* Nearest edge of nearest face (using mid-point). */
|
||||
MREMAP_MODE_EDGE_POLY_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
|
||||
|
||||
/* Cast a set of rays from along destination edge,
|
||||
* interpolating its vertices' normals, and use hit source edges. */
|
||||
MREMAP_MODE_EDGE_EDGEINTERP_VNORPROJ = MREMAP_MODE_EDGE | MREMAP_USE_VERT | MREMAP_USE_NORPROJ |
|
||||
MREMAP_USE_INTERP,
|
||||
|
||||
/* ***** Target's loops ***** */
|
||||
/* NOTE: when islands are given to loop mapping func,
|
||||
* all loops from the same destination face will always be mapped
|
||||
* to loops of source faces within a same island, regardless of mapping mode. */
|
||||
MREMAP_MODE_LOOP = 1 << 26,
|
||||
|
||||
/* Best normal-matching loop from nearest vert. */
|
||||
MREMAP_MODE_LOOP_NEAREST_LOOPNOR = MREMAP_MODE_LOOP | MREMAP_USE_LOOP | MREMAP_USE_VERT |
|
||||
MREMAP_USE_NEAREST | MREMAP_USE_NORMAL,
|
||||
/* Loop from best normal-matching face from nearest vert. */
|
||||
MREMAP_MODE_LOOP_NEAREST_POLYNOR = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_VERT |
|
||||
MREMAP_USE_NEAREST | MREMAP_USE_NORMAL,
|
||||
|
||||
/* Loop from nearest vertex of nearest face. */
|
||||
MREMAP_MODE_LOOP_POLY_NEAREST = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
|
||||
/* Those two use all verts of selected face (weighted interpolation). */
|
||||
/* Nearest point on nearest face. */
|
||||
MREMAP_MODE_LOOP_POLYINTERP_NEAREST = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NEAREST |
|
||||
MREMAP_USE_INTERP,
|
||||
/* Point on nearest face hit by ray from target loop's normal. */
|
||||
MREMAP_MODE_LOOP_POLYINTERP_LNORPROJ = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NORPROJ |
|
||||
MREMAP_USE_INTERP,
|
||||
|
||||
/* ***** Target's faces ***** */
|
||||
MREMAP_MODE_POLY = 1 << 27,
|
||||
|
||||
/* Nearest source face. */
|
||||
MREMAP_MODE_POLY_NEAREST = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
|
||||
/* Source face from best normal-matching destination face. */
|
||||
MREMAP_MODE_POLY_NOR = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NORMAL,
|
||||
|
||||
/* Project destination face onto source mesh using its normal,
|
||||
* and use interpolation of all intersecting source faces. */
|
||||
MREMAP_MODE_POLY_POLYINTERP_PNORPROJ = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NORPROJ |
|
||||
MREMAP_USE_INTERP,
|
||||
|
||||
/* ***** Same topology, applies to all four elements types. ***** */
|
||||
MREMAP_MODE_TOPOLOGY = MREMAP_MODE_VERT | MREMAP_MODE_EDGE | MREMAP_MODE_LOOP | MREMAP_MODE_POLY,
|
||||
};
|
||||
ENUM_OPERATORS(eMRemapMode)
|
||||
|
||||
/**
|
||||
* How to filter out some elements (to leave untouched).
|
||||
* Note those options are highly dependent on type of transferred data! */
|
||||
enum eCDTMixMode : int {
|
||||
CDT_MIX_NOMIX = -1, /* Special case, only used because we abuse 'copy' CD callback. */
|
||||
CDT_MIX_TRANSFER = 0,
|
||||
CDT_MIX_REPLACE_ABOVE_THRESHOLD = 1,
|
||||
CDT_MIX_REPLACE_BELOW_THRESHOLD = 2,
|
||||
CDT_MIX_MIX = 16,
|
||||
CDT_MIX_ADD = 17,
|
||||
CDT_MIX_SUB = 18,
|
||||
CDT_MIX_MUL = 19,
|
||||
/* Etc. */
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
3525
blender-5.2.0/source/blender/makesdna/DNA_modifier_types.h
Normal file
3525
blender-5.2.0/source/blender/makesdna/DNA_modifier_types.h
Normal file
File diff suppressed because it is too large
Load Diff
197
blender-5.2.0/source/blender/makesdna/DNA_movieclip_types.h
Normal file
197
blender-5.2.0/source/blender/makesdna/DNA_movieclip_types.h
Normal file
@@ -0,0 +1,197 @@
|
||||
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_color_types.h"
|
||||
#include "DNA_tracking_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct ImBuf;
|
||||
struct MovieReader;
|
||||
struct MovieClipProxy;
|
||||
struct MovieTrackingMarker;
|
||||
struct MovieTrackingTrack;
|
||||
struct bGPdata;
|
||||
namespace gpu {
|
||||
class Texture;
|
||||
} // namespace gpu
|
||||
|
||||
/** #MovieClipProxy.build_size_flag
|
||||
* NOTE: Keep in sync with #IMB_Proxy_Size. */
|
||||
enum eMovieClipProxy_Size : short {
|
||||
MCLIP_PROXY_SIZE_25 = (1 << 0),
|
||||
MCLIP_PROXY_SIZE_50 = (1 << 1),
|
||||
MCLIP_PROXY_SIZE_75 = (1 << 2),
|
||||
MCLIP_PROXY_SIZE_100 = (1 << 3),
|
||||
MCLIP_PROXY_UNDISTORTED_SIZE_25 = (1 << 4),
|
||||
MCLIP_PROXY_UNDISTORTED_SIZE_50 = (1 << 5),
|
||||
MCLIP_PROXY_UNDISTORTED_SIZE_75 = (1 << 6),
|
||||
MCLIP_PROXY_UNDISTORTED_SIZE_100 = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eMovieClipProxy_Size)
|
||||
|
||||
enum MovieClipSource : int {
|
||||
MCLIP_SRC_SEQUENCE = 1,
|
||||
MCLIP_SRC_MOVIE = 2,
|
||||
};
|
||||
|
||||
enum MovieClipFlag : int {
|
||||
MCLIP_USE_PROXY = (1 << 0),
|
||||
MCLIP_USE_PROXY_CUSTOM_DIR = (1 << 1),
|
||||
/* MCLIP_CUSTOM_START_FRAME = (1 << 2), */ /* UNUSED */
|
||||
MCLIP_DATA_EXPAND = (1 << 3),
|
||||
|
||||
MCLIP_PROXY_FLAGS = (MCLIP_USE_PROXY | MCLIP_USE_PROXY_CUSTOM_DIR),
|
||||
};
|
||||
ENUM_OPERATORS(MovieClipFlag)
|
||||
|
||||
/** #MovieClipUser.render_size */
|
||||
enum eMovieClipProxy_RenderSize : short {
|
||||
MCLIP_PROXY_RENDER_SIZE_FULL = 0,
|
||||
MCLIP_PROXY_RENDER_SIZE_25 = 1,
|
||||
MCLIP_PROXY_RENDER_SIZE_50 = 2,
|
||||
MCLIP_PROXY_RENDER_SIZE_75 = 3,
|
||||
MCLIP_PROXY_RENDER_SIZE_100 = 4,
|
||||
};
|
||||
|
||||
/** #MovieClipUser.render_flag */
|
||||
enum eMovieClipProxy_RenderFlag : short {
|
||||
MCLIP_PROXY_RENDER_UNDISTORT = 1,
|
||||
/** Use original, if proxy is not found. */
|
||||
MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eMovieClipProxy_RenderFlag)
|
||||
|
||||
struct MovieClipUser {
|
||||
/** Current frame number. */
|
||||
int framenr = 1;
|
||||
/** Proxy render size. */
|
||||
eMovieClipProxy_RenderSize render_size = MCLIP_PROXY_RENDER_SIZE_FULL;
|
||||
eMovieClipProxy_RenderFlag render_flag = {};
|
||||
};
|
||||
|
||||
struct MovieClipProxy {
|
||||
/** Custom directory for index and proxy files (defaults to "BL_proxy"). */
|
||||
char dir[/*FILE_MAXDIR*/ 768] = "";
|
||||
|
||||
/** Proxy build quality. */
|
||||
short quality = 50;
|
||||
/** Size flags (see below) of all proxies to build. */
|
||||
eMovieClipProxy_Size build_size_flag = MCLIP_PROXY_SIZE_25;
|
||||
};
|
||||
|
||||
struct MovieClip_RuntimeGPUTexture {
|
||||
void *next = nullptr, *prev = nullptr;
|
||||
MovieClipUser user;
|
||||
/** Not written in file. */
|
||||
gpu::Texture *gputexture[/*TEXTARGET_COUNT*/ 3];
|
||||
};
|
||||
|
||||
struct MovieClip_Runtime {
|
||||
ListBaseT<MovieClip_RuntimeGPUTexture> gputextures = {nullptr, nullptr};
|
||||
/* The Depsgraph::update_count when this ID was last updated. Covers any IDRecalcFlag. */
|
||||
uint64_t last_update = 0;
|
||||
};
|
||||
|
||||
struct MovieClip {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_MC;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
MovieClipSource source = {};
|
||||
/** Size of last accessed frame. */
|
||||
int lastsize[2] = {};
|
||||
|
||||
/** Display aspect. */
|
||||
float aspx = 1.0f, aspy = 1.0f;
|
||||
|
||||
int _pad = 0;
|
||||
/** Movie source data. */
|
||||
struct MovieReader *anim = nullptr;
|
||||
/** Cache for different stuff, not in file. */
|
||||
struct MovieClipCache *cache = nullptr;
|
||||
/** Grease pencil data. */
|
||||
struct bGPdata *gpd = nullptr;
|
||||
|
||||
/** Data for SfM tracking. */
|
||||
struct MovieTracking tracking;
|
||||
/**
|
||||
* Context of tracking job used to synchronize data
|
||||
* like frame-number in SpaceClip clip user.
|
||||
*/
|
||||
void *tracking_context = nullptr;
|
||||
|
||||
/** Proxy to clip data. */
|
||||
MovieClipProxy proxy;
|
||||
MovieClipFlag flag = {};
|
||||
|
||||
/** Length of movie. */
|
||||
int len = 0;
|
||||
|
||||
/**
|
||||
* Scene frame number footage starts playing at affects all data
|
||||
* which is associated with a clip such as motion tracking,
|
||||
* camera Reconstruction and so.
|
||||
*/
|
||||
int start_frame = 1;
|
||||
/**
|
||||
* Offset which is adding to a file number when reading frame from a file.
|
||||
* affects only a way how scene frame is mapping to a file name and not
|
||||
* touches other data associated with a clip. */
|
||||
int frame_offset = 0;
|
||||
|
||||
int _pad1 = 0;
|
||||
ColorManagedColorspaceSettings colorspace_settings;
|
||||
MovieClip_Runtime runtime;
|
||||
};
|
||||
|
||||
struct MovieClipScopes {
|
||||
/** 1 means scopes are ok and recalculation is unneeded. */
|
||||
short ok = 0;
|
||||
/** Whether track's mask should be applied on preview. */
|
||||
short use_track_mask = 0;
|
||||
/** Height of track preview widget. */
|
||||
int track_preview_height = 120;
|
||||
/** Width and height of frame for which scopes are calculated. */
|
||||
int frame_width = 0, frame_height = 0;
|
||||
/** Undistorted position of marker used for pattern sampling. */
|
||||
struct MovieTrackingMarker undist_marker;
|
||||
/** Search area of a track. */
|
||||
struct ImBuf *track_search = nullptr;
|
||||
/** #ImBuf displayed in track preview. */
|
||||
struct ImBuf *track_preview = nullptr;
|
||||
/** Sub-pixel position of marker in track ImBuf. */
|
||||
float track_pos[2] = {0, 0};
|
||||
/** Active track is disabled, special notifier should be drawn. */
|
||||
short track_disabled = 0;
|
||||
/** Active track is locked, no transformation should be allowed. */
|
||||
short track_locked = 0;
|
||||
/** Frame number scopes are created for (measured in scene frames). */
|
||||
int scene_framenr = 0;
|
||||
/** Track scopes are created for. */
|
||||
struct MovieTrackingTrack *track = nullptr;
|
||||
/** Marker scopes are created for. */
|
||||
struct MovieTrackingMarker *marker = nullptr;
|
||||
/** Scale used for sliding from preview area. */
|
||||
float slide_scale[2] = {0.0f, 0.0f};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
101
blender-5.2.0/source/blender/makesdna/DNA_nla_types.h
Normal file
101
blender-5.2.0/source/blender/makesdna/DNA_nla_types.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct Object;
|
||||
struct bAction;
|
||||
|
||||
/** #Strip::mode (these defines aren't really used, but are here for reference) */
|
||||
enum eActStrip_Mode : short {
|
||||
ACTSTRIPMODE_BLEND = 0,
|
||||
ACTSTRIPMODE_ADD = 1,
|
||||
};
|
||||
|
||||
/** #bActionStrip.flag */
|
||||
enum eActStrip_Flag : short {
|
||||
ACTSTRIP_SELECT = (1 << 0),
|
||||
ACTSTRIP_USESTRIDE = (1 << 1),
|
||||
/* Not implemented. Is not used anywhere */
|
||||
/* ACTSTRIP_BLENDTONEXT = (1 << 2), */ /* UNUSED */
|
||||
ACTSTRIP_HOLDLASTFRAME = (1 << 3),
|
||||
ACTSTRIP_ACTIVE = (1 << 4),
|
||||
ACTSTRIP_LOCK_ACTION = (1 << 5),
|
||||
ACTSTRIP_MUTE = (1 << 6),
|
||||
/* This has yet to be implemented. To indicate that a strip should be played backwards */
|
||||
ACTSTRIP_REVERSE = (1 << 7),
|
||||
ACTSTRIP_AUTO_BLENDS = (1 << 11),
|
||||
};
|
||||
ENUM_OPERATORS(eActStrip_Flag)
|
||||
|
||||
/** Simple uniform modifier structure, assumed it can hold all type info. */
|
||||
struct bActionModifier {
|
||||
struct bActionModifier *next = nullptr, *prev = nullptr;
|
||||
short type = 0, flag = 0;
|
||||
char channel[32] = "";
|
||||
|
||||
/* noise modifier */
|
||||
float noisesize = 0, turbul = 0;
|
||||
short channels = 0;
|
||||
|
||||
/* path deform modifier */
|
||||
short no_rot_axis = 0;
|
||||
struct Object *ob = nullptr;
|
||||
};
|
||||
|
||||
// /* NLA-Modifier Types (UNUSED) */
|
||||
// enum {
|
||||
// ACTSTRIP_MOD_DEFORM = 0,
|
||||
// ACTSTRIP_MOD_NOISE = 1,
|
||||
// };
|
||||
|
||||
struct bActionStrip {
|
||||
struct bActionStrip *next = nullptr, *prev = nullptr;
|
||||
eActStrip_Flag flag = {};
|
||||
eActStrip_Mode mode = ACTSTRIPMODE_BLEND;
|
||||
/** Axis 0=x, 1=y, 2=z. */
|
||||
short stride_axis = 0;
|
||||
/** Current modifier for buttons. */
|
||||
short curmod = 0;
|
||||
|
||||
/** The action referenced by this strip. */
|
||||
struct bAction *act = nullptr;
|
||||
/** For groups, the actual object being nla'ed. */
|
||||
struct Object *object = nullptr;
|
||||
/** The range of frames covered by this strip. */
|
||||
float start = 0, end = 0;
|
||||
/** The range of frames taken from the action. */
|
||||
float actstart = 0, actend = 0;
|
||||
/** Offset within action, for cycles and striding. */
|
||||
float actoffs = 0;
|
||||
/** The stride-length (considered when flag & ACT_USESTRIDE). */
|
||||
float stridelen = 0;
|
||||
/** The number of times to repeat the action range. */
|
||||
float repeat = 0;
|
||||
/** The amount the action range is scaled by. */
|
||||
float scale = 0;
|
||||
|
||||
/** The number of frames on either end of the strip's length to fade in/out. */
|
||||
float blendin = 0, blendout = 0;
|
||||
|
||||
/** Instead of stridelen, it uses an action channel. */
|
||||
char stridechannel[32] = "";
|
||||
/** If repeat, use this bone/channel for defining offset. */
|
||||
char offs_bone[32] = "";
|
||||
|
||||
/** Modifier stack. */
|
||||
ListBaseT<bActionModifier> modifiers = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
@@ -0,0 +1,515 @@
|
||||
/* SPDX-FileCopyrightText: 2005 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_color_types.hh"
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_function_ref.hh"
|
||||
#include "BLI_span.hh"
|
||||
#include "BLI_string_ref.hh"
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
class bNodeTreeInterfaceRuntime;
|
||||
struct bNodeSocketType;
|
||||
} // namespace bke
|
||||
|
||||
struct bNodeSocket;
|
||||
struct bNodeTreeInterfaceItem;
|
||||
struct bNodeTreeInterfacePanel;
|
||||
struct bNodeTreeInterfaceSocket;
|
||||
struct ID;
|
||||
struct IDProperty;
|
||||
struct LibraryForeachIDData;
|
||||
struct BlendWriter;
|
||||
struct BlendDataReader;
|
||||
|
||||
/** Type of interface item. */
|
||||
enum class NodeTreeInterfaceItemType : char {
|
||||
Panel = 0,
|
||||
Socket = 1,
|
||||
};
|
||||
|
||||
/** Describes a socket and all necessary details for a node declaration. */
|
||||
struct bNodeTreeInterfaceItem {
|
||||
NodeTreeInterfaceItemType item_type = NodeTreeInterfaceItemType::Panel;
|
||||
char _pad[7] = {};
|
||||
|
||||
#ifdef __cplusplus
|
||||
void set_selected(bool select);
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Socket interface flags */
|
||||
enum NodeTreeInterfaceSocketFlag : int {
|
||||
NODE_INTERFACE_SOCKET_INPUT = 1 << 0,
|
||||
NODE_INTERFACE_SOCKET_OUTPUT = 1 << 1,
|
||||
NODE_INTERFACE_SOCKET_HIDE_VALUE = 1 << 2,
|
||||
NODE_INTERFACE_SOCKET_HIDE_IN_MODIFIER = 1 << 3,
|
||||
NODE_INTERFACE_SOCKET_COMPACT = 1 << 4,
|
||||
/* To be deprecated when structure types are moved out of experimental. */
|
||||
NODE_INTERFACE_SOCKET_SINGLE_VALUE_ONLY_LEGACY = 1 << 5,
|
||||
NODE_INTERFACE_SOCKET_LAYER_SELECTION = 1 << 6,
|
||||
/* INSPECT is used by Connect to Output operator to ensure socket that exits from node group. */
|
||||
NODE_INTERFACE_SOCKET_INSPECT = 1 << 7,
|
||||
/* Socket is used in the panel header as a toggle. */
|
||||
NODE_INTERFACE_SOCKET_PANEL_TOGGLE = 1 << 8,
|
||||
/* Menu socket should be drawn expanded instead of as drop-down menu. */
|
||||
NODE_INTERFACE_SOCKET_MENU_EXPANDED = 1 << 9,
|
||||
/**
|
||||
* Indicates that drawing code may decide not to draw the label if that would result in a
|
||||
* cleaner UI.
|
||||
*/
|
||||
NODE_INTERFACE_SOCKET_OPTIONAL_LABEL = 1 << 10,
|
||||
/* Whether the socket is selected in the node group interface tree view. */
|
||||
NODE_INTERFACE_SOCKET_SELECT = 1 << 11,
|
||||
};
|
||||
ENUM_OPERATORS(NodeTreeInterfaceSocketFlag);
|
||||
|
||||
enum class NodeSocketInterfaceStructureType : int8_t {
|
||||
Auto = 0,
|
||||
Single = 1,
|
||||
Dynamic = 2,
|
||||
Field = 3,
|
||||
Grid = 4,
|
||||
List = 5,
|
||||
};
|
||||
|
||||
// TODO: Move out of DNA.
|
||||
#ifdef __cplusplus
|
||||
namespace nodes {
|
||||
enum class StructureType : int8_t {
|
||||
Single = int8_t(NodeSocketInterfaceStructureType::Single),
|
||||
Dynamic = int8_t(NodeSocketInterfaceStructureType::Dynamic),
|
||||
Field = int8_t(NodeSocketInterfaceStructureType::Field),
|
||||
Grid = int8_t(NodeSocketInterfaceStructureType::Grid),
|
||||
List = int8_t(NodeSocketInterfaceStructureType::List),
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Panel interface flags */
|
||||
enum NodeTreeInterfacePanelFlag : int {
|
||||
/* Panel starts closed on new node instances. */
|
||||
NODE_INTERFACE_PANEL_DEFAULT_CLOSED = 1 << 0,
|
||||
/* In the past, not all panels allowed child panels. Now all allow them. */
|
||||
NODE_INTERFACE_PANEL_ALLOW_CHILD_PANELS_LEGACY = 1 << 1,
|
||||
/* Allow adding sockets after panels. */
|
||||
NODE_INTERFACE_PANEL_ALLOW_SOCKETS_AFTER_PANELS = 1 << 2,
|
||||
/* Whether the panel is collapsed in the node group interface tree view. */
|
||||
NODE_INTERFACE_PANEL_IS_COLLAPSED = 1 << 3,
|
||||
/* Whether the panel is selected in the node group interface tree view. */
|
||||
NODE_INTERFACE_PANEL_SELECT = 1 << 4,
|
||||
};
|
||||
ENUM_OPERATORS(NodeTreeInterfacePanelFlag);
|
||||
|
||||
enum NodeDefaultInputType : short {
|
||||
NODE_DEFAULT_INPUT_VALUE = 0,
|
||||
NODE_DEFAULT_INPUT_INDEX_FIELD = 1,
|
||||
NODE_DEFAULT_INPUT_ID_INDEX_FIELD = 2,
|
||||
NODE_DEFAULT_INPUT_NORMAL_FIELD = 3,
|
||||
NODE_DEFAULT_INPUT_POSITION_FIELD = 4,
|
||||
NODE_DEFAULT_INPUT_INSTANCE_TRANSFORM_FIELD = 5,
|
||||
NODE_DEFAULT_INPUT_HANDLE_LEFT_FIELD = 6,
|
||||
NODE_DEFAULT_INPUT_HANDLE_RIGHT_FIELD = 7,
|
||||
NODE_DEFAULT_INPUT_SCENE_FRAME = 8,
|
||||
NODE_DEFAULT_INPUT_UNIFORM_IMAGE_COORDINATES = 9,
|
||||
NODE_DEFAULT_INPUT_SELF_OBJECT = 10,
|
||||
};
|
||||
|
||||
struct bNodeTreeInterfaceSocket {
|
||||
bNodeTreeInterfaceItem item;
|
||||
|
||||
/* UI name of the socket. */
|
||||
char *name = nullptr;
|
||||
char *description = nullptr;
|
||||
/* Type idname of the socket to generate, e.g. "NodeSocketFloat". */
|
||||
char *socket_type = nullptr;
|
||||
NodeTreeInterfaceSocketFlag flag = {};
|
||||
|
||||
/* AttrDomain */
|
||||
int16_t attribute_domain = 0;
|
||||
NodeDefaultInputType default_input = NODE_DEFAULT_INPUT_VALUE;
|
||||
char *default_attribute_name = nullptr;
|
||||
|
||||
/* Unique identifier for generated sockets. */
|
||||
char *identifier = nullptr;
|
||||
/* Socket default value and associated data, e.g. bNodeSocketValueFloat. */
|
||||
void *socket_data = nullptr;
|
||||
|
||||
struct IDProperty *properties = nullptr;
|
||||
|
||||
NodeSocketInterfaceStructureType structure_type = NodeSocketInterfaceStructureType::Auto;
|
||||
|
||||
/* Needed to ensure forward compatibility of PROP_PIXEL socket subtype. */
|
||||
char is_pixel_socket_forward_compat = false;
|
||||
|
||||
char _pad[6] = {};
|
||||
|
||||
#ifdef __cplusplus
|
||||
bke::bNodeSocketType *socket_typeinfo() const;
|
||||
ColorGeometry4f socket_color() const;
|
||||
|
||||
/**
|
||||
* Set the \a socket_type and replace the \a socket_data.
|
||||
* \param new_socket_type: Socket type idname, e.g. "NodeSocketFloat"
|
||||
*/
|
||||
bool set_socket_type(StringRef new_socket_type);
|
||||
/**
|
||||
* Update the \a socket_type based on changes to \a socket_data.
|
||||
* This allows changing details like the subtype without replacing \a socket_data.
|
||||
*
|
||||
* For example, in a vector socket the dimensions are stored in the \a socket_data and after
|
||||
* changes might require switching \a socket_type between "NodeSocketVector",
|
||||
* "NodeSocketVector2D", and "NodeSocketVector4D".
|
||||
*/
|
||||
void update_socket_type();
|
||||
|
||||
/**
|
||||
* Use an existing socket to define an interface socket.
|
||||
* Replaces the current \a socket_type and any existing \a socket data if called again.
|
||||
*/
|
||||
void init_from_socket_instance(const bNodeSocket *socket);
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bNodeTreeInterfacePanel {
|
||||
bNodeTreeInterfaceItem item;
|
||||
|
||||
/* UI name of the panel. */
|
||||
char *name = nullptr;
|
||||
char *description = nullptr;
|
||||
NodeTreeInterfacePanelFlag flag = {};
|
||||
char _pad[4] = {};
|
||||
|
||||
bNodeTreeInterfaceItem **items_array = nullptr;
|
||||
int items_num = 0;
|
||||
|
||||
/* Internal unique identifier for validating panel states. */
|
||||
int identifier = 0;
|
||||
|
||||
#ifdef __cplusplus
|
||||
IndexRange items_range() const;
|
||||
Span<const bNodeTreeInterfaceItem *> items() const;
|
||||
MutableSpan<bNodeTreeInterfaceItem *> items();
|
||||
|
||||
/**
|
||||
* Check if the item is a direct child of the panel.
|
||||
*/
|
||||
bool contains(const bNodeTreeInterfaceItem &item) const;
|
||||
/**
|
||||
* Search for an item in the interface.
|
||||
* \return True if the item was found.
|
||||
*/
|
||||
bool contains_recursive(const bNodeTreeInterfaceItem &item) const;
|
||||
/**
|
||||
* Get the position of an item in this panel.
|
||||
* \return Position relative to the start of the panel items or -1 if the item is not in the
|
||||
* panel.
|
||||
*/
|
||||
int item_position(const bNodeTreeInterfaceItem &item) const;
|
||||
/**
|
||||
* Get the index of the item in the interface.
|
||||
* \return Index if the item was found or -1 otherwise.
|
||||
*/
|
||||
int item_index(const bNodeTreeInterfaceItem &item) const;
|
||||
/**
|
||||
* Get the item at the given index of the interface draw list.
|
||||
*/
|
||||
const bNodeTreeInterfaceItem *item_at_index(int index) const;
|
||||
/**
|
||||
* Find the panel containing the item among this panel and all children.
|
||||
* \return Parent panel containing the item.
|
||||
*/
|
||||
bNodeTreeInterfacePanel *find_parent_recursive(const bNodeTreeInterfaceItem &item);
|
||||
|
||||
/** Remove all items from the panel. */
|
||||
void clear(bool do_id_user);
|
||||
|
||||
/**
|
||||
* Add item at the end of the panel.
|
||||
* \note Takes ownership of the item.
|
||||
*/
|
||||
void add_item(bNodeTreeInterfaceItem &item);
|
||||
/**
|
||||
* Insert an item at the given position.
|
||||
* \note Takes ownership of the item.
|
||||
*/
|
||||
void insert_item(bNodeTreeInterfaceItem &item, int position);
|
||||
/**
|
||||
* Remove item from the panel.
|
||||
* \param free: Destruct and deallocate the item.
|
||||
* \return True if the item was found.
|
||||
*/
|
||||
bool remove_item(bNodeTreeInterfaceItem &item, bool free);
|
||||
/**
|
||||
* Move item to a new position within the panel.
|
||||
* \return True if the item was found.
|
||||
*/
|
||||
bool move_item(bNodeTreeInterfaceItem &item, int new_position);
|
||||
|
||||
/**
|
||||
* Apply a function to every item in the panel, including child panels.
|
||||
* \note The items are visited in drawing order from top to bottom.
|
||||
*
|
||||
* \param fn: Function to execute for each item, iterations stops if false is returned.
|
||||
* \param include_self: Include the panel itself in the iteration.
|
||||
*/
|
||||
void foreach_item(FunctionRef<bool(bNodeTreeInterfaceItem &item)> fn, bool include_self = false);
|
||||
/** Same as above but for a const interface. */
|
||||
void foreach_item(FunctionRef<bool(const bNodeTreeInterfaceItem &item)> fn,
|
||||
bool include_self = false) const;
|
||||
|
||||
/** Get the socket that is part of the panel header if available. */
|
||||
const bNodeTreeInterfaceSocket *header_toggle_socket() const;
|
||||
bNodeTreeInterfaceSocket *header_toggle_socket();
|
||||
|
||||
private:
|
||||
/** Find a valid position for inserting in the items span. */
|
||||
int find_valid_insert_position_for_item(const bNodeTreeInterfaceItem &item,
|
||||
int initial_position) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bNodeTreeInterface {
|
||||
bNodeTreeInterfacePanel root_panel;
|
||||
|
||||
/* Global index of the active item. */
|
||||
int active_index = 0;
|
||||
int next_uid = 0;
|
||||
|
||||
bke::bNodeTreeInterfaceRuntime *runtime = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/** Initialize data of new interface instance. */
|
||||
void init_data();
|
||||
/** Copy data from another interface.
|
||||
* \param flag: ID creation/copying flags, e.g. LIB_ID_CREATE_NO_MAIN.
|
||||
*/
|
||||
void copy_data(const bNodeTreeInterface &src, int flag);
|
||||
/** Free data before the owning data block is freed.
|
||||
* \note Does not decrement ID user counts, this has to be done by the caller.
|
||||
*/
|
||||
void free_data();
|
||||
|
||||
/** Read/write blend file data. */
|
||||
void write(BlendWriter *writer);
|
||||
void read_data(BlendDataReader *reader);
|
||||
|
||||
bNodeTreeInterfaceItem *active_item();
|
||||
const bNodeTreeInterfaceItem *active_item() const;
|
||||
void active_item_set(bNodeTreeInterfaceItem *item, bool deselect_original = true);
|
||||
|
||||
/**
|
||||
* Get the position of the item in its parent panel.
|
||||
* \return Position if the item was found or -1 otherwise.
|
||||
*/
|
||||
int find_item_position(const bNodeTreeInterfaceItem &item) const
|
||||
{
|
||||
/* const_cast to avoid a const version of #find_parent_recursive. */
|
||||
const bNodeTreeInterfacePanel *parent =
|
||||
const_cast<bNodeTreeInterfacePanel &>(root_panel).find_parent_recursive(item);
|
||||
if (parent == nullptr || parent == &root_panel) {
|
||||
/* Panel is the root panel. */
|
||||
return root_panel.item_position(item);
|
||||
}
|
||||
return parent->item_position(item);
|
||||
}
|
||||
/**
|
||||
* Get the global index of the item in the interface.
|
||||
* \return Index if the item was found or -1 otherwise.
|
||||
*/
|
||||
int find_item_index(const bNodeTreeInterfaceItem &item) const
|
||||
{
|
||||
return root_panel.item_index(item);
|
||||
}
|
||||
/**
|
||||
* Search for an item in the interface.
|
||||
* \return True if the item was found.
|
||||
*/
|
||||
bool find_item(const bNodeTreeInterfaceItem &item) const
|
||||
{
|
||||
return root_panel.contains_recursive(item);
|
||||
}
|
||||
/**
|
||||
* Get the item at the given index of the interface draw list.
|
||||
*/
|
||||
const bNodeTreeInterfaceItem *get_item_at_index(int index) const
|
||||
{
|
||||
return root_panel.item_at_index(index);
|
||||
}
|
||||
/**
|
||||
* Find the panel containing the item.
|
||||
* \param include_root: Allow #root_panel as a return value,
|
||||
* otherwise return nullptr for root items.
|
||||
* \return Parent panel containing the item.
|
||||
*/
|
||||
bNodeTreeInterfacePanel *find_item_parent(const bNodeTreeInterfaceItem &item,
|
||||
bool include_root = false)
|
||||
{
|
||||
bNodeTreeInterfacePanel *parent = root_panel.find_parent_recursive(item);
|
||||
/* Return nullptr instead the root panel. */
|
||||
if (!include_root && parent == &root_panel) {
|
||||
return nullptr;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new socket at the end of the items list.
|
||||
* \param parent: Panel in which to add the socket. If parent is null the socket is added in the
|
||||
* root panel.
|
||||
*/
|
||||
bNodeTreeInterfaceSocket *add_socket(StringRef name,
|
||||
StringRef description,
|
||||
StringRef socket_type,
|
||||
NodeTreeInterfaceSocketFlag flag,
|
||||
bNodeTreeInterfacePanel *parent);
|
||||
/**
|
||||
* Insert a new socket.
|
||||
* \param parent: Panel in which to add the socket. If parent is null the socket is added in the
|
||||
* root panel.
|
||||
* \param position: Position of the socket within the parent panel.
|
||||
*/
|
||||
bNodeTreeInterfaceSocket *insert_socket(StringRef name,
|
||||
StringRef description,
|
||||
StringRef socket_type,
|
||||
NodeTreeInterfaceSocketFlag flag,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
int position);
|
||||
|
||||
/**
|
||||
* Add a new panel at the end of the items list.
|
||||
* \param parent: Panel in which the new panel is added as a child. If parent is null the new
|
||||
* panel is made a child of the root panel.
|
||||
*/
|
||||
bNodeTreeInterfacePanel *add_panel(StringRef name,
|
||||
StringRef description,
|
||||
NodeTreeInterfacePanelFlag flag,
|
||||
bNodeTreeInterfacePanel *parent);
|
||||
/**
|
||||
* Insert a new panel.
|
||||
* \param parent: Panel in which the new panel is added as a child. If parent is null the new
|
||||
* panel is made a child of the root panel.
|
||||
* \param position: Position of the child panel within the parent panel.
|
||||
*/
|
||||
bNodeTreeInterfacePanel *insert_panel(StringRef name,
|
||||
StringRef description,
|
||||
NodeTreeInterfacePanelFlag flag,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
int position);
|
||||
|
||||
/**
|
||||
* Add a copy of an item at the end of the items list.
|
||||
* \param parent: Add the item inside the parent panel. If parent is null the item is made a
|
||||
* child of the root panel.
|
||||
*/
|
||||
bNodeTreeInterfaceItem *add_item_copy(const bNodeTreeInterfaceItem &item,
|
||||
bNodeTreeInterfacePanel *parent);
|
||||
/**
|
||||
* Insert a copy of an item.
|
||||
* \param parent: Add the item inside the parent panel. If parent is null the item is made a
|
||||
* child of the root panel.
|
||||
* \param position: Position of the item within the parent panel.
|
||||
*/
|
||||
bNodeTreeInterfaceItem *insert_item_copy(const bNodeTreeInterfaceItem &item,
|
||||
bNodeTreeInterfacePanel *parent,
|
||||
int position);
|
||||
|
||||
/**
|
||||
* Remove an item from the interface.
|
||||
* \param move_content_to_parent: If the item is a panel, move the contents to the parent instead
|
||||
* of deleting it.
|
||||
* \return True if the item was found and successfully removed.
|
||||
*/
|
||||
bool remove_item(bNodeTreeInterfaceItem &item, bool move_content_to_parent = true);
|
||||
void clear_items();
|
||||
|
||||
/**
|
||||
* Move an item to a new position.
|
||||
* \param new_position: New position of the item in the parent panel.
|
||||
*/
|
||||
bool move_item(bNodeTreeInterfaceItem &item, int new_position);
|
||||
/**
|
||||
* Move an item to a new panel and/or position.
|
||||
* \param new_parent: Panel that the item is moved to. If null the item is added to the root
|
||||
* panel.
|
||||
* \param new_position: New position of the item in the parent panel.
|
||||
*/
|
||||
bool move_item_to_parent(bNodeTreeInterfaceItem &item,
|
||||
bNodeTreeInterfacePanel *new_parent,
|
||||
int new_position);
|
||||
|
||||
/**
|
||||
* Apply a function to every item in the interface.
|
||||
* \note The items are visited in drawing order from top to bottom.
|
||||
*
|
||||
* \param fn: Function to execute for each item, iterations stops if false is returned.
|
||||
* \param include_root: Include the root panel in the iteration.
|
||||
*/
|
||||
void foreach_item(FunctionRef<bool(bNodeTreeInterfaceItem &item)> fn, bool include_root = false)
|
||||
{
|
||||
root_panel.foreach_item(fn, /*include_self=*/include_root);
|
||||
}
|
||||
/**
|
||||
* Apply a function to every item in the interface.
|
||||
* \note The items are visited in drawing order from top to bottom.
|
||||
*
|
||||
* \param fn: Function to execute for each item, iterations stops if false is returned.
|
||||
* \param include_root: Include the root panel in the iteration.
|
||||
*/
|
||||
void foreach_item(FunctionRef<bool(const bNodeTreeInterfaceItem &item)> fn,
|
||||
bool include_root = false) const
|
||||
{
|
||||
root_panel.foreach_item(fn, /*include_self=*/include_root);
|
||||
}
|
||||
|
||||
/** Callback for every ID pointer in the interface data. */
|
||||
void foreach_id(LibraryForeachIDData *cb);
|
||||
|
||||
/** True if the items cache is ready to use. */
|
||||
bool items_cache_is_available() const;
|
||||
|
||||
/** Ensure the items cache can be accessed. */
|
||||
void ensure_items_cache() const;
|
||||
|
||||
/** Find the index of an input socket by its string identifier. */
|
||||
int input_index_by_identifier(StringRef identifier) const;
|
||||
/** Find the index of an output socket by its string identifier. */
|
||||
int output_index_by_identifier(StringRef identifier) const;
|
||||
|
||||
/** True if any trees and nodes depending on the interface require updates. */
|
||||
bool requires_dependent_tree_updates() const;
|
||||
|
||||
/** Call after changing the items list. */
|
||||
void tag_items_changed();
|
||||
/** Call after generic user changes through the API. */
|
||||
void tag_items_changed_generic();
|
||||
/** Call after changing an item property. */
|
||||
void tag_item_property_changed();
|
||||
|
||||
/**
|
||||
* Reset flag to indicate that dependent trees have been updated.
|
||||
* Should only be called by #NodeTreeMainUpdater.
|
||||
*/
|
||||
void reset_interface_changed();
|
||||
|
||||
private:
|
||||
/** Tag after interface changes that require updates to dependent trees. */
|
||||
void tag_interface_changed();
|
||||
/** Invalidate caches and force full tree update after loading DNA. */
|
||||
void tag_missing_runtime_data();
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
3938
blender-5.2.0/source/blender/makesdna/DNA_node_types.h
Normal file
3938
blender-5.2.0/source/blender/makesdna/DNA_node_types.h
Normal file
File diff suppressed because it is too large
Load Diff
69
blender-5.2.0/source/blender/makesdna/DNA_object_enums.h
Normal file
69
blender-5.2.0/source/blender/makesdna/DNA_object_enums.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Enums typedef's for use in public headers.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** #Object.mode */
|
||||
enum eObjectMode : int {
|
||||
OB_MODE_OBJECT = 0,
|
||||
OB_MODE_EDIT = 1 << 0,
|
||||
OB_MODE_SCULPT = 1 << 1,
|
||||
OB_MODE_VERTEX_PAINT = 1 << 2,
|
||||
OB_MODE_WEIGHT_PAINT = 1 << 3,
|
||||
OB_MODE_TEXTURE_PAINT = 1 << 4,
|
||||
OB_MODE_PARTICLE_EDIT = 1 << 5,
|
||||
OB_MODE_POSE = 1 << 6,
|
||||
OB_MODE_EDIT_GPENCIL_LEGACY = 1 << 7,
|
||||
OB_MODE_PAINT_GREASE_PENCIL = 1 << 8,
|
||||
OB_MODE_SCULPT_GREASE_PENCIL = 1 << 9,
|
||||
OB_MODE_WEIGHT_GREASE_PENCIL = 1 << 10,
|
||||
OB_MODE_VERTEX_GREASE_PENCIL = 1 << 11,
|
||||
OB_MODE_SCULPT_CURVES = 1 << 12,
|
||||
};
|
||||
ENUM_OPERATORS(eObjectMode)
|
||||
|
||||
/** #Object.dt, #View3DShading.type */
|
||||
enum eDrawType : char {
|
||||
OB_BOUNDBOX = 1,
|
||||
OB_WIRE = 2,
|
||||
OB_SOLID = 3,
|
||||
OB_MATERIAL = 4,
|
||||
OB_TEXTURE = 5,
|
||||
OB_RENDER = 6,
|
||||
};
|
||||
|
||||
/** Any mode where the brush system is used. */
|
||||
#define OB_MODE_ALL_PAINT \
|
||||
(OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)
|
||||
|
||||
#define OB_MODE_ALL_PAINT_GPENCIL \
|
||||
(OB_MODE_PAINT_GREASE_PENCIL | OB_MODE_SCULPT_GREASE_PENCIL | OB_MODE_WEIGHT_GREASE_PENCIL | \
|
||||
OB_MODE_VERTEX_GREASE_PENCIL)
|
||||
|
||||
/** Any mode that uses object.runtime->sculpt_session. */
|
||||
#define OB_MODE_ALL_SCULPT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)
|
||||
|
||||
/** Any mode that uses weight-paint. */
|
||||
#define OB_MODE_ALL_WEIGHT_PAINT (OB_MODE_WEIGHT_PAINT | OB_MODE_WEIGHT_GREASE_PENCIL)
|
||||
|
||||
/**
|
||||
* Any mode that has data or for Grease Pencil modes, we need to free when switching modes,
|
||||
* see: #ed::object::mode_generic_exit
|
||||
*/
|
||||
#define OB_MODE_ALL_MODE_DATA \
|
||||
(OB_MODE_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE | \
|
||||
OB_MODE_PAINT_GREASE_PENCIL | OB_MODE_EDIT_GPENCIL_LEGACY | OB_MODE_SCULPT_GREASE_PENCIL | \
|
||||
OB_MODE_WEIGHT_GREASE_PENCIL | OB_MODE_VERTEX_GREASE_PENCIL | OB_MODE_SCULPT_CURVES)
|
||||
|
||||
} // namespace blender
|
||||
@@ -0,0 +1,142 @@
|
||||
/* SPDX-FileCopyrightText: 2004-2005 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "DNA_defs.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** #FluidsimSettings::type */
|
||||
enum eFluidsim_Type : short {
|
||||
OB_FLUIDSIM_ENABLE = 1,
|
||||
OB_FLUIDSIM_DOMAIN = 1 << 1,
|
||||
OB_FLUIDSIM_FLUID = 1 << 2,
|
||||
OB_FLUIDSIM_OBSTACLE = 1 << 3,
|
||||
OB_FLUIDSIM_INFLOW = 1 << 4,
|
||||
OB_FLUIDSIM_OUTFLOW = 1 << 5,
|
||||
OB_FLUIDSIM_PARTICLE = 1 << 6,
|
||||
OB_FLUIDSIM_CONTROL = 1 << 7,
|
||||
};
|
||||
ENUM_OPERATORS(eFluidsim_Type)
|
||||
|
||||
/** #FluidsimSettings::flag. */
|
||||
enum eFluidsim_Flag : int {
|
||||
OB_FLUIDSIM_REVERSE = 1 << 0,
|
||||
OB_FLUIDSIM_ACTIVE = 1 << 1,
|
||||
OB_FLUIDSIM_OVERRIDE_TIME = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eFluidsim_Flag)
|
||||
|
||||
struct FluidVertexVelocity {
|
||||
float vel[3] = {};
|
||||
};
|
||||
|
||||
struct FluidsimSettings {
|
||||
/** DEPRECATED. For fast RNA access. */
|
||||
struct FluidsimModifierData *fmd = nullptr;
|
||||
/* threadcont the calculation is done with */
|
||||
int threads = 0;
|
||||
char _pad1[4] = {};
|
||||
/* domain, fluid or obstacle */
|
||||
eFluidsim_Type type = {};
|
||||
/* Display advanced options in fluid sim tab (on=1, off=0). */
|
||||
short show_advancedoptions = 0;
|
||||
|
||||
/* domain object settings */
|
||||
/* resolutions */
|
||||
short resolutionxyz = 0;
|
||||
short previewresxyz = 0;
|
||||
/* size of the domain in real units (meters along largest resolution x, y, z extent) */
|
||||
float realsize = 0;
|
||||
/* show original meshes, preview or final sim */
|
||||
short guiDisplayMode = 0;
|
||||
short renderDisplayMode = 0;
|
||||
|
||||
/* fluid properties */
|
||||
float viscosityValue = 0;
|
||||
DNA_DEPRECATED short viscosityMode = 0;
|
||||
short viscosityExponent = 0;
|
||||
/* gravity strength */
|
||||
float grav[3] = {};
|
||||
/* anim start end time (in seconds) */
|
||||
float animStart = 0, animEnd = 0;
|
||||
/* bake start end time (in blender frames) */
|
||||
int bakeStart = 0, bakeEnd = 0;
|
||||
/* offset for baked frames */
|
||||
int frameOffset = 0;
|
||||
char _pad2[4] = {};
|
||||
/* g star param (LBM compressibility) */
|
||||
float gstar = 0;
|
||||
/* activate refinement? */
|
||||
int maxRefine = 0;
|
||||
|
||||
/* fluid object type settings */
|
||||
/* gravity strength */
|
||||
float iniVelx = 0, iniVely = 0, iniVelz = 0;
|
||||
|
||||
/**
|
||||
* Store output path, and file prefix for baked fluid surface.
|
||||
*/
|
||||
char surfdataPath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
/* store start coords of axis aligned bounding box together with size */
|
||||
/* values are initialized during derived mesh display. */
|
||||
float bbStart[3] = {}, bbSize[3] = {};
|
||||
|
||||
/* additional flags depending on the type, lower short contains flags
|
||||
* to check validity, higher short additional flags */
|
||||
short typeFlags = 0;
|
||||
/**
|
||||
* Switch off velocity generation,
|
||||
* volume init type for fluid/obstacles (volume=1, shell=2, both=3).
|
||||
*/
|
||||
char domainNovecgen = 0, volumeInitType = 0;
|
||||
|
||||
/* boundary "stickiness" for part slip values */
|
||||
float partSlipValue = 0;
|
||||
|
||||
/* number of tracers to generate */
|
||||
int generateTracers = 0;
|
||||
/* particle generation - on if >0, then determines amount (experimental...) */
|
||||
float generateParticles = 0;
|
||||
/* smooth fluid surface? */
|
||||
float surfaceSmoothing = 0;
|
||||
/** Number of surface subdivisions. */
|
||||
int surfaceSubdivs = 0;
|
||||
/** GUI flags. */
|
||||
eFluidsim_Flag flag = {};
|
||||
|
||||
/** Particle display - size scaling, and alpha influence. */
|
||||
float particleInfSize = 0, particleInfAlpha = 0;
|
||||
/* testing vars */
|
||||
float farFieldSize = 0;
|
||||
|
||||
/** Vertex velocities of simulated fluid mesh. */
|
||||
struct FluidVertexVelocity *meshVelocities = nullptr;
|
||||
/** Number of vertices in simulated fluid mesh. */
|
||||
int totvert = 0;
|
||||
|
||||
/* Fluid control settings */
|
||||
float cpsTimeStart = 0;
|
||||
float cpsTimeEnd = 0;
|
||||
float cpsQuality = 0;
|
||||
|
||||
float attractforceStrength = 0;
|
||||
float attractforceRadius = 0;
|
||||
float velocityforceStrength = 0;
|
||||
float velocityforceRadius = 0;
|
||||
|
||||
int lastgoodframe = 0;
|
||||
|
||||
/** Simulation/flow rate control. */
|
||||
float animRate = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
415
blender-5.2.0/source/blender/makesdna/DNA_object_force_types.h
Normal file
415
blender-5.2.0/source/blender/makesdna/DNA_object_force_types.h
Normal file
@@ -0,0 +1,415 @@
|
||||
/* SPDX-FileCopyrightText: 2004-2005 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct BodySpring;
|
||||
|
||||
/** #EffectorWeights::flag */
|
||||
enum eEffectorWeight_Flag : short {
|
||||
EFF_WEIGHT_DO_HAIR = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eEffectorWeight_Flag)
|
||||
|
||||
/** #PartDeflect::flag: various settings. */
|
||||
enum ePField_Flag : int {
|
||||
PFIELD_USEMAX = 1 << 0,
|
||||
// PDEFLE_DEFORM = 1 << 1, /* UNUSED */
|
||||
/** TODO: do_versions for below */
|
||||
PFIELD_GUIDE_PATH_ADD = 1 << 2,
|
||||
/** used for do_versions */
|
||||
PFIELD_PLANAR = 1 << 3,
|
||||
PDEFLE_KILL_PART = 1 << 4,
|
||||
/** used for do_versions */
|
||||
PFIELD_POSZ = 1 << 5,
|
||||
PFIELD_TEX_OBJECT = 1 << 6,
|
||||
/** used for turbulence */
|
||||
PFIELD_GLOBAL_CO = 1 << 6,
|
||||
PFIELD_TEX_2D = 1 << 7,
|
||||
/** used for harmonic force */
|
||||
PFIELD_MULTIPLE_SPRINGS = 1 << 7,
|
||||
PFIELD_USEMIN = 1 << 8,
|
||||
PFIELD_USEMAXR = 1 << 9,
|
||||
PFIELD_USEMINR = 1 << 10,
|
||||
PFIELD_TEX_ROOTCO = 1 << 11,
|
||||
/** used for do_versions */
|
||||
PFIELD_SURFACE = 1 << 12,
|
||||
PFIELD_VISIBILITY = 1 << 13,
|
||||
PFIELD_DO_LOCATION = 1 << 14,
|
||||
PFIELD_DO_ROTATION = 1 << 15,
|
||||
/** apply curve weights */
|
||||
PFIELD_GUIDE_PATH_WEIGHT = 1 << 16,
|
||||
/** multiply smoke force by density */
|
||||
PFIELD_SMOKE_DENSITY = 1 << 17,
|
||||
/** used for (simple) force */
|
||||
PFIELD_GRAVITATION = 1 << 18,
|
||||
/** Enable cloth collision side detection based on normal. */
|
||||
PFIELD_CLOTH_USE_CULLING = 1 << 19,
|
||||
/** Replace collision direction with collider normal. */
|
||||
PFIELD_CLOTH_USE_NORMAL = 1 << 20,
|
||||
};
|
||||
ENUM_OPERATORS(ePField_Flag)
|
||||
|
||||
/** #PartDeflect::falloff */
|
||||
enum ePField_Falloff : short {
|
||||
PFIELD_FALL_SPHERE = 0,
|
||||
PFIELD_FALL_TUBE = 1,
|
||||
PFIELD_FALL_CONE = 2,
|
||||
};
|
||||
|
||||
/** #PartDeflect::shape */
|
||||
enum ePField_Shape : short {
|
||||
PFIELD_SHAPE_POINT = 0,
|
||||
PFIELD_SHAPE_PLANE = 1,
|
||||
PFIELD_SHAPE_SURFACE = 2,
|
||||
PFIELD_SHAPE_POINTS = 3,
|
||||
PFIELD_SHAPE_LINE = 4,
|
||||
};
|
||||
|
||||
/** #PartDeflect::tex_mode */
|
||||
enum ePField_TexMode : short {
|
||||
PFIELD_TEX_RGB = 0,
|
||||
PFIELD_TEX_GRAD = 1,
|
||||
PFIELD_TEX_CURL = 2,
|
||||
};
|
||||
|
||||
/** #PartDeflect::zdir */
|
||||
enum ePField_ZDir : short {
|
||||
PFIELD_Z_BOTH = 0,
|
||||
PFIELD_Z_POS = 1,
|
||||
PFIELD_Z_NEG = 2,
|
||||
};
|
||||
|
||||
/** #Object::softflag */
|
||||
enum eSoftBody_Flag : int {
|
||||
OB_SB_ENABLE = 1 << 0, /* Deprecated (use modifier). */
|
||||
OB_SB_GOAL = 1 << 1,
|
||||
OB_SB_EDGES = 1 << 2,
|
||||
OB_SB_QUADS = 1 << 3,
|
||||
OB_SB_POSTDEF = 1 << 4,
|
||||
// OB_SB_REDO = 1 << 5,
|
||||
// OB_SB_BAKESET = 1 << 6,
|
||||
// OB_SB_BAKEDO = 1 << 7,
|
||||
// OB_SB_RESET = 1 << 8,
|
||||
OB_SB_SELF = 1 << 9,
|
||||
OB_SB_FACECOLL = 1 << 10,
|
||||
OB_SB_EDGECOLL = 1 << 11,
|
||||
// OB_SB_COLLFINAL = 1 << 12, /* Deprecated. */
|
||||
// OB_SB_BIG_UI = 1 << 13, /* Deprecated. */
|
||||
OB_SB_AERO_ANGLE = 1 << 14,
|
||||
};
|
||||
ENUM_OPERATORS(eSoftBody_Flag)
|
||||
|
||||
/** #SoftBody::solverflags */
|
||||
enum eSoftBody_SolverFlag : char {
|
||||
SBSO_MONITOR = 1 << 0,
|
||||
SBSO_OLDERR = 1 << 1,
|
||||
SBSO_ESTIMATEIPO = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eSoftBody_SolverFlag)
|
||||
|
||||
/** #SoftBody::sbc_mode */
|
||||
enum eSoftBody_Mode : short {
|
||||
SBC_MODE_MANUAL = 0,
|
||||
SBC_MODE_AVG = 1,
|
||||
SBC_MODE_MIN = 2,
|
||||
SBC_MODE_MAX = 3,
|
||||
SBC_MODE_AVGMINMAX = 4,
|
||||
};
|
||||
|
||||
/** #PartDeflect.forcefield: Effector Fields types. */
|
||||
enum ePFieldType : short {
|
||||
/** (this is used for general effector weight). */
|
||||
PFIELD_NULL = 0,
|
||||
/** Force away/towards a point depending on force strength. */
|
||||
PFIELD_FORCE = 1,
|
||||
/** Force around the effector normal. */
|
||||
PFIELD_VORTEX = 2,
|
||||
/** Force from the cross product of effector normal and point velocity. */
|
||||
PFIELD_MAGNET = 3,
|
||||
/** Force away and towards a point depending which side of the effector normal the point is. */
|
||||
PFIELD_WIND = 4,
|
||||
/** Force along curve for dynamics, a shaping curve for hair paths. */
|
||||
PFIELD_GUIDE = 5,
|
||||
/** Force based on texture values calculated at point coordinates. */
|
||||
PFIELD_TEXTURE = 6,
|
||||
/** Force of a harmonic (damped) oscillator. */
|
||||
PFIELD_HARMONIC = 7,
|
||||
/** Force away/towards a point depending on point charge. */
|
||||
PFIELD_CHARGE = 8,
|
||||
/** Force due to a Lennard-Jones potential. */
|
||||
PFIELD_LENNARDJ = 9,
|
||||
/** Defines predator / goal for boids. */
|
||||
PFIELD_BOID = 10,
|
||||
/** Force defined by BLI_noise_generic_turbulence. */
|
||||
PFIELD_TURBULENCE = 11,
|
||||
/** Linear & quadratic drag. */
|
||||
PFIELD_DRAG = 12,
|
||||
/** Force based on fluid simulation velocities. */
|
||||
PFIELD_FLUIDFLOW = 13,
|
||||
|
||||
/* Keep last. */
|
||||
NUM_PFIELD_TYPES,
|
||||
};
|
||||
|
||||
struct PartDeflect {
|
||||
/** General settings flag. */
|
||||
ePField_Flag flag = {};
|
||||
/** Deflection flag - does mesh deflect particles. */
|
||||
short deflect = 0;
|
||||
/** Force field type, do the vertices attract / repel particles? */
|
||||
ePFieldType forcefield = PFIELD_NULL;
|
||||
/** Fall-off type. */
|
||||
ePField_Falloff falloff = PFIELD_FALL_SPHERE;
|
||||
/** Point, plane or surface. */
|
||||
ePField_Shape shape = PFIELD_SHAPE_POINT;
|
||||
/** Texture effector. */
|
||||
ePField_TexMode tex_mode = PFIELD_TEX_RGB;
|
||||
/** For curve guide. */
|
||||
short kink = 0, kink_axis = 0;
|
||||
ePField_ZDir zdir = PFIELD_Z_BOTH;
|
||||
|
||||
/* Main effector values */
|
||||
/** The strength of the force (+ or - ). */
|
||||
float f_strength = 0;
|
||||
/** Damping ratio of the harmonic effector. */
|
||||
float f_damp = 0;
|
||||
/**
|
||||
* How much force is converted into "air flow", i.e.
|
||||
* force used as the velocity of surrounding medium. */
|
||||
float f_flow = 0;
|
||||
/** How much force is reduced when acting parallel to a surface, e.g. cloth. */
|
||||
float f_wind_factor = 0;
|
||||
|
||||
char _pad0[4] = {};
|
||||
|
||||
/** Noise size for noise effector, restlength for harmonic effector. */
|
||||
float f_size = 0;
|
||||
|
||||
/* fall-off */
|
||||
/** The power law - real gravitation is 2 (square). */
|
||||
float f_power = 0;
|
||||
/** If indicated, use this maximum. */
|
||||
float maxdist = 0;
|
||||
/** If indicated, use this minimum. */
|
||||
float mindist = 0;
|
||||
/** Radial fall-off power. */
|
||||
float f_power_r = 0;
|
||||
/** Radial versions of above. */
|
||||
float maxrad = 0;
|
||||
float minrad = 0;
|
||||
|
||||
/* particle collisions */
|
||||
/** Damping factor for particle deflection. */
|
||||
float pdef_damp = 0;
|
||||
/** Random element of damping for deflection. */
|
||||
float pdef_rdamp = 0;
|
||||
/** Chance of particle passing through mesh. */
|
||||
float pdef_perm = 0;
|
||||
/** Friction factor for particle deflection. */
|
||||
float pdef_frict = 0;
|
||||
/** Random element of friction for deflection. */
|
||||
float pdef_rfrict = 0;
|
||||
/** Surface particle stickiness. */
|
||||
float pdef_stickness = 0;
|
||||
|
||||
/** Used for forces. */
|
||||
float absorption = 0;
|
||||
|
||||
/* softbody collisions */
|
||||
/** Damping factor for softbody deflection. */
|
||||
float pdef_sbdamp = 0;
|
||||
/** Inner face thickness for softbody deflection. */
|
||||
float pdef_sbift = 0;
|
||||
/** Outer face thickness for softbody deflection. */
|
||||
float pdef_sboft = 0;
|
||||
|
||||
/* guide curve, same as for particle child effects */
|
||||
float clump_fac = 0, clump_pow = 0;
|
||||
float kink_freq = 0, kink_shape = 0, kink_amp = 0, free_end = 0;
|
||||
|
||||
/* texture effector */
|
||||
/** Used for calculating partial derivatives. */
|
||||
float tex_nabla = 0;
|
||||
/** Texture of the texture effector. */
|
||||
struct Tex *tex = nullptr;
|
||||
|
||||
/* effector noise */
|
||||
/** Noise of force. */
|
||||
float f_noise = 0;
|
||||
/** Noise random seed. */
|
||||
int seed = 0;
|
||||
|
||||
/* Display Size */
|
||||
/** Runtime only : start of the curve or draw scale. */
|
||||
float drawvec1[4] = {};
|
||||
/** Runtime only : end of the curve. */
|
||||
float drawvec2[4] = {};
|
||||
/** Runtime only. */
|
||||
float drawvec_falloff_min[3] = {};
|
||||
char _pad1[4] = {};
|
||||
/** Runtime only. */
|
||||
float drawvec_falloff_max[3] = {};
|
||||
char _pad2[4] = {};
|
||||
|
||||
/** Force source object. */
|
||||
struct Object *f_source = nullptr;
|
||||
|
||||
/** Friction of cloth collisions. */
|
||||
float pdef_cfrict = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct EffectorWeights {
|
||||
/** Only use effectors from this group of objects. */
|
||||
struct Collection *group = nullptr;
|
||||
|
||||
/** Effector type specific weights. */
|
||||
float weight[14] = {};
|
||||
float global_gravity = 0;
|
||||
eEffectorWeight_Flag flag = {};
|
||||
char _pad[2] = {};
|
||||
};
|
||||
|
||||
struct SBVertex {
|
||||
float vec[4] = {};
|
||||
};
|
||||
|
||||
/* Container for data that is shared among evaluated copies.
|
||||
*
|
||||
* This is placed in a separate struct so that values can be changed
|
||||
* without having to update all evaluated copies. */
|
||||
struct SoftBody_Shared {
|
||||
struct PointCache *pointcache = nullptr;
|
||||
ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
struct SoftBody {
|
||||
DNA_DEFINE_CXX_METHODS(SoftBody)
|
||||
|
||||
/* dynamic data */
|
||||
int totpoint = 0, totspring = 0;
|
||||
/** Not saved in file. */
|
||||
struct BodyPoint *bpoint = nullptr;
|
||||
/** Not saved in file. */
|
||||
struct BodySpring *bspring = nullptr;
|
||||
char _pad = {};
|
||||
char msg_lock = 0;
|
||||
short msg_value = 0;
|
||||
|
||||
/* part of UI: */
|
||||
|
||||
/* general options */
|
||||
/** Softbody mass of *vertex*. */
|
||||
float nodemass = 0;
|
||||
/**
|
||||
* Along with it introduce mass painting starting to fix old bug .. nastiness that VG are indexes
|
||||
* rather find them by name tag to find it -> jow20090613.
|
||||
*/
|
||||
char namedVG_Mass[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
/** Softbody amount of gravitation to apply. */
|
||||
float grav = 0;
|
||||
/** Friction to env. */
|
||||
float mediafrict = 0;
|
||||
/** Error limit for ODE solver. */
|
||||
float rklimit = 0;
|
||||
/** User control over simulation speed. */
|
||||
float physics_speed = 0;
|
||||
|
||||
/* goal */
|
||||
/** Softbody goal springs. */
|
||||
float goalspring = 0;
|
||||
/** Softbody goal springs friction. */
|
||||
float goalfrict = 0;
|
||||
/** Quick limits for goal. */
|
||||
float mingoal = 0;
|
||||
float maxgoal = 0;
|
||||
/** Default goal for vertices without vgroup. */
|
||||
float defgoal = 0;
|
||||
/** Index starting at 1. */
|
||||
short vertgroup = 0;
|
||||
/**
|
||||
* Starting to fix old bug .. nastiness that VG are indexes
|
||||
* rather find them by name tag to find it -> jow20090613.
|
||||
*/
|
||||
char namedVG_Softgoal[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
|
||||
short fuzzyness = 0;
|
||||
|
||||
/* springs */
|
||||
/** Softbody inner springs. */
|
||||
float inspring = 0;
|
||||
/** Softbody inner springs friction. */
|
||||
float infrict = 0;
|
||||
/**
|
||||
* Along with it introduce Spring_K painting
|
||||
* starting to fix old bug .. nastiness that VG are indexes
|
||||
* rather find them by name tag to find it -> jow20090613.
|
||||
*/
|
||||
char namedVG_Spring_K[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
|
||||
/* baking */
|
||||
char _pad1[6] = {};
|
||||
/** Local==1: use local coords for baking. */
|
||||
char local = 0;
|
||||
eSoftBody_SolverFlag solverflags = {};
|
||||
|
||||
/* -- these must be kept for backwards compatibility -- */
|
||||
/** Array of size totpointkey. */
|
||||
SBVertex **keys = nullptr;
|
||||
/** If totpointkey != totpoint or totkey!- (efra-sfra)/interval -> free keys. */
|
||||
int totpointkey = 0, totkey = 0;
|
||||
/* ---------------------------------------------------- */
|
||||
float secondspring = 0;
|
||||
|
||||
/* Self collision. */
|
||||
/** Fixed collision ball size if > 0. */
|
||||
float colball = 0;
|
||||
/** Cooling down collision response. */
|
||||
float balldamp = 0;
|
||||
/** Pressure the ball is loaded with. */
|
||||
float ballstiff = 0;
|
||||
eSoftBody_Mode sbc_mode = SBC_MODE_MANUAL;
|
||||
short aeroedge = 0;
|
||||
short minloops = 0;
|
||||
short maxloops = 0;
|
||||
short choke = 0;
|
||||
short solver_ID = 0;
|
||||
short plastic = 0;
|
||||
short springpreload = 0;
|
||||
|
||||
/** Scratchpad/cache on live time not saved in file. */
|
||||
struct SBScratch *scratch = nullptr;
|
||||
float shearstiff = 0;
|
||||
float inpush = 0;
|
||||
|
||||
struct SoftBody_Shared *shared = nullptr;
|
||||
/** Moved to SoftBody_Shared. */
|
||||
DNA_DEPRECATED struct PointCache *pointcache = nullptr;
|
||||
/** Moved to SoftBody_Shared. */
|
||||
ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
|
||||
|
||||
struct Collection *collision_group = nullptr;
|
||||
|
||||
struct EffectorWeights *effector_weights = nullptr;
|
||||
/* Reverse estimated object-matrix (run-time data, no need to store in the file). */
|
||||
float lcom[3] = {};
|
||||
float lrot[3][3] = {};
|
||||
float lscale[3][3] = {};
|
||||
|
||||
int last_frame = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
790
blender-5.2.0/source/blender/makesdna/DNA_object_types.h
Normal file
790
blender-5.2.0/source/blender/makesdna/DNA_object_types.h
Normal file
@@ -0,0 +1,790 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* \brief Object is a sort of wrapper for general info.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_constants.h"
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
|
||||
#include "DNA_object_enums.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_action_types.h" /* bAnimVizSettings */
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_vec_defaults.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
struct ObjectRuntime;
|
||||
}
|
||||
|
||||
struct AnimData;
|
||||
struct BoundBox;
|
||||
struct Collection;
|
||||
struct Curve;
|
||||
struct Effect;
|
||||
struct FluidsimSettings;
|
||||
struct GpencilModifierData;
|
||||
struct ImageUser;
|
||||
struct LightgroupMembership;
|
||||
struct Material;
|
||||
struct ModifierData;
|
||||
struct ObHook;
|
||||
struct Object;
|
||||
struct PartDeflect;
|
||||
struct ParticleSystem;
|
||||
struct Path;
|
||||
struct RigidBodyOb;
|
||||
struct ShaderFxData;
|
||||
struct SoftBody;
|
||||
struct bGPdata;
|
||||
struct bFaceMap;
|
||||
|
||||
#define MAX_VGROUP_NAME 64
|
||||
|
||||
/** #bDeformGroup::flag */
|
||||
enum ebDeformGroup_Flag : char {
|
||||
DG_LOCK_WEIGHT = 1,
|
||||
};
|
||||
ENUM_OPERATORS(ebDeformGroup_Flag)
|
||||
|
||||
/* **************** BASE ********************* */
|
||||
|
||||
/** #Base::flag_legacy (also used for #Object::flag). */
|
||||
enum eObject_Flag : short {
|
||||
OB_SELECT = (1 << 0),
|
||||
BA_WAS_SEL = (1 << 1),
|
||||
/* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in `readfile.cc`. */
|
||||
// BA_HAS_RECALC_OB = 1 << 2, /* DEPRECATED */
|
||||
// BA_HAS_RECALC_DATA = 1 << 3, /* DEPRECATED */
|
||||
/** DEPRECATED, was runtime only, but was reusing an older flag. */
|
||||
BA_SNAP_FIX_DEPS_FIASCO = (1 << 2),
|
||||
|
||||
/** NOTE: this was used as a proper setting in past, so nullify before using */
|
||||
BA_TEMP_TAG = 1 << 5,
|
||||
/**
|
||||
* Even if this is tagged for transform, this flag means it's being locked in place.
|
||||
* Use for #SCE_XFORM_SKIP_CHILDREN.
|
||||
*/
|
||||
BA_TRANSFORM_LOCKED_IN_PLACE = 1 << 7,
|
||||
|
||||
/** Child of a transformed object. */
|
||||
BA_TRANSFORM_CHILD = 1 << 8,
|
||||
/** Parent of a transformed object. */
|
||||
BA_TRANSFORM_PARENT = 1 << 13,
|
||||
|
||||
OB_FROMDUPLI = 1 << 9,
|
||||
/** Unknown state, clear before use. */
|
||||
OB_DONE = 1 << 10,
|
||||
OB_FLAG_USE_SIMULATION_CACHE = 1 << 11,
|
||||
/** Used for the clipboard to mark the active object. */
|
||||
OB_FLAG_ACTIVE_CLIPBOARD = 1 << 12,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_Flag)
|
||||
|
||||
/* **************** OBJECT ********************* */
|
||||
|
||||
/** #Object.type */
|
||||
enum ObjectType : short {
|
||||
OB_EMPTY = 0,
|
||||
OB_MESH = 1,
|
||||
/** Curve object is still used but replaced by "Curves" for the future (see #95355). */
|
||||
OB_CURVES_LEGACY = 2,
|
||||
OB_SURF = 3,
|
||||
OB_FONT = 4,
|
||||
OB_MBALL = 5,
|
||||
|
||||
OB_LAMP = 10,
|
||||
OB_CAMERA = 11,
|
||||
|
||||
OB_SPEAKER = 12,
|
||||
OB_LIGHTPROBE = 13,
|
||||
|
||||
OB_LATTICE = 22,
|
||||
|
||||
OB_ARMATURE = 25,
|
||||
|
||||
OB_GPENCIL_LEGACY = 26,
|
||||
|
||||
OB_CURVES = 27,
|
||||
|
||||
OB_POINTCLOUD = 28,
|
||||
|
||||
OB_VOLUME = 29,
|
||||
|
||||
OB_GREASE_PENCIL = 30,
|
||||
|
||||
/* Keep last. */
|
||||
OB_TYPE_MAX,
|
||||
};
|
||||
|
||||
/** #Object.partype: first 4 bits: type. */
|
||||
enum eObject_Partype : short {
|
||||
PAROBJECT = 0,
|
||||
PARSKEL = 4,
|
||||
PARVERT1 = 5,
|
||||
PARVERT3 = 6,
|
||||
PARBONE = 7,
|
||||
/** Mask for the parent type bits. */
|
||||
PARTYPE = (1 << 4) - 1,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_Partype)
|
||||
|
||||
/** #Object.transflag (short) */
|
||||
enum eObject_TransFlag : short {
|
||||
OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK = 1 << 0,
|
||||
OB_TRANSFLAG_UNUSED_1 = 1 << 1, /* cleared */
|
||||
OB_NEG_SCALE = 1 << 2,
|
||||
OB_TRANSFLAG_UNUSED_3 = 1 << 3, /* cleared */
|
||||
OB_DUPLIVERTS = 1 << 4,
|
||||
OB_DUPLIROT = 1 << 5,
|
||||
OB_TRANSFLAG_UNUSED_6 = 1 << 6, /* cleared */
|
||||
/* runtime, calculate derivedmesh for dupli before it's used */
|
||||
OB_TRANSFLAG_UNUSED_7 = 1 << 7, /* dirty */
|
||||
OB_DUPLICOLLECTION = 1 << 8,
|
||||
OB_DUPLIFACES = 1 << 9,
|
||||
OB_DUPLIFACES_SCALE = 1 << 10,
|
||||
OB_DUPLIPARTS = 1 << 11,
|
||||
OB_TRANSFLAG_UNUSED_12 = 1 << 12, /* cleared */
|
||||
/* runtime constraints disable */
|
||||
OB_NO_CONSTRAINTS = 1 << 13,
|
||||
/* when calculating vertex parent position, ignore CD_ORIGINDEX layer */
|
||||
OB_PARENT_USE_FINAL_INDICES = 1 << 14,
|
||||
|
||||
OB_DUPLI = OB_DUPLIVERTS | OB_DUPLICOLLECTION | OB_DUPLIFACES | OB_DUPLIPARTS,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_TransFlag)
|
||||
|
||||
/** #Object.trackflag / #Object.upflag (short) */
|
||||
enum eObject_Axis : short {
|
||||
OB_POSX = 0,
|
||||
OB_POSY = 1,
|
||||
OB_POSZ = 2,
|
||||
OB_NEGX = 3,
|
||||
OB_NEGY = 4,
|
||||
OB_NEGZ = 5,
|
||||
};
|
||||
|
||||
/** #Object.dtx draw type extra flags (short) */
|
||||
enum eObject_DrawExtraFlag : short {
|
||||
OB_DRAWBOUNDOX = 1 << 0,
|
||||
OB_AXIS = 1 << 1,
|
||||
OB_TEXSPACE = 1 << 2,
|
||||
OB_DRAWNAME = 1 << 3,
|
||||
/* OB_DRAWIMAGE = 1 << 4, */ /* UNUSED */
|
||||
/* for solid+wire display */
|
||||
OB_DRAWWIRE = 1 << 5,
|
||||
/* For overdrawing. */
|
||||
OB_DRAW_IN_FRONT = 1 << 6,
|
||||
/* Enable transparent draw. */
|
||||
OB_DRAWTRANSP = 1 << 7,
|
||||
OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */
|
||||
OB_DRAW_NO_SHADOW_CAST = 1 << 9,
|
||||
/* Enable lights for grease pencil. */
|
||||
OB_USE_GPENCIL_LIGHTS = 1 << 10,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_DrawExtraFlag)
|
||||
|
||||
/** #Object.empty_drawtype: no flags */
|
||||
enum eObject_EmptyDrawType : char {
|
||||
OB_ARROWS = 1,
|
||||
OB_PLAINAXES = 2,
|
||||
OB_CIRCLE = 3,
|
||||
OB_SINGLE_ARROW = 4,
|
||||
OB_CUBE = 5,
|
||||
OB_EMPTY_SPHERE = 6,
|
||||
OB_EMPTY_CONE = 7,
|
||||
OB_EMPTY_IMAGE = 8,
|
||||
};
|
||||
|
||||
/**
|
||||
* Grease-pencil add types.
|
||||
* TODO: doesn't need to be DNA, local to `OBJECT_OT_gpencil_add`.
|
||||
*/
|
||||
enum eGpencil_AddType : int {
|
||||
GP_EMPTY = 0,
|
||||
GP_STROKE = 1,
|
||||
GP_MONKEY = 2,
|
||||
GREASE_PENCIL_LINEART_SCENE = 3,
|
||||
GREASE_PENCIL_LINEART_OBJECT = 4,
|
||||
GREASE_PENCIL_LINEART_COLLECTION = 5,
|
||||
};
|
||||
|
||||
/** #Object.boundtype */
|
||||
enum eObject_BoundType : char {
|
||||
OB_BOUND_BOX = 0,
|
||||
OB_BOUND_SPHERE = 1,
|
||||
OB_BOUND_CYLINDER = 2,
|
||||
OB_BOUND_CONE = 3,
|
||||
// OB_BOUND_TRIANGLE_MESH = 4, /* UNUSED */
|
||||
// OB_BOUND_CONVEX_HULL = 5, /* UNUSED */
|
||||
// OB_BOUND_DYN_MESH = 6, /* UNUSED */
|
||||
OB_BOUND_CAPSULE = 7,
|
||||
};
|
||||
|
||||
/** #Object.visibility_flag */
|
||||
enum eObject_VisibilityFlag : int {
|
||||
OB_HIDE_VIEWPORT = 1 << 0,
|
||||
OB_HIDE_SELECT = 1 << 1,
|
||||
OB_HIDE_RENDER = 1 << 2,
|
||||
OB_HIDE_CAMERA = 1 << 3,
|
||||
OB_HIDE_DIFFUSE = 1 << 4,
|
||||
OB_HIDE_GLOSSY = 1 << 5,
|
||||
OB_HIDE_TRANSMISSION = 1 << 6,
|
||||
OB_HIDE_VOLUME_SCATTER = 1 << 7,
|
||||
OB_HIDE_SHADOW = 1 << 8,
|
||||
OB_HOLDOUT = 1 << 9,
|
||||
OB_SHADOW_CATCHER = 1 << 10,
|
||||
OB_HIDE_PROBE_VOLUME = 1 << 11,
|
||||
OB_HIDE_PROBE_CUBEMAP = 1 << 12,
|
||||
OB_HIDE_PROBE_PLANAR = 1 << 13,
|
||||
OB_HIDE_SURFACE_PICK = 1 << 14,
|
||||
OB_HIDE_RAYCAST = 1 << 15,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_VisibilityFlag)
|
||||
|
||||
/** #Object.shapeflag */
|
||||
enum eObject_ShapeFlag : char {
|
||||
OB_SHAPE_LOCK = 1 << 0,
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
OB_SHAPE_FLAG_UNUSED_1 = 1 << 1, /* cleared */
|
||||
#endif
|
||||
OB_SHAPE_EDIT_MODE = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_ShapeFlag)
|
||||
|
||||
/** #Object.nlaflag */
|
||||
enum eObject_NlaFlag : short {
|
||||
OB_ADS_UNUSED_1 = 1 << 0, /* cleared */
|
||||
OB_ADS_UNUSED_2 = 1 << 1, /* cleared */
|
||||
/* object-channel expanded status */
|
||||
OB_ADS_COLLAPSED = 1 << 10,
|
||||
/* object's ipo-block */
|
||||
/* OB_ADS_SHOWIPO = 1 << 11, */ /* UNUSED */
|
||||
/* object's constraint channels */
|
||||
/* OB_ADS_SHOWCONS = 1 << 12, */ /* UNUSED */
|
||||
/* object's material channels */
|
||||
/* OB_ADS_SHOWMATS = 1 << 13, */ /* UNUSED */
|
||||
/* object's particle channels */
|
||||
/* OB_ADS_SHOWPARTS = 1 << 14, */ /* UNUSED */
|
||||
};
|
||||
ENUM_OPERATORS(eObject_NlaFlag)
|
||||
|
||||
/** #Object.protectflag */
|
||||
enum eObject_ProtectFlag : short {
|
||||
OB_LOCK_LOCX = 1 << 0,
|
||||
OB_LOCK_LOCY = 1 << 1,
|
||||
OB_LOCK_LOCZ = 1 << 2,
|
||||
OB_LOCK_LOC = OB_LOCK_LOCX | OB_LOCK_LOCY | OB_LOCK_LOCZ,
|
||||
OB_LOCK_ROTX = 1 << 3,
|
||||
OB_LOCK_ROTY = 1 << 4,
|
||||
OB_LOCK_ROTZ = 1 << 5,
|
||||
OB_LOCK_ROT = OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ,
|
||||
OB_LOCK_SCALEX = 1 << 6,
|
||||
OB_LOCK_SCALEY = 1 << 7,
|
||||
OB_LOCK_SCALEZ = 1 << 8,
|
||||
OB_LOCK_SCALE = OB_LOCK_SCALEX | OB_LOCK_SCALEY | OB_LOCK_SCALEZ,
|
||||
OB_LOCK_ROTW = 1 << 9,
|
||||
OB_LOCK_ROT4D = 1 << 10,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_ProtectFlag)
|
||||
|
||||
/** #Object.duplicator_visibility_flag */
|
||||
enum eObject_DuplicatorVisibilityFlag : char {
|
||||
OB_DUPLI_FLAG_VIEWPORT = 1 << 0,
|
||||
OB_DUPLI_FLAG_RENDER = 1 << 1,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_DuplicatorVisibilityFlag)
|
||||
|
||||
/** #Object.empty_image_depth */
|
||||
enum eObject_EmptyImageDepth : char {
|
||||
OB_EMPTY_IMAGE_DEPTH_DEFAULT = 0,
|
||||
OB_EMPTY_IMAGE_DEPTH_FRONT = 1,
|
||||
OB_EMPTY_IMAGE_DEPTH_BACK = 2,
|
||||
};
|
||||
|
||||
/** #Object.empty_image_visibility_flag */
|
||||
enum eObject_EmptyImageVisibilityFlag : char {
|
||||
OB_EMPTY_IMAGE_HIDE_PERSPECTIVE = 1 << 0,
|
||||
OB_EMPTY_IMAGE_HIDE_ORTHOGRAPHIC = 1 << 1,
|
||||
OB_EMPTY_IMAGE_HIDE_BACK = 1 << 2,
|
||||
OB_EMPTY_IMAGE_HIDE_FRONT = 1 << 3,
|
||||
OB_EMPTY_IMAGE_HIDE_NON_AXIS_ALIGNED = 1 << 4,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_EmptyImageVisibilityFlag)
|
||||
|
||||
/** #Object.empty_image_flag */
|
||||
enum eObject_EmptyImageFlag : char {
|
||||
OB_EMPTY_IMAGE_USE_ALPHA_BLEND = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eObject_EmptyImageFlag)
|
||||
|
||||
enum ObjectModifierFlag : uchar {
|
||||
OB_MODIFIER_FLAG_ADD_REST_POSITION = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(ObjectModifierFlag)
|
||||
|
||||
/** Vertex Groups - Name Info */
|
||||
struct bDeformGroup {
|
||||
struct bDeformGroup *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
/* need this flag for locking weights */
|
||||
ebDeformGroup_Flag flag = {};
|
||||
char _pad0[7] = {};
|
||||
};
|
||||
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
struct bFaceMap {
|
||||
struct bFaceMap *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_VGROUP_NAME*/ 64] = "";
|
||||
char flag = 0;
|
||||
char _pad0[7] = {};
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The following illustrates the orientation of the
|
||||
* bounding box in local space
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* Z Y
|
||||
* | /
|
||||
* |/
|
||||
* .-----X
|
||||
* 2----------6
|
||||
* /| /|
|
||||
* / | / |
|
||||
* 1----------5 |
|
||||
* | | | |
|
||||
* | 3-------|--7
|
||||
* | / | /
|
||||
* |/ |/
|
||||
* 0----------4
|
||||
* </pre>
|
||||
*/
|
||||
struct BoundBox {
|
||||
float vec[8][3] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* \warning while the values seem to be flags, they aren't treated as flags.
|
||||
*/
|
||||
enum eObjectLineArt_Usage : short {
|
||||
OBJECT_LRT_INHERIT = 0,
|
||||
OBJECT_LRT_INCLUDE = (1 << 0),
|
||||
OBJECT_LRT_OCCLUSION_ONLY = (1 << 1),
|
||||
OBJECT_LRT_EXCLUDE = (1 << 2),
|
||||
OBJECT_LRT_INTERSECTION_ONLY = (1 << 3),
|
||||
OBJECT_LRT_NO_INTERSECTION = (1 << 4),
|
||||
OBJECT_LRT_FORCE_INTERSECTION = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eObjectLineArt_Usage);
|
||||
|
||||
enum eObjectLineArt_Flags : short {
|
||||
OBJECT_LRT_OWN_CREASE = (1 << 0),
|
||||
OBJECT_LRT_OWN_INTERSECTION_PRIORITY = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eObjectLineArt_Flags)
|
||||
|
||||
struct ObjectLineArt {
|
||||
eObjectLineArt_Usage usage = OBJECT_LRT_INHERIT;
|
||||
eObjectLineArt_Flags flags = {};
|
||||
|
||||
/** if OBJECT_LRT_OWN_CREASE is set */
|
||||
float crease_threshold = DEG2RAD(140.0f);
|
||||
|
||||
unsigned char intersection_priority = 0;
|
||||
|
||||
char _pad[7] = {};
|
||||
};
|
||||
|
||||
/* Evaluated light linking state needed for the render engines integration. */
|
||||
struct LightLinkingRuntime {
|
||||
|
||||
/* For objects that emit light: a bitmask of light sets this emitter is part of for the light
|
||||
* linking.
|
||||
* A light set is a combination of emitters used by one or more receiver objects.
|
||||
*
|
||||
* If there is no light linking in the scene or if the emitter does not specify light linking all
|
||||
* bits are set.
|
||||
*
|
||||
* NOTE: There can only be 64 light sets in a scene. */
|
||||
uint64_t light_set_membership = 0;
|
||||
|
||||
/* For objects that emit light: a bitmask of light sets this emitter is part of for the shadow
|
||||
* linking.
|
||||
* A light set is a combination of emitters from which a blocked object does not cast a shadow.
|
||||
*
|
||||
* If there is no shadow linking in the scene or if the emitter does not specify shadow linking
|
||||
* all bits are set.
|
||||
*
|
||||
* NOTE: There can only be 64 light sets in a scene. */
|
||||
uint64_t shadow_set_membership = 0;
|
||||
|
||||
/* For receiver objects: the index of the light set from which this object receives light.
|
||||
*
|
||||
* If there is no light linking in the scene or the receiver is not linked to any light this is
|
||||
* assigned zero. */
|
||||
uint8_t receiver_light_set = 0;
|
||||
|
||||
/* For blocker objects: the index of the light set from which this object casts shadow from.
|
||||
*
|
||||
* If there is no shadow in the scene or the blocker is not linked to any emitter this is
|
||||
* assigned zero. */
|
||||
uint8_t blocker_shadow_set = 0;
|
||||
|
||||
uint8_t _pad[6] = {};
|
||||
};
|
||||
|
||||
struct LightLinking {
|
||||
/* Collections which contains objects (possibly via nested collection indirection) which defines
|
||||
* the light linking relation: such as whether objects are included or excluded from being lit by
|
||||
* this emitter (receiver_collection), or whether they block light from this emitter
|
||||
* (blocker_collection).
|
||||
*
|
||||
* If the collection is a null pointer then all objects from the current scene are receiving
|
||||
* light from this emitter, and nothing is excluded from receiving the light and shadows.
|
||||
*
|
||||
* The emitter in this context is assumed to be either object of lamp type, or objects with
|
||||
* surface which has emissive shader. */
|
||||
struct Collection *receiver_collection = nullptr;
|
||||
struct Collection *blocker_collection = nullptr;
|
||||
|
||||
LightLinkingRuntime runtime;
|
||||
};
|
||||
|
||||
struct Object {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Object)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_OB;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
ObjectType type = OB_EMPTY;
|
||||
eObject_Partype partype = PAROBJECT;
|
||||
/** Can be vertex indices. */
|
||||
int par1 = 0, par2 = 0, par3 = 0;
|
||||
/** String describing sub-object info. */
|
||||
char parsubstr[/*MAX_NAME*/ 64] = "";
|
||||
struct Object *parent = nullptr, *track = nullptr;
|
||||
float parent_bone_head_tail_factor = 1.0f;
|
||||
char _pad4[4] = {};
|
||||
/* Proxy pointer are deprecated, only kept for conversion to liboverrides. */
|
||||
DNA_DEPRECATED struct Object *proxy = nullptr;
|
||||
DNA_DEPRECATED struct Object *proxy_group = nullptr;
|
||||
DNA_DEPRECATED struct Object *proxy_from = nullptr;
|
||||
// struct Path *path = nullptr;
|
||||
struct bAction *poselib DNA_DEPRECATED =
|
||||
nullptr; /* Pre-Blender 3.0 pose library, deprecated in 3.5. */
|
||||
/** Pose data, armature objects only. */
|
||||
struct bPose *pose = nullptr;
|
||||
/** Pointer to objects data - an 'ID' or NULL. */
|
||||
ID *data = nullptr;
|
||||
|
||||
/** Grease Pencil data. */
|
||||
struct bGPdata *gpd DNA_DEPRECATED =
|
||||
nullptr; /* XXX deprecated... replaced by gpencil object, keep for readfile */
|
||||
|
||||
/** Settings for visualization of object-transform animation. */
|
||||
bAnimVizSettings avs;
|
||||
/** Motion path cache for this object. */
|
||||
bMotionPath *mpath = nullptr;
|
||||
|
||||
ListBaseT<Effect> effect = {nullptr, nullptr}; /* XXX deprecated... keep for readfile */
|
||||
ListBaseT<bDeformGroup> defbase = {nullptr,
|
||||
nullptr}; /* Only for versioning, moved to object data. */
|
||||
ListBaseT<bFaceMap> fmaps = {nullptr,
|
||||
nullptr}; /* For versioning, moved to generic attributes. */
|
||||
/** List of ModifierData structures. */
|
||||
ListBaseT<ModifierData> modifiers = {nullptr, nullptr};
|
||||
/** List of GpencilModifierData structures. */
|
||||
ListBaseT<GpencilModifierData> greasepencil_modifiers = {nullptr, nullptr};
|
||||
/** List of viewport effects. Actually only used by grease pencil. */
|
||||
ListBaseT<ShaderFxData> shader_fx = {nullptr, nullptr};
|
||||
|
||||
/** Local object mode. */
|
||||
eObjectMode mode = OB_MODE_OBJECT;
|
||||
eObjectMode restore_mode = OB_MODE_OBJECT;
|
||||
|
||||
/* materials */
|
||||
/** Material slots. */
|
||||
struct Material **mat = nullptr;
|
||||
/** A boolean field, with each byte 1 if corresponding material is linked to object. */
|
||||
char *matbits = nullptr;
|
||||
/** Copy of mesh, curve & meta struct member of same name (keep in sync). */
|
||||
int totcol = 0;
|
||||
/** Currently selected material in the UI (one-based). */
|
||||
int actcol = 0;
|
||||
|
||||
/* rot en drot have to be together! (transform('r' en 's')) */
|
||||
float loc[3] = {}, dloc[3] = {};
|
||||
/** Scale (can be negative). */
|
||||
float scale[3] = {1, 1, 1};
|
||||
/** DEPRECATED, 2.60 and older only. */
|
||||
DNA_DEPRECATED float dsize[3] = {};
|
||||
/** Ack!, changing. */
|
||||
float dscale[3] = {1, 1, 1};
|
||||
/** Euler rotation. */
|
||||
float rot[3] = {}, drot[3] = {};
|
||||
/** Quaternion rotation. */
|
||||
float quat[4] = _DNA_DEFAULT_UNIT_QT;
|
||||
float dquat[4] = _DNA_DEFAULT_UNIT_QT;
|
||||
/** Axis angle rotation - axis part. */
|
||||
float rotAxis[3] = {0, 1, 0}, drotAxis[3] = {0, 1, 0};
|
||||
/** Axis angle rotation - angle part. */
|
||||
float rotAngle = 0, drotAngle = 0;
|
||||
/** Inverse result of parent, so that object doesn't 'stick' to parent. */
|
||||
float parentinv[4][4] = _DNA_DEFAULT_UNIT_M4;
|
||||
/** Inverse result of constraints.
|
||||
* doesn't include effect of parent or object local transform. */
|
||||
float constinv[4][4] = _DNA_DEFAULT_UNIT_M4;
|
||||
|
||||
/** Copy of Base's layer in the scene. */
|
||||
DNA_DEPRECATED unsigned int lay = 0;
|
||||
|
||||
/** Copy of Base. */
|
||||
eObject_Flag flag = OB_FLAG_USE_SIMULATION_CACHE;
|
||||
/** Deprecated, use 'matbits'. */
|
||||
DNA_DEPRECATED short colbits = 0;
|
||||
|
||||
/** Transformation settings and transform locks. */
|
||||
eObject_TransFlag transflag = {};
|
||||
eObject_ProtectFlag protectflag = OB_LOCK_ROT4D;
|
||||
eObject_Axis trackflag = OB_POSX, upflag = OB_POSY;
|
||||
/** Used for DopeSheet filtering settings (expanded/collapsed). */
|
||||
eObject_NlaFlag nlaflag = {};
|
||||
|
||||
char _pad1 = {};
|
||||
eObject_DuplicatorVisibilityFlag duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT |
|
||||
OB_DUPLI_FLAG_RENDER;
|
||||
|
||||
/* Depsgraph */
|
||||
/** Used by depsgraph, flushed from base. */
|
||||
short base_flag = 0;
|
||||
/** Used by viewport, synced from base. */
|
||||
unsigned short base_local_view_bits = 0;
|
||||
|
||||
/** Collision mask settings */
|
||||
unsigned short col_group = 0x01, col_mask = 0xffff;
|
||||
|
||||
/** Rotation mode - uses defines set out in DNA_action_types.h for PoseChannel rotations.... */
|
||||
short rotmode = ROT_MODE_EUL;
|
||||
|
||||
/** Bounding box use for drawing. */
|
||||
eObject_BoundType boundtype = OB_BOUND_BOX;
|
||||
/** Bounding box type used for collision. */
|
||||
eObject_BoundType collision_boundtype = OB_BOUND_BOX;
|
||||
|
||||
/** Viewport draw extra settings. */
|
||||
eObject_DrawExtraFlag dtx = {};
|
||||
/** Viewport draw type. */
|
||||
eDrawType dt = OB_TEXTURE;
|
||||
eObject_EmptyDrawType empty_drawtype = OB_PLAINAXES;
|
||||
float empty_drawsize = 1.0;
|
||||
/** Dupliface scale. */
|
||||
float instance_faces_scale = 1;
|
||||
|
||||
/** Custom index, for render-passes. */
|
||||
short index = 0;
|
||||
/** Current deformation group, NOTE: index starts at 1. */
|
||||
DNA_DEPRECATED unsigned short actdef = 0;
|
||||
/** Object color (in most cases the material color is used for drawing). */
|
||||
float color[4] = {1, 1, 1, 1};
|
||||
|
||||
/** For restricting view, select, render etc. accessible in outliner. */
|
||||
eObject_VisibilityFlag visibility_flag = {};
|
||||
|
||||
/** Softbody settings. */
|
||||
short softflag = 0;
|
||||
|
||||
/** Current shape key for menu or pinned. */
|
||||
short shapenr = 0;
|
||||
/** Flag for pinning. */
|
||||
eObject_ShapeFlag shapeflag = {};
|
||||
|
||||
char _pad3[3] = {};
|
||||
|
||||
/** Object constraints. */
|
||||
ListBaseT<bConstraint> constraints = {nullptr, nullptr};
|
||||
ListBaseT<struct ObHook> hooks = {nullptr, nullptr};
|
||||
/** Particle systems. */
|
||||
ListBaseT<struct ParticleSystem> particlesystem = {nullptr, nullptr};
|
||||
|
||||
/** Particle deflector/attractor/collision data. */
|
||||
struct PartDeflect *pd = nullptr;
|
||||
/** If exists, saved in file. */
|
||||
struct SoftBody *soft = nullptr;
|
||||
/** Object duplicator for group. */
|
||||
struct Collection *instance_collection = nullptr;
|
||||
|
||||
/** If fluidsim enabled, store additional settings. */
|
||||
struct FluidsimSettings *fluidsimSettings DNA_DEPRECATED =
|
||||
nullptr; /* XXX deprecated... replaced by mantaflow, keep for readfile */
|
||||
|
||||
ListBaseT<LinkData> pc_ids = {nullptr, nullptr};
|
||||
|
||||
/** Settings for Bullet rigid body. */
|
||||
struct RigidBodyOb *rigidbody_object = nullptr;
|
||||
/** Settings for Bullet constraint. */
|
||||
struct RigidBodyCon *rigidbody_constraint = nullptr;
|
||||
|
||||
/** Offset for image empties. */
|
||||
float ima_ofs[2] = {-0.5, -0.5};
|
||||
/** Must be non-null when object is an empty image. */
|
||||
ImageUser *iuser = nullptr;
|
||||
eObject_EmptyImageVisibilityFlag empty_image_visibility_flag = {};
|
||||
eObject_EmptyImageDepth empty_image_depth = OB_EMPTY_IMAGE_DEPTH_DEFAULT;
|
||||
eObject_EmptyImageFlag empty_image_flag = {};
|
||||
|
||||
ObjectModifierFlag modifier_flag = {};
|
||||
|
||||
float shadow_terminator_normal_offset = 0;
|
||||
float shadow_terminator_geometry_offset = 0.1f;
|
||||
float shadow_terminator_shading_offset = 0;
|
||||
|
||||
struct PreviewImage *preview = nullptr;
|
||||
|
||||
ObjectLineArt lineart;
|
||||
|
||||
/** Light-group membership information. */
|
||||
struct LightgroupMembership *lightgroup = nullptr;
|
||||
|
||||
/** Light linking information. */
|
||||
LightLinking *light_linking = nullptr;
|
||||
|
||||
/** Irradiance caches baked for this object (light-probes only). */
|
||||
struct LightProbeObjectCache *lightprobe_cache = nullptr;
|
||||
|
||||
bke::ObjectRuntime *runtime = nullptr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
const float4x4 &object_to_world() const;
|
||||
const float4x4 &world_to_object() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/** DEPRECATED: this is not used anymore because hooks are now modifiers. */
|
||||
struct ObHook {
|
||||
struct ObHook *next = nullptr, *prev = nullptr;
|
||||
|
||||
struct Object *parent = nullptr;
|
||||
/** Matrix making current transform unmodified. */
|
||||
float parentinv[4][4] = {};
|
||||
/** Temp matrix while hooking. */
|
||||
float mat[4][4] = {};
|
||||
/** Visualization of hook. */
|
||||
float cent[3] = {};
|
||||
/** If not zero, falloff is distance where influence zero. */
|
||||
float falloff = 0;
|
||||
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
int *indexar = nullptr;
|
||||
/** Curindex is cache for fast lookup. */
|
||||
int totindex = 0, curindex = 0;
|
||||
/** Active is only first hook, for button menu. */
|
||||
short type = 0, active = 0;
|
||||
float force = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* This is used as a flag for many kinds of data that use selections, examples include:
|
||||
* - #BezTriple.f1, #BezTriple.f2, #BezTriple.f3
|
||||
* - #bNode.flag
|
||||
* - #MovieTrackingTrack.flag
|
||||
* And more, ideally this would have a generic location.
|
||||
*/
|
||||
#define SELECT 1
|
||||
|
||||
/* check if the object type supports materials */
|
||||
#define OB_TYPE_SUPPORT_MATERIAL(_type) \
|
||||
(((_type) >= OB_MESH && (_type) <= OB_MBALL) || \
|
||||
((_type) >= OB_CURVES && (_type) <= OB_GREASE_PENCIL))
|
||||
|
||||
/**
|
||||
* Does the object have some render-able geometry (unlike empties, cameras, etc.). True for
|
||||
* #OB_CURVES_LEGACY, since these often evaluate to objects with geometry.
|
||||
*/
|
||||
#define OB_TYPE_IS_GEOMETRY(_type) \
|
||||
(ELEM(_type, \
|
||||
OB_MESH, \
|
||||
OB_SURF, \
|
||||
OB_FONT, \
|
||||
OB_MBALL, \
|
||||
OB_CURVES_LEGACY, \
|
||||
OB_CURVES, \
|
||||
OB_POINTCLOUD, \
|
||||
OB_VOLUME, \
|
||||
OB_GREASE_PENCIL))
|
||||
|
||||
#define OB_TYPE_SUPPORT_VGROUP(_type) (ELEM(_type, OB_MESH, OB_LATTICE, OB_GREASE_PENCIL))
|
||||
|
||||
#define OB_TYPE_SUPPORT_EDITMODE(_type) \
|
||||
(ELEM(_type, \
|
||||
OB_MESH, \
|
||||
OB_FONT, \
|
||||
OB_CURVES_LEGACY, \
|
||||
OB_SURF, \
|
||||
OB_MBALL, \
|
||||
OB_LATTICE, \
|
||||
OB_ARMATURE, \
|
||||
OB_CURVES, \
|
||||
OB_POINTCLOUD, \
|
||||
OB_GREASE_PENCIL))
|
||||
|
||||
#define OB_TYPE_SUPPORT_PARVERT(_type) \
|
||||
(ELEM(_type, OB_MESH, OB_SURF, OB_CURVES_LEGACY, OB_LATTICE))
|
||||
|
||||
/** Matches #OB_TYPE_SUPPORT_EDITMODE. */
|
||||
#define OB_DATA_SUPPORT_EDITMODE(_type) \
|
||||
(ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR, ID_CV, ID_GP))
|
||||
|
||||
/* is this ID type used as object data */
|
||||
#define OB_DATA_SUPPORT_ID(_id_type) \
|
||||
(ELEM(_id_type, \
|
||||
ID_ME, \
|
||||
ID_CU_LEGACY, \
|
||||
ID_MB, \
|
||||
ID_LA, \
|
||||
ID_SPK, \
|
||||
ID_LP, \
|
||||
ID_CA, \
|
||||
ID_LT, \
|
||||
ID_GD_LEGACY, \
|
||||
ID_AR, \
|
||||
ID_CV, \
|
||||
ID_PT, \
|
||||
ID_VO, \
|
||||
ID_GP))
|
||||
|
||||
#define OB_DATA_SUPPORT_ID_CASE \
|
||||
ID_ME: \
|
||||
case ID_CU_LEGACY: \
|
||||
case ID_MB: \
|
||||
case ID_LA: \
|
||||
case ID_SPK: \
|
||||
case ID_LP: \
|
||||
case ID_CA: \
|
||||
case ID_LT: \
|
||||
case ID_GD_LEGACY: \
|
||||
case ID_AR: \
|
||||
case ID_CV: \
|
||||
case ID_PT: \
|
||||
case ID_VO: \
|
||||
case ID_GP
|
||||
|
||||
} // namespace blender
|
||||
146
blender-5.2.0/source/blender/makesdna/DNA_outliner_types.h
Normal file
146
blender-5.2.0/source/blender/makesdna/DNA_outliner_types.h
Normal file
@@ -0,0 +1,146 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "DNA_defs.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct ID;
|
||||
|
||||
/** #TreeStoreElem.flag */
|
||||
enum eTreeStoreElem_Flag : short {
|
||||
TSE_CLOSED = (1 << 0),
|
||||
TSE_SELECTED = (1 << 1),
|
||||
TSE_TEXTBUT = (1 << 2),
|
||||
TSE_CHILDSEARCH = (1 << 3),
|
||||
TSE_SEARCHMATCH = (1 << 4),
|
||||
TSE_HIGHLIGHTED = (1 << 5),
|
||||
TSE_DRAG_INTO = (1 << 6),
|
||||
TSE_DRAG_BEFORE = (1 << 7),
|
||||
TSE_DRAG_AFTER = (1 << 8),
|
||||
/* Needed because outliner-only elements can be active */
|
||||
TSE_ACTIVE = (1 << 9),
|
||||
/* TSE_ACTIVE_WALK = (1 << 10), */ /* Unused */
|
||||
TSE_HIGHLIGHTED_ICON = (1 << 11),
|
||||
TSE_DRAG_ANY = (TSE_DRAG_INTO | TSE_DRAG_BEFORE | TSE_DRAG_AFTER),
|
||||
TSE_HIGHLIGHTED_ANY = (TSE_HIGHLIGHTED | TSE_HIGHLIGHTED_ICON),
|
||||
};
|
||||
ENUM_OPERATORS(eTreeStoreElem_Flag)
|
||||
|
||||
/** #TreeStoreElem.types */
|
||||
enum eTreeStoreElemType : short {
|
||||
/**
|
||||
* If an element is of this type, `TreeStoreElem.id` points to a valid ID and the ID-type can be
|
||||
* received through `TreeElement.idcode` (or `GS(TreeStoreElem.id->name)`). Note however that the
|
||||
* types below may also have a valid ID pointer (see #TSE_IS_REAL_ID()).
|
||||
*
|
||||
* In cases where the type is still checked against "0" (even implicitly), please replace it with
|
||||
* an explicit check against `TSE_SOME_ID`.
|
||||
*/
|
||||
TSE_SOME_ID = 0,
|
||||
|
||||
TSE_NLA = 1, /* NO ID */
|
||||
TSE_NLA_ACTION = 2,
|
||||
TSE_DEFGROUP_BASE = 3,
|
||||
TSE_DEFGROUP = 4,
|
||||
TSE_BONE = 5,
|
||||
TSE_EBONE = 6,
|
||||
TSE_CONSTRAINT_BASE = 7,
|
||||
TSE_CONSTRAINT = 8,
|
||||
TSE_MODIFIER_BASE = 9,
|
||||
TSE_MODIFIER = 10,
|
||||
TSE_LINKED_OB = 11,
|
||||
/* TSE_SCRIPT_BASE = 12, */ /* UNUSED */
|
||||
TSE_POSE_BASE = 13,
|
||||
TSE_POSE_CHANNEL = 14,
|
||||
TSE_ANIM_DATA = 15,
|
||||
TSE_DRIVER_BASE = 16, /* NO ID */
|
||||
/* TSE_DRIVER = 17, */ /* UNUSED */
|
||||
|
||||
/* TSE_PROXY = 18, */ /* UNUSED */
|
||||
TSE_R_LAYER_BASE = 19,
|
||||
TSE_R_LAYER = 20,
|
||||
/* TSE_R_PASS = 21, */ /* UNUSED */
|
||||
/* TSE_LINKED_MAT = 22, */
|
||||
/* NOTE: is used for light group. */
|
||||
/* TSE_LINKED_LAMP = 23, */
|
||||
TSE_BONE_COLLECTION_BASE = 24,
|
||||
TSE_BONE_COLLECTION = 25,
|
||||
TSE_STRIP = 26, /* NO ID */
|
||||
TSE_STRIP_DATA = 27, /* NO ID */
|
||||
TSE_STRIP_DUP = 28, /* NO ID */
|
||||
TSE_LINKED_PSYS = 29,
|
||||
TSE_RNA_STRUCT = 30, /* NO ID */
|
||||
TSE_RNA_PROPERTY = 31, /* NO ID */
|
||||
TSE_RNA_ARRAY_ELEM = 32, /* NO ID */
|
||||
TSE_NLA_TRACK = 33, /* NO ID */
|
||||
/* TSE_KEYMAP = 34, */ /* UNUSED */
|
||||
/* TSE_KEYMAP_ITEM = 35, */ /* UNUSED */
|
||||
TSE_ID_BASE = 36, /* NO ID */
|
||||
TSE_GP_LAYER = 37, /* NO ID */
|
||||
TSE_LAYER_COLLECTION = 38,
|
||||
TSE_SCENE_COLLECTION_BASE = 39,
|
||||
TSE_VIEW_COLLECTION_BASE = 40,
|
||||
TSE_SCENE_OBJECTS_BASE = 41,
|
||||
TSE_GPENCIL_EFFECT_BASE = 42,
|
||||
TSE_GPENCIL_EFFECT = 43,
|
||||
TSE_LIBRARY_OVERRIDE_BASE = 44,
|
||||
TSE_LIBRARY_OVERRIDE = 45,
|
||||
TSE_LIBRARY_OVERRIDE_OPERATION = 46,
|
||||
TSE_GENERIC_LABEL = 47, /* No ID */
|
||||
TSE_GREASE_PENCIL_NODE = 48,
|
||||
TSE_LINKED_NODE_TREE = 49,
|
||||
TSE_ACTION_SLOT = 50,
|
||||
TSE_SHAPE_KEY_BLOCK = 51,
|
||||
TSE_SHAPE_KEY_BASE = 52,
|
||||
};
|
||||
|
||||
/** Check whether given #TreeStoreElem should have a real ID in #TreeStoreElem.id member. */
|
||||
#define TSE_IS_REAL_ID(_tse) \
|
||||
(!ELEM((_tse)->type, \
|
||||
TSE_NLA, \
|
||||
TSE_NLA_TRACK, \
|
||||
TSE_DRIVER_BASE, \
|
||||
TSE_STRIP, \
|
||||
TSE_STRIP_DATA, \
|
||||
TSE_STRIP_DUP, \
|
||||
TSE_RNA_STRUCT, \
|
||||
TSE_RNA_PROPERTY, \
|
||||
TSE_RNA_ARRAY_ELEM, \
|
||||
TSE_ID_BASE, \
|
||||
TSE_GP_LAYER, \
|
||||
TSE_GENERIC_LABEL))
|
||||
|
||||
struct TreeStoreElem {
|
||||
eTreeStoreElemType type = TSE_SOME_ID;
|
||||
short nr = 0;
|
||||
eTreeStoreElem_Flag flag = {};
|
||||
short used = 0;
|
||||
|
||||
/* XXX We actually also store non-ID data in this pointer for identifying
|
||||
* the #TreeStoreElem for a #TreeElement when rebuilding the tree. Ugly! */
|
||||
struct ID *id = nullptr;
|
||||
};
|
||||
|
||||
/** Used only to store data in blend files. */
|
||||
struct TreeStore {
|
||||
/** Was previously used for memory pre-allocation. */
|
||||
DNA_DEPRECATED int totelem = 0;
|
||||
/** Number of elements in data array. */
|
||||
int usedelem = 0;
|
||||
/**
|
||||
* Elements to be packed from mempool in `writefile.cc`
|
||||
* or extracted to mempool in `readfile.cc`.
|
||||
*/
|
||||
TreeStoreElem *data = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
27
blender-5.2.0/source/blender/makesdna/DNA_packedFile_types.h
Normal file
27
blender-5.2.0/source/blender/makesdna/DNA_packedFile_types.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_implicit_sharing.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct PackedFile {
|
||||
int size = 0;
|
||||
int seek = 0;
|
||||
/**
|
||||
* Raw data from the shared file. This data is const because it uses implicit sharing and may be
|
||||
* shared with e.g. the undo system.
|
||||
*/
|
||||
const void *data = nullptr;
|
||||
/** Sharing info corresponding to the data above. This is run-time data. */
|
||||
const ImplicitSharingInfoHandle *sharing_info = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
793
blender-5.2.0/source/blender/makesdna/DNA_particle_types.h
Normal file
793
blender-5.2.0/source/blender/makesdna/DNA_particle_types.h
Normal file
@@ -0,0 +1,793 @@
|
||||
/* SPDX-FileCopyrightText: 2007 by Janne Karhu. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_boid_types.h"
|
||||
#include "DNA_defs.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
template<typename CoordT> struct KDTree;
|
||||
template<typename T, int Size> struct VecBase;
|
||||
using KDTree3d = KDTree<VecBase<float, 3>>;
|
||||
|
||||
struct AnimData;
|
||||
|
||||
namespace draw {
|
||||
struct ParticleBatchCache;
|
||||
};
|
||||
|
||||
/** #SPHFluidSettings::flag */
|
||||
enum eSPH_Flag : int {
|
||||
SPH_VISCOELASTIC_SPRINGS = 1 << 0,
|
||||
SPH_CURRENT_REST_LENGTH = 1 << 1,
|
||||
SPH_FAC_REPULSION = 1 << 2,
|
||||
SPH_FAC_DENSITY = 1 << 3,
|
||||
SPH_FAC_RADIUS = 1 << 4,
|
||||
SPH_FAC_VISCOSITY = 1 << 5,
|
||||
SPH_FAC_REST_LENGTH = 1 << 6,
|
||||
};
|
||||
ENUM_OPERATORS(eSPH_Flag)
|
||||
|
||||
/** #SPHFluidSettings::solver (numerical ID field, not bit-field). */
|
||||
enum eSPH_Solver : short {
|
||||
SPH_SOLVER_DDR = 0,
|
||||
SPH_SOLVER_CLASSICAL = 1,
|
||||
};
|
||||
|
||||
enum eParticleDrawFlag : int {
|
||||
PART_DRAW_VEL = (1 << 0),
|
||||
PART_DRAW_GLOBAL_OB = (1 << 1),
|
||||
PART_DRAW_SIZE = (1 << 2),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/** Render emitter as well. */
|
||||
PART_DRAW_EMITTER = (1 << 3), /* DEPRECATED */
|
||||
#endif
|
||||
PART_DRAW_HEALTH = (1 << 4),
|
||||
PART_ABS_PATH_TIME = (1 << 5),
|
||||
PART_DRAW_COUNT_GR = (1 << 6),
|
||||
/* PART_DRAW_BB_LOCK = (1 << 7), */ /* DEPRECATED */
|
||||
/* used with billboards */ /* DEPRECATED */
|
||||
PART_DRAW_ROTATE_OB = (1 << 7), /* used with instance object/collection */
|
||||
PART_DRAW_PARENT = (1 << 8),
|
||||
PART_DRAW_NUM = (1 << 9),
|
||||
PART_DRAW_RAND_GR = (1 << 10),
|
||||
PART_DRAW_REN_ADAPT = (1 << 11),
|
||||
PART_DRAW_VEL_LENGTH = (1 << 12),
|
||||
PART_DRAW_MAT_COL = (1 << 13), /* deprecated, but used in do_versions */
|
||||
PART_DRAW_WHOLE_GR = (1 << 14),
|
||||
PART_DRAW_REN_STRAND = (1 << 15),
|
||||
PART_DRAW_NO_SCALE_OB = (1 << 16), /* used with instance object/collection */
|
||||
PART_DRAW_GUIDE_HAIRS = (1 << 17),
|
||||
PART_DRAW_HAIR_GRID = (1 << 18),
|
||||
};
|
||||
ENUM_OPERATORS(eParticleDrawFlag)
|
||||
|
||||
/**
|
||||
* #ParticleSettings.type
|
||||
* Hair is always baked static in object/geometry space.
|
||||
* Other types (normal particles) are in global space and not static baked.
|
||||
*/
|
||||
enum eParticleType : short {
|
||||
PART_EMITTER = 0,
|
||||
/* REACTOR type currently unused */
|
||||
/* PART_REACTOR = 1, */
|
||||
PART_HAIR = 2,
|
||||
PART_FLUID = 3, /* Deprecated (belonged to ELBEEM). */
|
||||
PART_FLUID_FLIP = 4,
|
||||
PART_FLUID_SPRAY = 5,
|
||||
PART_FLUID_BUBBLE = 6,
|
||||
PART_FLUID_FOAM = 7,
|
||||
PART_FLUID_TRACER = 8,
|
||||
PART_FLUID_SPRAYFOAM = 9,
|
||||
PART_FLUID_SPRAYBUBBLE = 10,
|
||||
PART_FLUID_FOAMBUBBLE = 11,
|
||||
PART_FLUID_SPRAYFOAMBUBBLE = 12,
|
||||
};
|
||||
|
||||
/** Mirroring Mantaflow particle types from particle.h (Mantaflow header). */
|
||||
enum eMantaflowParticleType : int {
|
||||
/* PARTICLE_TYPE_NONE = (0 << 0), */ /* UNUSED */
|
||||
/* PARTICLE_TYPE_NEW = (1 << 0), */ /* UNUSED */
|
||||
PARTICLE_TYPE_SPRAY = (1 << 1),
|
||||
PARTICLE_TYPE_BUBBLE = (1 << 2),
|
||||
PARTICLE_TYPE_FOAM = (1 << 3),
|
||||
PARTICLE_TYPE_TRACER = (1 << 4),
|
||||
PARTICLE_TYPE_DELETE = (1 << 10),
|
||||
/* PARTICLE_TYPE_INVALID = (1 << 30), */ /* UNUSED */
|
||||
};
|
||||
ENUM_OPERATORS(eMantaflowParticleType)
|
||||
|
||||
/** #ParticleSettings.flag */
|
||||
enum eParticleFlag : int {
|
||||
PART_REACT_STA_END = 1 << 0,
|
||||
PART_REACT_MULTIPLE = 1 << 1,
|
||||
|
||||
// PART_LOOP = 1 << 2, /* not used anymore */
|
||||
|
||||
/* For dope-sheet. */
|
||||
PART_DS_EXPAND = 1 << 3,
|
||||
|
||||
/** Regrow hair for each frame. */
|
||||
PART_HAIR_REGROW = 1 << 4,
|
||||
|
||||
/** Show unborn particles. */
|
||||
PART_UNBORN = 1 << 5,
|
||||
/** Show died particles. */
|
||||
PART_DIED = 1 << 6,
|
||||
|
||||
PART_TRAND = 1 << 7,
|
||||
/** Particle/face from face areas. */
|
||||
PART_EDISTR = 1 << 8,
|
||||
|
||||
/** Calculate particle rotations (and store them in point-cache). */
|
||||
PART_ROTATIONS = 1 << 9,
|
||||
PART_HAIR_BSPLINE = 1 << 10,
|
||||
PART_DIE_ON_COL = 1 << 12,
|
||||
/** Swept sphere deflections. */
|
||||
PART_SIZE_DEFL = 1 << 13,
|
||||
/** Dynamic rotation. */
|
||||
PART_ROT_DYN = 1 << 14,
|
||||
|
||||
PART_HIDE_ADVANCED_HAIR = 1 << 15,
|
||||
|
||||
PART_SIZEMASS = 1 << 16,
|
||||
|
||||
// PART_ABS_TIME = 1 << 17,
|
||||
// PART_GLOB_TIME = 1 << 18,
|
||||
|
||||
PART_BOIDS_2D = 1 << 19,
|
||||
|
||||
// PART_BRANCHING = 1 << 20,
|
||||
// PART_ANIM_BRANCHING = 1 << 21,
|
||||
PART_SELF_EFFECT = 1 << 22,
|
||||
|
||||
PART_GRID_HEXAGONAL = 1 << 24,
|
||||
PART_GRID_INVERT = 1 << 26,
|
||||
|
||||
PART_CHILD_EFFECT = 1 << 27,
|
||||
PART_CHILD_LONG_HAIR = 1 << 28,
|
||||
// PART_CHILD_RENDER = 1 << 29, /* UNUSED */
|
||||
PART_CHILD_GUIDE = int(1u << 30),
|
||||
|
||||
};
|
||||
ENUM_OPERATORS(eParticleFlag)
|
||||
|
||||
/** #ParticleSettings::from */
|
||||
enum eParticleFrom : short {
|
||||
PART_FROM_VERT = 0,
|
||||
PART_FROM_FACE = 1,
|
||||
PART_FROM_VOLUME = 2,
|
||||
// PART_FROM_PARTICLE = 3, /* Deprecated. */
|
||||
PART_FROM_CHILD = 4,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::distr */
|
||||
enum eParticleDistribution : short {
|
||||
PART_DISTR_JIT = 0,
|
||||
PART_DISTR_RAND = 1,
|
||||
PART_DISTR_GRID = 2,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::phystype */
|
||||
enum eParticlePhysicsType : short {
|
||||
PART_PHYS_NO = 0,
|
||||
PART_PHYS_NEWTON = 1,
|
||||
PART_PHYS_KEYED = 2,
|
||||
PART_PHYS_BOIDS = 3,
|
||||
PART_PHYS_FLUID = 4,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::kink */
|
||||
enum eParticleKink : short {
|
||||
PART_KINK_NO = 0,
|
||||
PART_KINK_CURL = 1,
|
||||
PART_KINK_RADIAL = 2,
|
||||
PART_KINK_WAVE = 3,
|
||||
PART_KINK_BRAID = 4,
|
||||
PART_KINK_SPIRAL = 5,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::child_flag */
|
||||
enum eParticleChildFlag : int {
|
||||
PART_CHILD_USE_CLUMP_NOISE = (1 << 0),
|
||||
PART_CHILD_USE_CLUMP_CURVE = (1 << 1),
|
||||
PART_CHILD_USE_ROUGH_CURVE = (1 << 2),
|
||||
PART_CHILD_USE_TWIST_CURVE = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eParticleChildFlag)
|
||||
|
||||
/** #ParticleSettings::shape_flag */
|
||||
enum eParticleShapeFlag : short {
|
||||
PART_SHAPE_CLOSE_TIP = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eParticleShapeFlag)
|
||||
|
||||
/** #ParticleSettings::draw_col */
|
||||
enum eParticleDrawCol : short {
|
||||
PART_DRAW_COL_NONE = 0,
|
||||
PART_DRAW_COL_MAT = 1,
|
||||
PART_DRAW_COL_VEL = 2,
|
||||
PART_DRAW_COL_ACC = 3,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::time_flag */
|
||||
enum eParticleTimeFlag : short {
|
||||
/** Automatic sub-frames. */
|
||||
PART_TIME_AUTOSF = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eParticleTimeFlag)
|
||||
|
||||
/** #ParticleSettings::draw_as, #ParticleSettings::ren_as */
|
||||
enum eParticleDrawAs : short {
|
||||
PART_DRAW_NOT = 0,
|
||||
PART_DRAW_DOT = 1,
|
||||
PART_DRAW_HALO = 1,
|
||||
PART_DRAW_CIRC = 2,
|
||||
PART_DRAW_CROSS = 3,
|
||||
PART_DRAW_AXIS = 4,
|
||||
PART_DRAW_LINE = 5,
|
||||
PART_DRAW_PATH = 6,
|
||||
PART_DRAW_OB = 7,
|
||||
PART_DRAW_GR = 8,
|
||||
PART_DRAW_BB = 9, /* Deprecated. */
|
||||
PART_DRAW_REND = 10,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::integrator */
|
||||
enum eParticleIntegrator : short {
|
||||
PART_INT_EULER = 0,
|
||||
PART_INT_MIDPOINT = 1,
|
||||
PART_INT_RK4 = 2,
|
||||
PART_INT_VERLET = 3,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::rotmode */
|
||||
enum eParticleRotationMode : short {
|
||||
PART_ROT_NOR = 1,
|
||||
PART_ROT_VEL = 2,
|
||||
PART_ROT_GLOB_X = 3,
|
||||
PART_ROT_GLOB_Y = 4,
|
||||
PART_ROT_GLOB_Z = 5,
|
||||
PART_ROT_OB_X = 6,
|
||||
PART_ROT_OB_Y = 7,
|
||||
PART_ROT_OB_Z = 8,
|
||||
PART_ROT_NOR_TAN = 9,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::avemode */
|
||||
enum eParticleAngularVelocityMode : short {
|
||||
PART_AVE_VELOCITY = 1,
|
||||
PART_AVE_RAND = 2,
|
||||
PART_AVE_HORIZONTAL = 3,
|
||||
PART_AVE_VERTICAL = 4,
|
||||
PART_AVE_GLOBAL_X = 5,
|
||||
PART_AVE_GLOBAL_Y = 6,
|
||||
PART_AVE_GLOBAL_Z = 7,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::reactevent */
|
||||
enum eParticleReactEvent : short {
|
||||
PART_EVENT_DEATH = 0,
|
||||
PART_EVENT_COLLIDE = 1,
|
||||
PART_EVENT_NEAR = 2,
|
||||
};
|
||||
|
||||
/** #ParticleSettings::childtype */
|
||||
enum eParticleChildType : short {
|
||||
PART_CHILD_PARTICLES = 1,
|
||||
PART_CHILD_FACES = 2,
|
||||
};
|
||||
|
||||
/** #PartialSystem::flag */
|
||||
enum eParticleSystem_Flag : int {
|
||||
PSYS_CURRENT = 1 << 0,
|
||||
PSYS_GLOBAL_HAIR = 1 << 1,
|
||||
PSYS_HAIR_DYNAMICS = 1 << 2,
|
||||
PSYS_KEYED_TIMING = 1 << 3,
|
||||
// PSYS_ENABLED = 1 << 4, /* Deprecated. */
|
||||
/** Signal for updating hair particle mode. */
|
||||
PSYS_HAIR_UPDATED = 1 << 5,
|
||||
// PSYS_DRAWING = 1 << 6, /* Deprecated. */
|
||||
// PSYS_USE_IMAT = 1 << 7, /* Deprecated. */
|
||||
/** Remove particle-system as soon as possible. */
|
||||
PSYS_DELETE = 1 << 8,
|
||||
PSYS_HAIR_DONE = 1 << 9,
|
||||
PSYS_KEYED = 1 << 10,
|
||||
PSYS_EDITED = 1 << 11,
|
||||
// PSYS_PROTECT_CACHE = 1 << 12, /* Deprecated. */
|
||||
PSYS_DISABLED = 1 << 13,
|
||||
/** Runtime flag. */
|
||||
PSYS_OB_ANIM_RESTORE = 1 << 14,
|
||||
PSYS_SHARED_CACHES = 1 << 15,
|
||||
};
|
||||
ENUM_OPERATORS(eParticleSystem_Flag)
|
||||
|
||||
/** #ParticleData::flag */
|
||||
enum eParticle_Flag : short {
|
||||
PARS_UNEXIST = 1 << 0,
|
||||
PARS_NO_DISP = 1 << 1,
|
||||
// PARS_STICKY = 1 << 2, /* deprecated */
|
||||
PARS_REKEY = 1 << 3,
|
||||
};
|
||||
ENUM_OPERATORS(eParticle_Flag)
|
||||
|
||||
/** #ParticleData::alive */
|
||||
enum eParticle_AliveState : short {
|
||||
PARS_KILLED = 0, /* Deprecated. */
|
||||
PARS_DEAD = 1,
|
||||
PARS_UNBORN = 2,
|
||||
PARS_ALIVE = 3,
|
||||
PARS_DYING = 4,
|
||||
};
|
||||
|
||||
/** #ParticleDupliWeight::flag */
|
||||
enum eParticleDupliWeight_Flag : short {
|
||||
PART_DUPLIW_CURRENT = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eParticleDupliWeight_Flag)
|
||||
|
||||
/** #PartialSystem::vgroup (indices into this array). */
|
||||
enum eParticleSystem_Vgroup : short {
|
||||
PSYS_VG_DENSITY = 0,
|
||||
PSYS_VG_VEL = 1,
|
||||
PSYS_VG_LENGTH = 2,
|
||||
PSYS_VG_CLUMP = 3,
|
||||
PSYS_VG_KINK = 4,
|
||||
PSYS_VG_ROUGH1 = 5,
|
||||
PSYS_VG_ROUGH2 = 6,
|
||||
PSYS_VG_ROUGHE = 7,
|
||||
PSYS_VG_SIZE = 8,
|
||||
PSYS_VG_TAN = 9,
|
||||
PSYS_VG_ROT = 10,
|
||||
PSYS_VG_EFFECTOR = 11,
|
||||
PSYS_VG_TWIST = 12,
|
||||
|
||||
PSYS_TOT_VG = 13,
|
||||
};
|
||||
|
||||
/** #ParticleTarget::flag */
|
||||
enum eParticleTarget_Flag : short {
|
||||
PTARGET_CURRENT = 1,
|
||||
PTARGET_VALID = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eParticleTarget_Flag)
|
||||
|
||||
/** #ParticleTarget::mode */
|
||||
enum eParticleTarget_Mode : short {
|
||||
PTARGET_MODE_NEUTRAL = 0,
|
||||
PTARGET_MODE_FRIEND = 1,
|
||||
PTARGET_MODE_ENEMY = 2,
|
||||
};
|
||||
|
||||
/** #MTex::mapto */
|
||||
enum eParticleTextureInfluence : int {
|
||||
/* init */
|
||||
PAMAP_TIME = (1 << 0), /* emission time */
|
||||
PAMAP_LIFE = (1 << 1), /* life time */
|
||||
PAMAP_DENS = (1 << 2), /* density */
|
||||
PAMAP_SIZE = (1 << 3), /* physical size */
|
||||
PAMAP_INIT = (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE),
|
||||
/* reset */
|
||||
PAMAP_IVEL = (1 << 5), /* initial velocity */
|
||||
/* physics */
|
||||
PAMAP_FIELD = (1 << 6), /* force fields */
|
||||
PAMAP_GRAVITY = (1 << 10),
|
||||
PAMAP_DAMP = (1 << 11),
|
||||
PAMAP_PHYSICS = (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP),
|
||||
/* children */
|
||||
PAMAP_CLUMP = (1 << 7),
|
||||
PAMAP_KINK_FREQ = (1 << 8),
|
||||
PAMAP_KINK_AMP = (1 << 12),
|
||||
PAMAP_ROUGH = (1 << 9),
|
||||
PAMAP_LENGTH = (1 << 4),
|
||||
PAMAP_TWIST = (1 << 13),
|
||||
PAMAP_CHILD = (PAMAP_CLUMP | PAMAP_KINK_FREQ | PAMAP_KINK_AMP | PAMAP_ROUGH | PAMAP_LENGTH |
|
||||
PAMAP_TWIST),
|
||||
};
|
||||
ENUM_OPERATORS(eParticleTextureInfluence)
|
||||
|
||||
struct HairKey {
|
||||
/** Location of hair vertex. */
|
||||
float co[3];
|
||||
/** Time along hair, default 0-100. */
|
||||
float time;
|
||||
/** Softbody weight. */
|
||||
float weight;
|
||||
/** Saved particled edit mode flags. */
|
||||
short editflag;
|
||||
char _pad[2];
|
||||
float world_co[3];
|
||||
};
|
||||
|
||||
struct ParticleKey { /* when changed update size of struct to copy_particleKey()!! */
|
||||
/** Location. */
|
||||
float co[3];
|
||||
/** Velocity. */
|
||||
float vel[3];
|
||||
/** Rotation quaternion. */
|
||||
float rot[4];
|
||||
/** Angular velocity. */
|
||||
float ave[3];
|
||||
/** When this key happens. */
|
||||
float time;
|
||||
};
|
||||
|
||||
struct BoidParticle {
|
||||
struct Object *ground = nullptr;
|
||||
struct BoidData data;
|
||||
float gravity[3] = {};
|
||||
float wander[3] = {};
|
||||
char _pad0[4] = {};
|
||||
};
|
||||
|
||||
struct ParticleSpring {
|
||||
float rest_length;
|
||||
unsigned int particle_index[2], delete_flag;
|
||||
};
|
||||
|
||||
/** Child particles are created around or between parent particles. */
|
||||
struct ChildParticle {
|
||||
/** Face index on the final derived mesh. */
|
||||
int num;
|
||||
int parent;
|
||||
/** Nearest particles to the child, used for the interpolation. */
|
||||
int pa[4];
|
||||
/** Interpolation weights for the above particles. */
|
||||
float w[4];
|
||||
/** Face vertex weights and offset. */
|
||||
float fuv[4], foffset;
|
||||
char _pad0[4];
|
||||
};
|
||||
|
||||
struct ParticleTarget {
|
||||
struct ParticleTarget *next = nullptr, *prev = nullptr;
|
||||
struct Object *ob = nullptr;
|
||||
int psys = 0;
|
||||
eParticleTarget_Flag flag = {};
|
||||
eParticleTarget_Mode mode = {};
|
||||
float time = 0, duration = 0;
|
||||
};
|
||||
|
||||
struct ParticleDupliWeight {
|
||||
struct ParticleDupliWeight *next = nullptr, *prev = nullptr;
|
||||
struct Object *ob = nullptr;
|
||||
short count = 0;
|
||||
eParticleDupliWeight_Flag flag = {};
|
||||
/** Only updated on file save and used on file load. */
|
||||
short index = 0;
|
||||
char _pad0[2] = {};
|
||||
};
|
||||
|
||||
struct ParticleData {
|
||||
/** Current global coordinates. */
|
||||
ParticleKey state;
|
||||
|
||||
/** Previous state. */
|
||||
ParticleKey prev_state;
|
||||
|
||||
/** Hair vertices. */
|
||||
HairKey *hair = nullptr;
|
||||
|
||||
/** Keyed keys. */
|
||||
ParticleKey *keys = nullptr;
|
||||
|
||||
/** Boids data. */
|
||||
BoidParticle *boid = nullptr;
|
||||
|
||||
/** Amount of hair or keyed keys. */
|
||||
int totkey = 0;
|
||||
|
||||
/** Die-time is not necessarily time+lifetime as. */
|
||||
float time = 0, lifetime = 0;
|
||||
/**
|
||||
* Particles can die unnaturally (collision).
|
||||
*
|
||||
* \note Particles die on this frame, be sure to add 1 when clamping the lifetime of particles
|
||||
* to inclusive ranges such as the scenes end frame. See: #68290.
|
||||
*/
|
||||
float dietime = 0;
|
||||
|
||||
/**
|
||||
* WARNING! Those two indices,
|
||||
* when not affected to vertices, are for !!! TESSELLATED FACES !!!, not POLYGONS!
|
||||
*/
|
||||
/** Index to vert/edge/face. */
|
||||
int num = 0;
|
||||
/**
|
||||
* Index to derived mesh data (face) to avoid slow lookups. It can also have negative
|
||||
* values DMCACHE_NOTFOUND and DMCACHE_ISCHILD.
|
||||
*/
|
||||
int num_dmcache = 0;
|
||||
|
||||
/** Coordinates on face/edge number "num" and depth along. */
|
||||
float fuv[4] = {}, foffset = 0;
|
||||
/* face normal for volume emission. */
|
||||
|
||||
/** Size and multiplier so that we can update size when ever. */
|
||||
float size = 0;
|
||||
|
||||
/** Density of SPH particle. */
|
||||
float sphdensity = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
int hair_index = 0;
|
||||
eParticle_Flag flag = {};
|
||||
/** The life state of a particle. */
|
||||
eParticle_AliveState alive = {};
|
||||
};
|
||||
|
||||
struct SPHFluidSettings {
|
||||
/* Particle Fluid. */
|
||||
float radius = 0, spring_k = 0, rest_length = 0;
|
||||
float plasticity_constant = 0, yield_ratio = 0;
|
||||
float plasticity_balance = 0, yield_balance = 0;
|
||||
float viscosity_omega = 0, viscosity_beta = 0;
|
||||
float stiffness_k = 0, stiffness_knear = 0, rest_density = 0;
|
||||
float buoyancy = 0;
|
||||
eSPH_Flag flag = {};
|
||||
int spring_frames = 0;
|
||||
eSPH_Solver solver = {};
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
struct ParticleSettings {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_PA;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
struct BoidSettings *boids = nullptr;
|
||||
struct SPHFluidSettings *fluid = nullptr;
|
||||
|
||||
struct EffectorWeights *effector_weights = nullptr;
|
||||
struct Collection *collision_group = nullptr;
|
||||
|
||||
eParticleFlag flag = PART_EDISTR | PART_TRAND | PART_HIDE_ADVANCED_HAIR;
|
||||
char _pad1[4] = {};
|
||||
eParticleType type = PART_EMITTER;
|
||||
eParticleFrom from = PART_FROM_FACE;
|
||||
eParticleDistribution distr = PART_DISTR_JIT;
|
||||
short texact = 0;
|
||||
/* physics modes */
|
||||
eParticlePhysicsType phystype = PART_PHYS_NEWTON;
|
||||
eParticleRotationMode rotmode = PART_ROT_VEL;
|
||||
eParticleAngularVelocityMode avemode = PART_AVE_VELOCITY;
|
||||
eParticleReactEvent reactevent = PART_EVENT_DEATH;
|
||||
eParticleDrawFlag draw = {};
|
||||
float draw_size = 0.1f;
|
||||
eParticleDrawAs draw_as = PART_DRAW_REND;
|
||||
eParticleChildType childtype = {};
|
||||
char _pad2[4] = {};
|
||||
eParticleDrawAs ren_as = PART_DRAW_HALO;
|
||||
short subframes = 0;
|
||||
eParticleDrawCol draw_col = PART_DRAW_COL_MAT;
|
||||
/* number of path segments, power of 2 except */
|
||||
short draw_step = 2, ren_step = 3;
|
||||
short hair_step = 5, keys_step = 5;
|
||||
|
||||
/* adaptive path rendering */
|
||||
short adapt_angle = 5, adapt_pix = 3;
|
||||
|
||||
short disp = 100, omat = 1, interpolation = 0;
|
||||
eParticleIntegrator integrator = PART_INT_MIDPOINT;
|
||||
DNA_DEPRECATED short rotfrom = 0;
|
||||
eParticleKink kink = PART_KINK_NO;
|
||||
short kink_axis = 2;
|
||||
|
||||
/* billboards */
|
||||
DNA_DEPRECATED short bb_align = 0, bb_uv_split = 1, bb_anim = 0, bb_split_offset = 0;
|
||||
DNA_DEPRECATED float bb_tilt = 0, bb_rand_tilt = 0, bb_offset[2] = {}, bb_size[2] = {1.0f, 1.0f};
|
||||
DNA_DEPRECATED float bb_vel_head = 0;
|
||||
DNA_DEPRECATED float bb_vel_tail = 0;
|
||||
|
||||
/* draw color */
|
||||
float color_vec_max = 1.0f;
|
||||
|
||||
/* time and emission */
|
||||
float sta = 1.0f, end = 200.0f, lifetime = 50.0f, randlife = 0;
|
||||
float timetweak = 1.0f, courant_target = 0.2f;
|
||||
float jitfac = 1.0f, eff_hair = 0, grid_rand = 0, ps_offset[1] = {};
|
||||
int totpart = 1000, userjit = 0, grid_res = 10, effector_amount = 0;
|
||||
eParticleTimeFlag time_flag = {};
|
||||
char _pad0[6] = {};
|
||||
|
||||
/* initial velocity factors */
|
||||
float normfac = 1.0f, obfac = 0, randfac = 0, partfac = 0, tanfac = 0, tanphase = 0,
|
||||
reactfac = 0;
|
||||
float ob_vel[3] = {};
|
||||
float avefac = 0, phasefac = 0, randrotfac = 0, randphasefac = 0;
|
||||
/* physical properties */
|
||||
float mass = 1.0f, size = 0.05f, randsize = 0;
|
||||
/* global physical properties */
|
||||
float acc[3] = {}, dragfac = 0, brownfac = 0, dampfac = 0;
|
||||
/* length */
|
||||
float randlength = 0;
|
||||
/* children */
|
||||
eParticleChildFlag child_flag = {};
|
||||
char _pad3[4] = {};
|
||||
int child_percent = 10, child_render_percent = 100;
|
||||
float parents = 0, childsize = 1.0f, childrandsize = 0;
|
||||
float childrad = 0.2f, childflat = 0.0f;
|
||||
/* clumping */
|
||||
float clumpfac = 0, clumppow = 0.0f;
|
||||
/* kink */
|
||||
float kink_amp = 0.2f, kink_freq = 2.0f, kink_shape = 0, kink_flat = 0;
|
||||
float kink_amp_clump = 1.0f;
|
||||
int kink_extra_steps = 4;
|
||||
char _pad4[4] = {};
|
||||
float kink_axis_random = 0, kink_amp_random = 0;
|
||||
/* rough */
|
||||
float rough1 = 0, rough1_size = 1.0f;
|
||||
float rough2 = 0, rough2_size = 1.0f, rough2_thres = 0;
|
||||
float rough_end = 0, rough_end_shape = 1.0f;
|
||||
/* length */
|
||||
float clength = 1.0f, clength_thres = 0.0f;
|
||||
/* parting */
|
||||
float parting_fac = 0;
|
||||
float parting_min = 0, parting_max = 0;
|
||||
/* branching */
|
||||
float branch_thres = 0;
|
||||
/* drawing stuff */
|
||||
float draw_line[2] = {
|
||||
0.5f,
|
||||
};
|
||||
float path_start = 0.0f, path_end = 1.0f;
|
||||
int trail_count = 0;
|
||||
/* keyed particles */
|
||||
int keyed_loops = 1;
|
||||
struct CurveMapping *clumpcurve = nullptr;
|
||||
struct CurveMapping *roughcurve = nullptr;
|
||||
float clump_noise_size = 1.0f;
|
||||
|
||||
/* hair dynamics */
|
||||
float bending_random = 0;
|
||||
|
||||
struct MTex *mtex[/*MAX_MTEX*/ 18] = {};
|
||||
|
||||
struct Collection *instance_collection = nullptr;
|
||||
ListBaseT<ParticleDupliWeight> instance_weights = {nullptr, nullptr};
|
||||
DNA_DEPRECATED struct Collection *force_group = nullptr; /* deprecated */
|
||||
struct Object *instance_object = nullptr;
|
||||
struct Object *bb_ob = nullptr;
|
||||
struct PartDeflect *pd = nullptr;
|
||||
struct PartDeflect *pd2 = nullptr;
|
||||
|
||||
/* Evaluated mesh support. */
|
||||
short use_modifier_stack = false;
|
||||
char _pad5[2] = {};
|
||||
|
||||
/* hair shape */
|
||||
eParticleShapeFlag shape_flag = PART_SHAPE_CLOSE_TIP;
|
||||
char _pad6[2] = {};
|
||||
|
||||
float twist = 0;
|
||||
char _pad8[4] = {};
|
||||
|
||||
/* hair thickness shape */
|
||||
float shape = 0.0f;
|
||||
float rad_root = 1.0f, rad_tip = 0.0f, rad_scale = 0.01f;
|
||||
|
||||
struct CurveMapping *twistcurve = nullptr;
|
||||
};
|
||||
|
||||
struct ParticleSystem {
|
||||
DNA_DEFINE_CXX_METHODS(ParticleSystem)
|
||||
|
||||
/* note1: make sure all (run-time) are NULL's in `copy_particlesystem` XXX,
|
||||
* this function is no more! - need to investigate. */
|
||||
|
||||
/* note2: make sure any uses of this struct in DNA are
|
||||
* accounted for in #BKE_object_copy_particlesystems. */
|
||||
|
||||
struct ParticleSystem *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Particle settings. */
|
||||
ParticleSettings *part = nullptr;
|
||||
|
||||
/** (parent) particles. */
|
||||
ParticleData *particles = nullptr;
|
||||
/** Child particles. */
|
||||
ChildParticle *child = nullptr;
|
||||
|
||||
/** Particle editmode (runtime). */
|
||||
struct PTCacheEdit *edit = nullptr;
|
||||
/** Free callback. */
|
||||
void (*free_edit)(struct PTCacheEdit *edit) = nullptr;
|
||||
|
||||
/** Path cache (runtime). */
|
||||
struct ParticleCacheKey **pathcache = nullptr;
|
||||
/** Child cache (runtime). */
|
||||
struct ParticleCacheKey **childcache = nullptr;
|
||||
/** Buffers for the above. */
|
||||
ListBaseT<LinkData> pathcachebufs, childcachebufs;
|
||||
|
||||
/** Cloth simulation for hair. */
|
||||
struct ClothModifierData *clmd = nullptr;
|
||||
/** Input/output for cloth simulation. */
|
||||
struct Mesh *hair_in_mesh = nullptr, *hair_out_mesh = nullptr;
|
||||
|
||||
struct Object *target_ob = nullptr;
|
||||
|
||||
/** Run-time only lattice deformation data. */
|
||||
struct LatticeDeformData *lattice_deform_data = nullptr;
|
||||
|
||||
/** Particles from global space -> parent space. */
|
||||
struct Object *parent = nullptr;
|
||||
|
||||
/** Used for keyed and boid physics. */
|
||||
ListBaseT<ParticleTarget> targets = {nullptr, nullptr};
|
||||
|
||||
/** Particle system name. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/** Used for instancing. */
|
||||
float imat[4][4] = {};
|
||||
float cfra = 0, tree_frame = 0, bvhtree_frame = 0;
|
||||
int seed = 0, child_seed = 0;
|
||||
eParticleSystem_Flag flag = {};
|
||||
int totpart = 0, totunexist = 0, totchild = 0, totcached = 0, totchildcache = 0;
|
||||
/* NOTE: Recalc is one of ID_RECALC_PSYS_ALL flags.
|
||||
*
|
||||
* TODO(sergey): Use #ParticleSettings.id.recalc instead of this duplicated flag somehow. */
|
||||
int recalc = 0;
|
||||
short target_psys = 0, totkeyed = 0, bakespace = 0;
|
||||
char _pad1[6] = {};
|
||||
|
||||
/** Billboard UV name. */
|
||||
DNA_DEPRECATED char bb_uvname[3][/*MAX_CUSTOMDATA_LAYER_NAME*/ 68];
|
||||
|
||||
char _pad2[4] = {};
|
||||
/* if you change these remember to update array lengths to PSYS_TOT_VG! */
|
||||
/** Vertex groups, 0==disable, 1==starting index. */
|
||||
short vgroup[/*PSYS_TOT_VG*/ 13] = {};
|
||||
short vg_neg = 0, rt3 = 0;
|
||||
char _pad3[6] = {};
|
||||
|
||||
/* point cache */
|
||||
struct PointCache *pointcache = nullptr;
|
||||
ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
|
||||
|
||||
struct ListBaseT<struct EffectorCache> *effectors = nullptr;
|
||||
|
||||
ParticleSpring *fluid_springs = nullptr;
|
||||
int tot_fluidsprings = 0, alloc_fluidsprings = 0;
|
||||
|
||||
/** Used for interactions with self and other systems. */
|
||||
KDTree3d *tree = nullptr;
|
||||
/** Used for interactions with self and other systems. */
|
||||
struct BVHTree *bvhtree = nullptr;
|
||||
|
||||
struct ParticleDrawData *pdd = nullptr;
|
||||
|
||||
/** Current time step, as a fraction of a frame. */
|
||||
float dt_frac = 0;
|
||||
/** Influence of the lattice modifier. */
|
||||
float lattice_strength = 0;
|
||||
|
||||
draw::ParticleBatchCache *batch_cache = nullptr;
|
||||
|
||||
/**
|
||||
* Set by dependency graph's copy-on-evaluation, allows to quickly go
|
||||
* from evaluated particle system to original one.
|
||||
*
|
||||
* Original system will have this set to NULL.
|
||||
*
|
||||
* Use #psys_orig_get() function to access.
|
||||
*/
|
||||
struct ParticleSystem *orig_psys = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
175
blender-5.2.0/source/blender/makesdna/DNA_pointcache_types.h
Normal file
175
blender-5.2.0/source/blender/makesdna/DNA_pointcache_types.h
Normal file
@@ -0,0 +1,175 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* Point cache file data types:
|
||||
* - Used as `(1 << flag)` so poke jahka if you reach the limit of 15.
|
||||
* - To add new data types update:
|
||||
* - #BKE_ptcache_data_size()
|
||||
* - #ptcache_file_pointers_init()
|
||||
*/
|
||||
/** #PTCacheMem::data_types */
|
||||
enum ePointCache_DataType : short {
|
||||
BPHYS_DATA_INDEX = 0,
|
||||
BPHYS_DATA_LOCATION = 1,
|
||||
BPHYS_DATA_SMOKE_LOW = 1,
|
||||
BPHYS_DATA_VELOCITY = 2,
|
||||
BPHYS_DATA_SMOKE_HIGH = 2,
|
||||
BPHYS_DATA_ROTATION = 3,
|
||||
BPHYS_DATA_DYNAMICPAINT = 3,
|
||||
BPHYS_DATA_AVELOCITY = 4, /* Used for particles. */
|
||||
BPHYS_DATA_XCONST = 4, /* Used for cloth. */
|
||||
BPHYS_DATA_SIZE = 5,
|
||||
BPHYS_DATA_TIMES = 6,
|
||||
BPHYS_DATA_BOIDS = 7,
|
||||
|
||||
BPHYS_TOT_DATA = 8,
|
||||
};
|
||||
|
||||
/** #PTCacheExtra::type */
|
||||
enum ePointCache_ExtraDataType : short {
|
||||
BPHYS_EXTRA_FLUID_SPRINGS = 1,
|
||||
BPHYS_EXTRA_CLOTH_ACCELERATION = 2,
|
||||
};
|
||||
|
||||
/** #PointCache.flag */
|
||||
enum ePointCache_Flag : int {
|
||||
PTCACHE_BAKED = 1 << 0,
|
||||
PTCACHE_OUTDATED = 1 << 1,
|
||||
PTCACHE_SIMULATION_VALID = 1 << 2,
|
||||
PTCACHE_BAKING = 1 << 3,
|
||||
// PTCACHE_BAKE_EDIT = 1 << 4,
|
||||
// PTCACHE_BAKE_EDIT_ACTIVE = 1 << 5,
|
||||
PTCACHE_DISK_CACHE = 1 << 6,
|
||||
/* removed since 2.64 - #30974, could be added back in a more useful way */
|
||||
// PTCACHE_QUICK_CACHE = 1 << 7,
|
||||
PTCACHE_FRAMES_SKIPPED = 1 << 8,
|
||||
PTCACHE_EXTERNAL = 1 << 9,
|
||||
PTCACHE_READ_INFO = 1 << 10,
|
||||
/** Don't use the file-path of the blend-file the data is linked from (write a local cache). */
|
||||
PTCACHE_IGNORE_LIBPATH = 1 << 11,
|
||||
/**
|
||||
* High resolution cache is saved for smoke for backwards compatibility,
|
||||
* so set this flag to know it's a "fake" cache.
|
||||
*/
|
||||
PTCACHE_FAKE_SMOKE = 1 << 12,
|
||||
PTCACHE_IGNORE_CLEAR = 1 << 13,
|
||||
|
||||
PTCACHE_FLAG_INFO_DIRTY = 1 << 14,
|
||||
|
||||
PTCACHE_REDO_NEEDED = PTCACHE_OUTDATED | PTCACHE_FRAMES_SKIPPED,
|
||||
PTCACHE_FLAGS_COPY = PTCACHE_DISK_CACHE | PTCACHE_EXTERNAL | PTCACHE_IGNORE_LIBPATH,
|
||||
};
|
||||
ENUM_OPERATORS(ePointCache_Flag)
|
||||
|
||||
/**
|
||||
* Cache files baked before 5.0 could have used LZO or LZMA.
|
||||
* During 5.0 alpha ZSTD compression had two settings.
|
||||
* Now only the ZSTD+filtering option is used.
|
||||
*/
|
||||
enum PointCacheCompression : short {
|
||||
PTCACHE_COMPRESS_NO = 0,
|
||||
PTCACHE_COMPRESS_LZO_DEPRECATED = 1, /* Removed in 5.0. */
|
||||
PTCACHE_COMPRESS_LZMA_DEPRECATED = 2, /* Removed in 5.0. */
|
||||
PTCACHE_COMPRESS_ZSTD_FILTERED = 3,
|
||||
PTCACHE_COMPRESS_ZSTD_FAST_DEPRECATED = 4, /* Used only during 5.0 alpha. */
|
||||
PTCACHE_COMPRESS_ZSTD_SLOW_DEPRECATED = 8, /* Used only during 5.0 alpha. */
|
||||
};
|
||||
|
||||
struct PTCacheExtra {
|
||||
struct PTCacheExtra *next = nullptr, *prev = nullptr;
|
||||
ePointCache_ExtraDataType type = {};
|
||||
char _pad[2] = {};
|
||||
unsigned int totdata = 0;
|
||||
void *data = nullptr;
|
||||
};
|
||||
|
||||
struct PTCacheMem {
|
||||
struct PTCacheMem *next = nullptr, *prev = nullptr;
|
||||
unsigned int frame = 0, totpoint = 0;
|
||||
unsigned int data_types = 0, flag = 0;
|
||||
|
||||
/** BPHYS_TOT_DATA. */
|
||||
void *data[/*BPHYS_TOT_DATA*/ 8] = {};
|
||||
|
||||
ListBaseT<PTCacheExtra> extradata = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
struct PointCache {
|
||||
struct PointCache *next = nullptr, *prev = nullptr;
|
||||
/** Generic flag. */
|
||||
ePointCache_Flag flag = {};
|
||||
|
||||
/**
|
||||
* The number of frames between cached frames.
|
||||
* This should probably be an upper bound for a per point adaptive step in the future,
|
||||
* but for now it's the same for all points. Without adaptivity this can effect the perceived
|
||||
* simulation quite a bit though. If for example particles are colliding with a horizontal
|
||||
* plane (with high damping) they quickly come to a stop on the plane, however there are still
|
||||
* forces acting on the particle (gravity and collisions), so the particle velocity isn't
|
||||
* necessarily zero for the whole duration of the frame even if the particle seems stationary.
|
||||
* If all simulation frames aren't cached (step > 1) these velocities are interpolated into
|
||||
* movement for the non-cached frames.
|
||||
* The result will look like the point is oscillating around the collision location.
|
||||
* So for now cache step should be set to 1 for accurate reproduction of collisions.
|
||||
*/
|
||||
int step = 0;
|
||||
|
||||
/** Current frame of simulation (only if SIMULATION_VALID). */
|
||||
int simframe = 0;
|
||||
/** Simulation start frame. */
|
||||
int startframe = 0;
|
||||
/** Simulation end frame. */
|
||||
int endframe = 0;
|
||||
/** Frame being edited (runtime only). */
|
||||
int editframe = 0;
|
||||
/** Last exact frame that's cached. */
|
||||
int last_exact = 0;
|
||||
/** Used for editing cache - what is the last baked frame. */
|
||||
int last_valid = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
/* for external cache files */
|
||||
/** Number of cached points. */
|
||||
int totpoint = 0;
|
||||
/** Modifier stack index. */
|
||||
int index = 0;
|
||||
/** Used for versioning only; now cache is always compressed. */
|
||||
PointCacheCompression compression = PTCACHE_COMPRESS_NO;
|
||||
char _pad0[2] = {};
|
||||
|
||||
char name[64] = "";
|
||||
char prev_name[64] = "";
|
||||
char info[128] = "";
|
||||
/** File path. */
|
||||
char path[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
/**
|
||||
* Array of length `endframe - startframe + 1` with flags to indicate cached frames.
|
||||
* Can be later used for other per frame flags too if needed.
|
||||
*/
|
||||
char *cached_frames = nullptr;
|
||||
int cached_frames_len = 0;
|
||||
char _pad1[4] = {};
|
||||
|
||||
ListBaseT<PTCacheMem> mem_cache = {nullptr, nullptr};
|
||||
|
||||
struct PTCacheEdit *edit = nullptr;
|
||||
/** Free callback. */
|
||||
void (*free_edit)(struct PTCacheEdit *edit) = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
104
blender-5.2.0/source/blender/makesdna/DNA_pointcloud_types.h
Normal file
104
blender-5.2.0/source/blender/makesdna/DNA_pointcloud_types.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_attribute_types.h"
|
||||
#include "DNA_customdata_types.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "BLI_bounds_types.hh"
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
#include "BLI_memory_counter_fwd.hh"
|
||||
#include "BLI_span.hh"
|
||||
#include "BLI_virtual_array_fwd.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
template<typename T> class Span;
|
||||
namespace bke {
|
||||
class AttributeAccessor;
|
||||
struct BVHTreeFromPointCloud;
|
||||
class MutableAttributeAccessor;
|
||||
struct PointCloudRuntime;
|
||||
} // namespace bke
|
||||
|
||||
namespace draw {
|
||||
struct PointCloudBatchCache;
|
||||
}
|
||||
|
||||
/** #PointCloud.flag */
|
||||
enum ePointCloud_Flag : int {
|
||||
PT_DS_EXPAND = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(ePointCloud_Flag)
|
||||
|
||||
struct PointCloud {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_PT;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr; /* animation data (must be immediately after id) */
|
||||
|
||||
ePointCloud_Flag flag = {};
|
||||
|
||||
/* Geometry */
|
||||
int totpoint = 0;
|
||||
|
||||
/** Storage for generic attributes. */
|
||||
struct AttributeStorage attribute_storage;
|
||||
|
||||
/* Custom Data */
|
||||
struct CustomData pdata_legacy;
|
||||
/** Set to -1 when none is active. */
|
||||
int attributes_active_index = 0;
|
||||
int _pad4 = {};
|
||||
|
||||
/* Material */
|
||||
struct Material **mat = nullptr;
|
||||
short totcol = 0;
|
||||
short _pad3[3] = {};
|
||||
|
||||
#ifdef __cplusplus
|
||||
Span<float3> positions() const;
|
||||
MutableSpan<float3> positions_for_write();
|
||||
|
||||
VArray<float> radius() const;
|
||||
MutableSpan<float> radius_for_write();
|
||||
|
||||
bke::AttributeAccessor attributes() const;
|
||||
bke::MutableAttributeAccessor attributes_for_write();
|
||||
|
||||
void tag_positions_changed();
|
||||
void tag_radii_changed();
|
||||
|
||||
std::optional<Bounds<float3>> bounds_min_max(bool use_radius = true) const;
|
||||
|
||||
/** Get the largest material index used by the point-cloud or `nullopt` if it is empty. */
|
||||
std::optional<int> material_index_max() const;
|
||||
|
||||
bke::BVHTreeFromPointCloud bvh_tree() const;
|
||||
|
||||
void count_memory(MemoryCounter &memory) const;
|
||||
#endif
|
||||
|
||||
bke::PointCloudRuntime *runtime = nullptr;
|
||||
|
||||
/* Draw Cache */
|
||||
draw::PointCloudBatchCache *batch_cache = nullptr;
|
||||
};
|
||||
|
||||
/* Only one material supported currently. */
|
||||
#define POINTCLOUD_MATERIAL_NR 1
|
||||
|
||||
} // namespace blender
|
||||
53
blender-5.2.0/source/blender/makesdna/DNA_print.hh
Normal file
53
blender-5.2.0/source/blender/makesdna/DNA_print.hh
Normal file
@@ -0,0 +1,53 @@
|
||||
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <iosfwd>
|
||||
|
||||
#include "DNA_sdna_type_ids.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct SDNA;
|
||||
struct SDNA_Struct;
|
||||
|
||||
namespace dna {
|
||||
|
||||
/**
|
||||
* Print all members of the struct assuming that the data has the given address. This is mainly
|
||||
* useful for observing what data is written to a .blend file.
|
||||
*
|
||||
* \param sdna: Contains reflection information about DNA structs.
|
||||
* \param struct_id: The type the data points to. Used to index into `sdna.structs`.
|
||||
* \param data: Where the data is stored.
|
||||
* \param address: The address that should be printed. Often it's the same as `data`.
|
||||
* \param element_num: The number of elements in the array, or 1 if there is only one struct.
|
||||
* \param stream: Where to print the output.
|
||||
*/
|
||||
void print_structs_at_address(const SDNA &sdna,
|
||||
int struct_id,
|
||||
const void *data,
|
||||
const void *address,
|
||||
int64_t element_num,
|
||||
std::ostream &stream);
|
||||
|
||||
/**
|
||||
* Prints all members of the struct to stdout.
|
||||
*/
|
||||
void print_struct_by_id(int struct_id, const void *data);
|
||||
|
||||
} // namespace dna
|
||||
|
||||
/**
|
||||
* Prints all members of the struct to stdout.
|
||||
*
|
||||
* Usage:
|
||||
* DNA_print_struct(bNode, node);
|
||||
*/
|
||||
#define DNA_print_struct(struct_name, data_ptr) \
|
||||
dna::print_struct_by_id(dna::sdna_struct_id_get<struct_name>(), data_ptr)
|
||||
|
||||
} // namespace blender
|
||||
364
blender-5.2.0/source/blender/makesdna/DNA_rigidbody_types.h
Normal file
364
blender-5.2.0/source/blender/makesdna/DNA_rigidbody_types.h
Normal file
@@ -0,0 +1,364 @@
|
||||
/* SPDX-FileCopyrightText: 2013 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
* \brief Types and defines for representing Rigid Body entities
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_object_force_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct Collection;
|
||||
|
||||
struct EffectorWeights;
|
||||
struct RigidBodyWorld_Runtime;
|
||||
|
||||
/** RigidBodyWorld.flag */
|
||||
enum eRigidBodyWorld_Flag : int {
|
||||
/* should sim world be skipped when evaluating (user setting) */
|
||||
RBW_FLAG_MUTED = (1 << 0),
|
||||
/* sim data needs to be rebuilt */
|
||||
/* RBW_FLAG_NEEDS_REBUILD = (1 << 1), */ /* UNUSED */
|
||||
/** Use split impulse when stepping the simulation. */
|
||||
RBW_FLAG_USE_SPLIT_IMPULSE = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eRigidBodyWorld_Flag)
|
||||
|
||||
/** #RigidBodyOb.type */
|
||||
enum eRigidBodyOb_Type : short {
|
||||
/* active geometry participant in simulation. is directly controlled by sim */
|
||||
RBO_TYPE_ACTIVE = 0,
|
||||
/* passive geometry participant in simulation. is directly controlled by animsys */
|
||||
RBO_TYPE_PASSIVE = 1,
|
||||
};
|
||||
|
||||
/** #RigidBodyOb.flag */
|
||||
enum eRigidBodyOb_Flag : int {
|
||||
/* rigidbody is kinematic (controlled by the animation system) */
|
||||
RBO_FLAG_KINEMATIC = (1 << 0),
|
||||
/* rigidbody needs to be validated (usually set after duplicating and not hooked up yet) */
|
||||
RBO_FLAG_NEEDS_VALIDATE = (1 << 1),
|
||||
/* rigidbody shape needs refreshing (usually after exiting editmode) */
|
||||
RBO_FLAG_NEEDS_RESHAPE = (1 << 2),
|
||||
/* rigidbody can be deactivated */
|
||||
RBO_FLAG_USE_DEACTIVATION = (1 << 3),
|
||||
/* rigidbody is deactivated at the beginning of simulation */
|
||||
RBO_FLAG_START_DEACTIVATED = (1 << 4),
|
||||
/* rigidbody is not dynamically simulated */
|
||||
RBO_FLAG_DISABLED = (1 << 5),
|
||||
/* collision margin is not embedded (only used by convex hull shapes for now) */
|
||||
RBO_FLAG_USE_MARGIN = (1 << 6),
|
||||
/* collision shape deforms during simulation (only for passive triangle mesh shapes) */
|
||||
RBO_FLAG_USE_DEFORM = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eRigidBodyOb_Flag)
|
||||
|
||||
/** Rigid Body Collision Shape. */
|
||||
enum eRigidBody_Shape : short {
|
||||
/** Simple box (i.e. bounding box). */
|
||||
RB_SHAPE_BOX = 0,
|
||||
/** Sphere. */
|
||||
RB_SHAPE_SPHERE = 1,
|
||||
/** Rounded "pill" shape (i.e. calcium tablets). */
|
||||
RB_SHAPE_CAPSULE = 2,
|
||||
/** Cylinder (i.e. tin of beans). */
|
||||
RB_SHAPE_CYLINDER = 3,
|
||||
/** Cone (i.e. party hat). */
|
||||
RB_SHAPE_CONE = 4,
|
||||
|
||||
/** Convex hull (minimal shrink-wrap encompassing all verts). */
|
||||
RB_SHAPE_CONVEXH = 5,
|
||||
/** Triangulated mesh. */
|
||||
RB_SHAPE_TRIMESH = 6,
|
||||
|
||||
/* concave mesh approximated using primitives */
|
||||
RB_SHAPE_COMPOUND = 7,
|
||||
};
|
||||
|
||||
enum eRigidBody_MeshSource : short {
|
||||
/** Base mesh. */
|
||||
RBO_MESH_BASE = 0,
|
||||
/** Only deformations. */
|
||||
RBO_MESH_DEFORM = 1,
|
||||
/** Final evaluated mesh. */
|
||||
RBO_MESH_FINAL = 2,
|
||||
};
|
||||
|
||||
/** Participation types for #RigidBodyOb.type */
|
||||
enum eRigidBodyCon_Type : short {
|
||||
/** lets bodies rotate around a specified point */
|
||||
RBC_TYPE_POINT = 0,
|
||||
/** lets bodies rotate around a specified axis */
|
||||
RBC_TYPE_HINGE = 1,
|
||||
/** simulates wheel suspension */
|
||||
/* RBC_TYPE_HINGE2 = 2, */ /* UNUSED */
|
||||
/** Restricts moment to a specified axis. */
|
||||
RBC_TYPE_SLIDER = 3,
|
||||
/** lets object rotate within a specified cone */
|
||||
/* RBC_TYPE_CONE_TWIST = 4, */ /* UNUSED */
|
||||
/** allows user to specify constraint axes */
|
||||
RBC_TYPE_6DOF = 5,
|
||||
/** like 6DOF but has springs */
|
||||
RBC_TYPE_6DOF_SPRING = 6,
|
||||
/** simulates a universal joint */
|
||||
/* RBC_TYPE_UNIVERSAL = 7, */ /* UNUSED */
|
||||
/** glues two bodies together */
|
||||
RBC_TYPE_FIXED = 8,
|
||||
/** similar to slider but also allows rotation around slider axis */
|
||||
RBC_TYPE_PISTON = 9,
|
||||
/** Simplified spring constraint with only once axis that's
|
||||
* automatically placed between the connected bodies */
|
||||
/* RBC_TYPE_SPRING = 10, */ /* UNUSED */
|
||||
/** Drives bodies by applying linear and angular forces. */
|
||||
RBC_TYPE_MOTOR = 11,
|
||||
};
|
||||
|
||||
/** Spring implementation type for RigidBodyOb. */
|
||||
enum eRigidBodyCon_SpringType : char {
|
||||
RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */
|
||||
RBC_SPRING_TYPE2 = 1, /* btGeneric6DofSpring2Constraint */
|
||||
};
|
||||
|
||||
/** #RigidBodyCon.flag */
|
||||
enum eRigidBodyCon_Flag : int {
|
||||
/* constraint influences rigid body motion */
|
||||
RBC_FLAG_ENABLED = (1 << 0),
|
||||
/* constraint needs to be validated */
|
||||
RBC_FLAG_NEEDS_VALIDATE = (1 << 1),
|
||||
/* allow constrained bodies to collide */
|
||||
RBC_FLAG_DISABLE_COLLISIONS = (1 << 2),
|
||||
/* constraint can break */
|
||||
RBC_FLAG_USE_BREAKING = (1 << 3),
|
||||
/* constraint use custom number of constraint solver iterations */
|
||||
RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS = (1 << 4),
|
||||
/* limits */
|
||||
RBC_FLAG_USE_LIMIT_LIN_X = (1 << 5),
|
||||
RBC_FLAG_USE_LIMIT_LIN_Y = (1 << 6),
|
||||
RBC_FLAG_USE_LIMIT_LIN_Z = (1 << 7),
|
||||
RBC_FLAG_USE_LIMIT_ANG_X = (1 << 8),
|
||||
RBC_FLAG_USE_LIMIT_ANG_Y = (1 << 9),
|
||||
RBC_FLAG_USE_LIMIT_ANG_Z = (1 << 10),
|
||||
/* springs */
|
||||
RBC_FLAG_USE_SPRING_X = (1 << 11),
|
||||
RBC_FLAG_USE_SPRING_Y = (1 << 12),
|
||||
RBC_FLAG_USE_SPRING_Z = (1 << 13),
|
||||
/* motors */
|
||||
RBC_FLAG_USE_MOTOR_LIN = (1 << 14),
|
||||
RBC_FLAG_USE_MOTOR_ANG = (1 << 15),
|
||||
/* angular springs */
|
||||
RBC_FLAG_USE_SPRING_ANG_X = (1 << 16),
|
||||
RBC_FLAG_USE_SPRING_ANG_Y = (1 << 17),
|
||||
RBC_FLAG_USE_SPRING_ANG_Z = (1 << 18),
|
||||
};
|
||||
ENUM_OPERATORS(eRigidBodyCon_Flag)
|
||||
|
||||
/* ******************************** */
|
||||
/* RigidBody World */
|
||||
|
||||
/** Container for data shared by original and evaluated copies of #RigidBodyWorld. */
|
||||
struct RigidBodyWorld_Shared {
|
||||
/* cache */
|
||||
struct PointCache *pointcache = nullptr;
|
||||
ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
|
||||
|
||||
/* Runtime data. */
|
||||
struct RigidBodyWorld_Runtime *runtime = nullptr;
|
||||
};
|
||||
|
||||
/* RigidBodyWorld (rbw)
|
||||
*
|
||||
* Represents a "simulation scene" existing within the parent scene.
|
||||
*/
|
||||
struct RigidBodyWorld {
|
||||
DNA_DEFINE_CXX_METHODS(RigidBodyWorld)
|
||||
|
||||
/* Sim World Settings ------------------------------------------------------------- */
|
||||
/** Effectors info. */
|
||||
struct EffectorWeights *effector_weights = nullptr;
|
||||
|
||||
/** Group containing objects to use for Rigid Bodies. */
|
||||
struct Collection *group = nullptr;
|
||||
/** Array to access group objects by index, only used at runtime. */
|
||||
struct Object **objects = nullptr;
|
||||
|
||||
/** Group containing objects to use for Rigid Body Constraints. */
|
||||
struct Collection *constraints = nullptr;
|
||||
|
||||
char _pad[4] = {};
|
||||
/** Last frame world was evaluated for (internal). */
|
||||
float ltime = 0;
|
||||
|
||||
/** This pointer is shared between all evaluated copies. */
|
||||
struct RigidBodyWorld_Shared *shared = nullptr;
|
||||
/** Moved to `shared->pointcache`. */
|
||||
DNA_DEPRECATED struct PointCache *pointcache = nullptr;
|
||||
/** Moved to `shared->ptcaches`. */
|
||||
ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
|
||||
/** Number of objects in rigid body group. */
|
||||
int numbodies = 0;
|
||||
|
||||
/** Number of simulation sub-steps steps taken per frame. */
|
||||
short substeps_per_frame = 0;
|
||||
/** Number of constraint solver iterations made per simulation step. */
|
||||
short num_solver_iterations = 0;
|
||||
|
||||
/** Settings for this RigidBodyWorld. */
|
||||
eRigidBodyWorld_Flag flag = {};
|
||||
/** Used to speed up or slow down the simulation. */
|
||||
float time_scale = 0;
|
||||
};
|
||||
|
||||
/* ******************************** */
|
||||
/* RigidBody Object */
|
||||
|
||||
/* Container for data that is shared among evaluated copies.
|
||||
*
|
||||
* This is placed in a separate struct so that, for example, the physics_shape
|
||||
* pointer can be replaced without having to update all evaluated copies. */
|
||||
#
|
||||
#
|
||||
struct RigidBodyOb_Shared {
|
||||
/* References to Physics Sim objects. Exist at runtime only */
|
||||
/** Physics object representation (i.e. btRigidBody). */
|
||||
void *physics_object = nullptr;
|
||||
/** Collision shape used by physics sim (i.e. btCollisionShape). */
|
||||
void *physics_shape = nullptr;
|
||||
};
|
||||
|
||||
/* RigidBodyObject (rbo)
|
||||
*
|
||||
* Represents an object participating in a RigidBody sim.
|
||||
* This is attached to each object that is currently
|
||||
* participating in a sim.
|
||||
*/
|
||||
struct RigidBodyOb {
|
||||
/* General Settings for this RigidBodyOb */
|
||||
/** Role of RigidBody in sim. */
|
||||
eRigidBodyOb_Type type = RBO_TYPE_ACTIVE;
|
||||
/** Collision shape to use. */
|
||||
eRigidBody_Shape shape = RB_SHAPE_BOX;
|
||||
|
||||
eRigidBodyOb_Flag flag = {};
|
||||
/** Collision groups that determines which rigid bodies can collide with each other. */
|
||||
int col_groups = 0;
|
||||
/** Mesh source for mesh based collision shapes. */
|
||||
eRigidBody_MeshSource mesh_source = RBO_MESH_BASE;
|
||||
char _pad[2] = {};
|
||||
|
||||
/* Physics Parameters */
|
||||
/** How much object 'weighs' (i.e. absolute 'amount of stuff' it holds). */
|
||||
float mass = 0;
|
||||
|
||||
/** Resistance of object to movement. */
|
||||
float friction = 0;
|
||||
/** How 'bouncy' object is when it collides. */
|
||||
float restitution = 0;
|
||||
|
||||
/** Tolerance for detecting collisions. */
|
||||
float margin = 0;
|
||||
|
||||
/** Damping for linear velocities. */
|
||||
float lin_damping = 0;
|
||||
/** Damping for angular velocities. */
|
||||
float ang_damping = 0;
|
||||
|
||||
/** Deactivation threshold for linear velocities. */
|
||||
float lin_sleep_thresh = 0;
|
||||
/** Deactivation threshold for angular velocities. */
|
||||
float ang_sleep_thresh = 0;
|
||||
|
||||
/** Rigid body orientation. */
|
||||
float orn[4] = {};
|
||||
/** Rigid body position. */
|
||||
float pos[3] = {};
|
||||
char _pad1[4] = {};
|
||||
|
||||
/** This pointer is shared between all evaluated copies. */
|
||||
struct RigidBodyOb_Shared *shared = nullptr;
|
||||
};
|
||||
|
||||
/* ******************************** */
|
||||
/* RigidBody Constraint */
|
||||
|
||||
/* RigidBodyConstraint (rbc)
|
||||
*
|
||||
* Represents an constraint connecting two rigid bodies.
|
||||
*/
|
||||
struct RigidBodyCon {
|
||||
/** First object influenced by the constraint. */
|
||||
struct Object *ob1 = nullptr;
|
||||
/** Second object influenced by the constraint. */
|
||||
struct Object *ob2 = nullptr;
|
||||
|
||||
/* General Settings for this RigidBodyCon */
|
||||
/** Role of RigidBody in sim. */
|
||||
eRigidBodyCon_Type type = RBC_TYPE_POINT;
|
||||
/** Number of constraint solver iterations made per simulation step. */
|
||||
short num_solver_iterations = 0;
|
||||
|
||||
eRigidBodyCon_Flag flag = {};
|
||||
|
||||
/** Breaking impulse threshold. */
|
||||
float breaking_threshold = 0;
|
||||
/** Spring implementation to use. */
|
||||
eRigidBodyCon_SpringType spring_type = RBC_SPRING_TYPE1;
|
||||
char _pad[3] = {};
|
||||
|
||||
/* limits */
|
||||
/* translation limits */
|
||||
float limit_lin_x_lower = 0;
|
||||
float limit_lin_x_upper = 0;
|
||||
float limit_lin_y_lower = 0;
|
||||
float limit_lin_y_upper = 0;
|
||||
float limit_lin_z_lower = 0;
|
||||
float limit_lin_z_upper = 0;
|
||||
/* rotation limits */
|
||||
float limit_ang_x_lower = 0;
|
||||
float limit_ang_x_upper = 0;
|
||||
float limit_ang_y_lower = 0;
|
||||
float limit_ang_y_upper = 0;
|
||||
float limit_ang_z_lower = 0;
|
||||
float limit_ang_z_upper = 0;
|
||||
|
||||
/* spring settings */
|
||||
/* resistance to deformation */
|
||||
float spring_stiffness_x = 0;
|
||||
float spring_stiffness_y = 0;
|
||||
float spring_stiffness_z = 0;
|
||||
float spring_stiffness_ang_x = 0;
|
||||
float spring_stiffness_ang_y = 0;
|
||||
float spring_stiffness_ang_z = 0;
|
||||
/* amount of velocity lost over time */
|
||||
float spring_damping_x = 0;
|
||||
float spring_damping_y = 0;
|
||||
float spring_damping_z = 0;
|
||||
float spring_damping_ang_x = 0;
|
||||
float spring_damping_ang_y = 0;
|
||||
float spring_damping_ang_z = 0;
|
||||
|
||||
/* motor settings */
|
||||
/** Linear velocity the motor tries to hold. */
|
||||
float motor_lin_target_velocity = 0;
|
||||
/** Angular velocity the motor tries to hold. */
|
||||
float motor_ang_target_velocity = 0;
|
||||
/** Maximum force used to reach linear target velocity. */
|
||||
float motor_lin_max_impulse = 0;
|
||||
/** Maximum force used to reach angular target velocity. */
|
||||
float motor_ang_max_impulse = 0;
|
||||
|
||||
/* References to Physics Sim object. Exist at runtime only */
|
||||
/** Physics object representation (i.e. btTypedConstraint). */
|
||||
void *physics_constraint = nullptr;
|
||||
};
|
||||
|
||||
/* ******************************** */
|
||||
|
||||
} // namespace blender
|
||||
245
blender-5.2.0/source/blender/makesdna/DNA_scene_enums.h
Normal file
245
blender-5.2.0/source/blender/makesdna/DNA_scene_enums.h
Normal file
@@ -0,0 +1,245 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** #ToolSettings.vgroupsubset */
|
||||
enum eVGroupSelect : char {
|
||||
WT_VGROUP_ALL = 0,
|
||||
WT_VGROUP_ACTIVE = 1,
|
||||
WT_VGROUP_BONE_SELECT = 2,
|
||||
WT_VGROUP_BONE_DEFORM = 3,
|
||||
WT_VGROUP_BONE_DEFORM_OFF = 4,
|
||||
};
|
||||
|
||||
#define WT_VGROUP_MASK_ALL \
|
||||
((1 << WT_VGROUP_ACTIVE) | (1 << WT_VGROUP_BONE_SELECT) | (1 << WT_VGROUP_BONE_DEFORM) | \
|
||||
(1 << WT_VGROUP_BONE_DEFORM_OFF) | (1 << WT_VGROUP_ALL))
|
||||
|
||||
enum eSeqImageFitMethod : int {
|
||||
SEQ_SCALE_TO_FIT,
|
||||
SEQ_SCALE_TO_FILL,
|
||||
SEQ_STRETCH_TO_FILL,
|
||||
SEQ_USE_ORIGINAL_SIZE,
|
||||
};
|
||||
|
||||
/**
|
||||
* #Paint::symmetry_flags
|
||||
* (for now just a duplicate of sculpt symmetry flags).
|
||||
*/
|
||||
enum ePaintSymmetryFlags : int {
|
||||
PAINT_SYMM_NONE = 0,
|
||||
PAINT_SYMM_X = (1 << 0),
|
||||
PAINT_SYMM_Y = (1 << 1),
|
||||
PAINT_SYMM_Z = (1 << 2),
|
||||
PAINT_SYMMETRY_FEATHER = (1 << 3),
|
||||
PAINT_TILE_X = (1 << 4),
|
||||
PAINT_TILE_Y = (1 << 5),
|
||||
PAINT_TILE_Z = (1 << 6),
|
||||
};
|
||||
ENUM_OPERATORS(ePaintSymmetryFlags);
|
||||
#define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)
|
||||
|
||||
#ifdef __cplusplus
|
||||
inline ePaintSymmetryFlags operator++(ePaintSymmetryFlags &flags, int)
|
||||
{
|
||||
flags = ePaintSymmetryFlags(char(flags) + 1);
|
||||
return flags;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** #UnifiedPaintSettings::flag */
|
||||
enum eUnifiedPaintSettingsFlags : int {
|
||||
UNIFIED_PAINT_SIZE = (1 << 0),
|
||||
UNIFIED_PAINT_ALPHA = (1 << 1),
|
||||
/** Only used if unified size is enabled, mirrors the brush flag #BRUSH_LOCK_SIZE. */
|
||||
UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
|
||||
UNIFIED_PAINT_FLAG_UNUSED_0 = (1 << 3),
|
||||
UNIFIED_PAINT_FLAG_UNUSED_1 = (1 << 4),
|
||||
UNIFIED_PAINT_WEIGHT = (1 << 5),
|
||||
UNIFIED_PAINT_COLOR = (1 << 6),
|
||||
UNIFIED_PAINT_INPUT_SAMPLES = (1 << 7),
|
||||
UNIFIED_PAINT_COLOR_JITTER = (1 << 8),
|
||||
};
|
||||
ENUM_OPERATORS(eUnifiedPaintSettingsFlags)
|
||||
|
||||
/** Paint::curve_visibility_flag */
|
||||
enum PaintCurveVisibilityFlags : int {
|
||||
PAINT_CURVE_SHOW_STRENGTH = (1 << 0),
|
||||
PAINT_CURVE_SHOW_SIZE = (1 << 1),
|
||||
PAINT_CURVE_SHOW_JITTER = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(PaintCurveVisibilityFlags)
|
||||
|
||||
/** #SceneRenderLayer::passflag */
|
||||
enum eScenePassType : uint32_t {
|
||||
SCE_PASS_COMBINED = (1 << 0),
|
||||
SCE_PASS_DEPTH = (1 << 1),
|
||||
SCE_PASS_UNUSED_1 = (1 << 2), /* RGBA */
|
||||
SCE_PASS_UNUSED_2 = (1 << 3), /* DIFFUSE */
|
||||
SCE_PASS_UNUSED_3 = (1 << 4), /* SPEC */
|
||||
SCE_PASS_SHADOW = (1 << 5),
|
||||
SCE_PASS_AO = (1 << 6),
|
||||
SCE_PASS_POSITION = (1 << 7),
|
||||
SCE_PASS_NORMAL = (1 << 8),
|
||||
SCE_PASS_VECTOR = (1 << 9),
|
||||
SCE_PASS_UNUSED_5 = (1 << 10), /* REFRACT */
|
||||
SCE_PASS_INDEXOB = (1 << 11),
|
||||
SCE_PASS_UV = (1 << 12),
|
||||
SCE_PASS_UNUSED_6 = (1 << 13), /* INDIRECT */
|
||||
SCE_PASS_MIST = (1 << 14),
|
||||
SCE_PASS_UNUSED_7 = (1 << 15), /* RAYHITS */
|
||||
SCE_PASS_EMIT = (1 << 16),
|
||||
SCE_PASS_ENVIRONMENT = (1 << 17),
|
||||
SCE_PASS_INDEXMA = (1 << 18),
|
||||
SCE_PASS_DIFFUSE_DIRECT = (1 << 19),
|
||||
SCE_PASS_DIFFUSE_INDIRECT = (1 << 20),
|
||||
SCE_PASS_DIFFUSE_COLOR = (1 << 21),
|
||||
SCE_PASS_GLOSSY_DIRECT = (1 << 22),
|
||||
SCE_PASS_GLOSSY_INDIRECT = (1 << 23),
|
||||
SCE_PASS_GLOSSY_COLOR = (1 << 24),
|
||||
SCE_PASS_TRANSM_DIRECT = (1 << 25),
|
||||
SCE_PASS_TRANSM_INDIRECT = (1 << 26),
|
||||
SCE_PASS_TRANSM_COLOR = (1 << 27),
|
||||
SCE_PASS_SUBSURFACE_DIRECT = (1 << 28),
|
||||
SCE_PASS_SUBSURFACE_INDIRECT = (1 << 29),
|
||||
SCE_PASS_SUBSURFACE_COLOR = (1 << 30),
|
||||
SCE_PASS_ROUGHNESS = (1u << 31u),
|
||||
};
|
||||
ENUM_OPERATORS(eScenePassType)
|
||||
|
||||
#define RE_PASSNAME_DEPRECATED "Deprecated"
|
||||
|
||||
#define RE_PASSNAME_COMBINED "Combined"
|
||||
#define RE_PASSNAME_DEPTH "Depth"
|
||||
#define RE_PASSNAME_VECTOR "Vector"
|
||||
#define RE_PASSNAME_POSITION "Position"
|
||||
#define RE_PASSNAME_NORMAL "Normal"
|
||||
#define RE_PASSNAME_UV "UV"
|
||||
#define RE_PASSNAME_EMIT "Emission"
|
||||
#define RE_PASSNAME_SHADOW "Shadow"
|
||||
|
||||
#define RE_PASSNAME_AO "Ambient Occlusion"
|
||||
#define RE_PASSNAME_ENVIRONMENT "Environment"
|
||||
#define RE_PASSNAME_INDEXOB "Object Index"
|
||||
#define RE_PASSNAME_INDEXMA "Material Index"
|
||||
#define RE_PASSNAME_MIST "Mist"
|
||||
|
||||
#define RE_PASSNAME_DIFFUSE_DIRECT "Diffuse Direct"
|
||||
#define RE_PASSNAME_DIFFUSE_INDIRECT "Diffuse Indirect"
|
||||
#define RE_PASSNAME_DIFFUSE_COLOR "Diffuse Color"
|
||||
#define RE_PASSNAME_GLOSSY_DIRECT "Glossy Direct"
|
||||
#define RE_PASSNAME_GLOSSY_INDIRECT "Glossy Indirect"
|
||||
#define RE_PASSNAME_GLOSSY_COLOR "Glossy Color"
|
||||
#define RE_PASSNAME_TRANSM_DIRECT "Transmission Direct"
|
||||
#define RE_PASSNAME_TRANSM_INDIRECT "Transmission Indirect"
|
||||
#define RE_PASSNAME_TRANSM_COLOR "Transmission Color"
|
||||
|
||||
#define RE_PASSNAME_SUBSURFACE_DIRECT "Subsurface Direct"
|
||||
#define RE_PASSNAME_SUBSURFACE_INDIRECT "Subsurface Indirect"
|
||||
#define RE_PASSNAME_SUBSURFACE_COLOR "Subsurface Color"
|
||||
|
||||
#define RE_PASSNAME_FREESTYLE "Freestyle"
|
||||
#define RE_PASSNAME_VOLUME_LIGHT "Volume Direct"
|
||||
#define RE_PASSNAME_TRANSPARENT "Transparent"
|
||||
|
||||
#define RE_PASSNAME_CRYPTOMATTE_OBJECT "CryptoObject"
|
||||
#define RE_PASSNAME_CRYPTOMATTE_ASSET "CryptoAsset"
|
||||
#define RE_PASSNAME_CRYPTOMATTE_MATERIAL "CryptoMaterial"
|
||||
|
||||
#define RE_PASSNAME_GREASE_PENCIL "Grease Pencil"
|
||||
|
||||
/** #SceneRenderLayer::layflag */
|
||||
enum eSceneLayer_Flag : int {
|
||||
SCE_LAY_SOLID = 1 << 0,
|
||||
SCE_LAY_UNUSED_1 = 1 << 1,
|
||||
SCE_LAY_UNUSED_2 = 1 << 2,
|
||||
SCE_LAY_UNUSED_3 = 1 << 3,
|
||||
SCE_LAY_SKY = 1 << 4,
|
||||
SCE_LAY_STRAND = 1 << 5,
|
||||
SCE_LAY_FRS = 1 << 6,
|
||||
SCE_LAY_AO = 1 << 7,
|
||||
SCE_LAY_VOLUMES = 1 << 8,
|
||||
SCE_LAY_MOTION_BLUR = 1 << 9,
|
||||
SCE_LAY_GREASE_PENCIL = 1 << 10,
|
||||
|
||||
/* Flags between (1 << 9) and (1 << 15) are set to 1 already, for future options. */
|
||||
|
||||
SCE_LAY_FLAG_DEFAULT = ((1 << 15) - 1),
|
||||
|
||||
SCE_LAY_UNUSED_4 = 1 << 15,
|
||||
SCE_LAY_UNUSED_5 = 1 << 16,
|
||||
SCE_LAY_DISABLE = 1 << 17,
|
||||
SCE_LAY_UNUSED_6 = 1 << 18,
|
||||
SCE_LAY_UNUSED_7 = 1 << 19,
|
||||
};
|
||||
ENUM_OPERATORS(eSceneLayer_Flag)
|
||||
|
||||
/** #SceneRenderView::viewflag */
|
||||
enum eSceneView_Flag : int {
|
||||
SCE_VIEW_DISABLE = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(eSceneView_Flag)
|
||||
|
||||
/** #RenderData::views_format */
|
||||
enum eSceneViews_Format : char {
|
||||
SCE_VIEWS_FORMAT_STEREO_3D = 0,
|
||||
SCE_VIEWS_FORMAT_MULTIVIEW = 1,
|
||||
};
|
||||
|
||||
/** #ImageFormatData::views_format (also used for #Strip::views_format). */
|
||||
enum eImageFormat_ViewsFormat : char {
|
||||
R_IMF_VIEWS_INDIVIDUAL = 0,
|
||||
R_IMF_VIEWS_STEREO_3D = 1,
|
||||
R_IMF_VIEWS_MULTIVIEW = 2,
|
||||
};
|
||||
|
||||
/** #Stereo3dFormat::display_mode */
|
||||
enum eStereoDisplayMode : char {
|
||||
S3D_DISPLAY_ANAGLYPH = 0,
|
||||
S3D_DISPLAY_INTERLACE = 1,
|
||||
S3D_DISPLAY_PAGEFLIP = 2,
|
||||
S3D_DISPLAY_SIDEBYSIDE = 3,
|
||||
S3D_DISPLAY_TOPBOTTOM = 4,
|
||||
};
|
||||
|
||||
/** #Stereo3dFormat::flag */
|
||||
enum eStereo3dFlag : short {
|
||||
S3D_INTERLACE_SWAP = (1 << 0),
|
||||
S3D_SIDEBYSIDE_CROSSEYED = (1 << 1),
|
||||
S3D_SQUEEZED_FRAME = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eStereo3dFlag)
|
||||
|
||||
/** #Stereo3dFormat::anaglyph_type */
|
||||
enum eStereo3dAnaglyphType : char {
|
||||
S3D_ANAGLYPH_REDCYAN = 0,
|
||||
S3D_ANAGLYPH_GREENMAGENTA = 1,
|
||||
S3D_ANAGLYPH_YELLOWBLUE = 2,
|
||||
};
|
||||
|
||||
/** #Stereo3dFormat::interlace_type */
|
||||
enum eStereo3dInterlaceType : char {
|
||||
S3D_INTERLACE_ROW = 0,
|
||||
S3D_INTERLACE_COLUMN = 1,
|
||||
S3D_INTERLACE_CHECKERBOARD = 2,
|
||||
};
|
||||
|
||||
/** #View3D::stereo3d_camera / #View3D::multiview_eye / #ImageUser::multiview_eye */
|
||||
enum eStereoViews : char {
|
||||
STEREO_LEFT_ID = 0,
|
||||
STEREO_RIGHT_ID = 1,
|
||||
STEREO_3D_ID = 2,
|
||||
STEREO_MONO_ID = 3,
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
3000
blender-5.2.0/source/blender/makesdna/DNA_scene_types.h
Normal file
3000
blender-5.2.0/source/blender/makesdna/DNA_scene_types.h
Normal file
File diff suppressed because it is too large
Load Diff
955
blender-5.2.0/source/blender/makesdna/DNA_screen_types.h
Normal file
955
blender-5.2.0/source/blender/makesdna/DNA_screen_types.h
Normal file
@@ -0,0 +1,955 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_asset_types.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_vec_types.h"
|
||||
#include "DNA_view2d_types.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct ARegion;
|
||||
struct ARegionType;
|
||||
struct PanelType;
|
||||
struct PointerRNA;
|
||||
struct Scene;
|
||||
struct SpaceLink;
|
||||
struct SpaceType;
|
||||
struct uiList;
|
||||
struct uiListType;
|
||||
struct wmDrawBuffer;
|
||||
struct wmTimer;
|
||||
struct wmTooltipState;
|
||||
struct Panel_Runtime;
|
||||
namespace bke {
|
||||
struct ARegionRuntime;
|
||||
struct FileHandlerType;
|
||||
} // namespace bke
|
||||
namespace ui {
|
||||
struct Layout;
|
||||
} // namespace ui
|
||||
|
||||
/** #bScreen.flag */
|
||||
enum eScreen_Flag : short {
|
||||
SCREEN_DEPRECATED = 1,
|
||||
SCREEN_COLLAPSE_STATUSBAR = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eScreen_Flag)
|
||||
|
||||
/** #bScreen.state */
|
||||
enum eScreen_State : char {
|
||||
SCREENNORMAL = 0,
|
||||
/** One editor taking over the screen. */
|
||||
SCREENMAXIMIZED = 1,
|
||||
/**
|
||||
* One editor taking over the screen with no bare-minimum UI elements.
|
||||
*
|
||||
* Besides making the area full-screen this disables navigation & statistics because
|
||||
* this is part of a stereo 3D pipeline where these elements would interfere, see: !142418.
|
||||
*/
|
||||
SCREENFULL = 2,
|
||||
};
|
||||
|
||||
/** #bScreen.fullscreen_flag */
|
||||
enum eScreen_Fullscreen_Flag : short {
|
||||
FULLSCREEN_RESTORE_GIZMO_NAVIGATE = (1 << 0),
|
||||
FULLSCREEN_RESTORE_TEXT = (1 << 1),
|
||||
FULLSCREEN_RESTORE_STATS = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eScreen_Fullscreen_Flag)
|
||||
|
||||
/** #bScreen.redraws_flag */
|
||||
enum eScreen_Redraws_Flag : short {
|
||||
TIME_REGION = (1 << 0),
|
||||
TIME_ALL_3D_WIN = (1 << 1),
|
||||
TIME_ALL_ANIM_WIN = (1 << 2),
|
||||
TIME_ALL_BUTS_WIN = (1 << 3),
|
||||
// TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
|
||||
TIME_SEQ = (1 << 5),
|
||||
TIME_ALL_IMAGE_WIN = (1 << 6),
|
||||
// TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
|
||||
TIME_NODES = (1 << 8),
|
||||
TIME_CLIPS = (1 << 9),
|
||||
TIME_SPREADSHEETS = (1 << 10),
|
||||
|
||||
TIME_FOLLOW = static_cast<short>(1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eScreen_Redraws_Flag)
|
||||
|
||||
/* TODO: Doing this is quite ugly :)
|
||||
* Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */
|
||||
#define AREAMAP_FROM_SCREEN(screen) ((ScrAreaMap *)&(screen)->vertbase)
|
||||
|
||||
struct bScreen {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_SCR;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
/* TODO: Should become ScrAreaMap now.
|
||||
* NOTE: KEEP ORDER IN SYNC WITH #ScrAreaMap! (see AREAMAP_FROM_SCREEN macro above). */
|
||||
/** Screens have vertices/edges to define areas. */
|
||||
ListBaseT<struct ScrVert> vertbase = {nullptr, nullptr};
|
||||
ListBaseT<struct ScrEdge> edgebase = {nullptr, nullptr};
|
||||
ListBaseT<struct ScrArea> areabase = {nullptr, nullptr};
|
||||
/* End variables that must be in sync with #ScrAreaMap. */
|
||||
|
||||
/** Screen level regions (menus), runtime only. */
|
||||
ListBaseT<ARegion> regionbase = {nullptr, nullptr};
|
||||
|
||||
DNA_DEPRECATED struct Scene *scene = nullptr;
|
||||
|
||||
/** General flags. */
|
||||
eScreen_Flag flag = {};
|
||||
/** Window-ID from WM, starts with 1. */
|
||||
short winid = 0;
|
||||
/** User-setting for which editors get redrawn during animation playback. */
|
||||
eScreen_Redraws_Flag redraws_flag = {};
|
||||
|
||||
/** Temp screen in a temp window, don't save (like user-preferences). */
|
||||
char temp = 0;
|
||||
/** Temp screen for image render display or file-select. */
|
||||
eScreen_State state = SCREENNORMAL;
|
||||
/** Notifier for drawing edges. */
|
||||
char do_draw = 0;
|
||||
/** Notifier for scale screen, changed screen, etc. */
|
||||
char do_refresh = 0;
|
||||
/** Notifier for gesture draw. */
|
||||
char do_draw_gesture = 0;
|
||||
/** Notifier for paint cursor draw. */
|
||||
char do_draw_paintcursor = 0;
|
||||
/** Notifier for dragging draw. */
|
||||
char do_draw_drag = 0;
|
||||
/** Set to delay screen handling after switching back from maximized area. */
|
||||
char skip_handling = 0;
|
||||
/** Set when scrubbing to avoid some costly updates. */
|
||||
char scrubbing = 0;
|
||||
char _pad[1] = {};
|
||||
|
||||
/** Active region that has mouse focus. */
|
||||
struct ARegion *active_region = nullptr;
|
||||
|
||||
/** If set, screen has timer handler added in window. */
|
||||
struct wmTimer *animtimer = nullptr;
|
||||
/** Context callback. */
|
||||
void /*bContextDataCallback*/ *context = nullptr;
|
||||
|
||||
/* Used to restore after SCREENFULL state. */
|
||||
eScreen_Fullscreen_Flag fullscreen_flag = {};
|
||||
char _pad2[6] = {};
|
||||
|
||||
/** Runtime. */
|
||||
struct wmTooltipState *tool_tip = nullptr;
|
||||
|
||||
PreviewImage *preview = nullptr;
|
||||
};
|
||||
|
||||
struct ScrVert {
|
||||
struct ScrVert *next = nullptr, *prev = nullptr, *newv = nullptr;
|
||||
vec2s vec = {};
|
||||
/* first one used internally, second one for tools */
|
||||
short flag = 0, editflag = 0;
|
||||
};
|
||||
|
||||
struct ScrEdge {
|
||||
struct ScrEdge *next = nullptr, *prev = nullptr;
|
||||
ScrVert *v1 = nullptr, *v2 = nullptr;
|
||||
/** 1 when at edge of screen. */
|
||||
short border = 0;
|
||||
short flag = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct ScrAreaMap {
|
||||
/* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
|
||||
|
||||
/** Screens have vertices/edges to define areas. */
|
||||
ListBaseT<ScrVert> vertbase = {nullptr, nullptr};
|
||||
ListBaseT<ScrEdge> edgebase = {nullptr, nullptr};
|
||||
ListBaseT<ScrArea> areabase = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
enum LayoutPanelStateFlag : uchar {
|
||||
/** If set, the panel is currently open. Otherwise it is collapsed. */
|
||||
LAYOUT_PANEL_STATE_FLAG_OPEN = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(LayoutPanelStateFlag)
|
||||
|
||||
/**
|
||||
* Used for passing expansion between instanced panel data and the panels themselves.
|
||||
* There are 16 defines because the expansion data is typically stored in a short.
|
||||
*
|
||||
* \note Expansion for instanced panels is stored in depth first order. For example, the value of
|
||||
* UI_SUBPANEL_DATA_EXPAND_2 correspond to mean the expansion of the second sub-panel or the first
|
||||
* sub-panel's first sub-panel.
|
||||
*/
|
||||
enum uiPanelDataExpansion : ushort {
|
||||
UI_PANEL_DATA_EXPAND_ROOT = (1 << 0),
|
||||
UI_SUBPANEL_DATA_EXPAND_1 = (1 << 1),
|
||||
UI_SUBPANEL_DATA_EXPAND_2 = (1 << 2),
|
||||
UI_SUBPANEL_DATA_EXPAND_3 = (1 << 3),
|
||||
UI_SUBPANEL_DATA_EXPAND_4 = (1 << 4),
|
||||
UI_SUBPANEL_DATA_EXPAND_5 = (1 << 5),
|
||||
UI_SUBPANEL_DATA_EXPAND_6 = (1 << 6),
|
||||
UI_SUBPANEL_DATA_EXPAND_7 = (1 << 7),
|
||||
UI_SUBPANEL_DATA_EXPAND_8 = (1 << 8),
|
||||
UI_SUBPANEL_DATA_EXPAND_9 = (1 << 9),
|
||||
UI_SUBPANEL_DATA_EXPAND_10 = (1 << 10),
|
||||
UI_SUBPANEL_DATA_EXPAND_11 = (1 << 11),
|
||||
UI_SUBPANEL_DATA_EXPAND_12 = (1 << 12),
|
||||
UI_SUBPANEL_DATA_EXPAND_13 = (1 << 13),
|
||||
UI_SUBPANEL_DATA_EXPAND_14 = (1 << 14),
|
||||
UI_SUBPANEL_DATA_EXPAND_15 = (1 << 15),
|
||||
};
|
||||
ENUM_OPERATORS(uiPanelDataExpansion)
|
||||
|
||||
/** #Panel.flag */
|
||||
enum ePanel_Flag : short {
|
||||
PNL_SELECT = (1 << 0),
|
||||
PNL_UNUSED_1 = (1 << 1), /* Cleared */
|
||||
PNL_CLOSED = (1 << 2),
|
||||
// PNL_TABBED = (1 << 3), /* UNUSED */
|
||||
// PNL_OVERLAP = (1 << 4), /* UNUSED */
|
||||
PNL_PIN = (1 << 5),
|
||||
PNL_POPOVER = (1 << 6),
|
||||
/** The panel has been drag-drop reordered and the instanced panel list needs to be rebuilt. */
|
||||
PNL_INSTANCED_LIST_ORDER_CHANGED = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(ePanel_Flag)
|
||||
|
||||
/** Fallback panel category (only for old scripts which need updating). */
|
||||
#define PNL_CATEGORY_FALLBACK "Misc"
|
||||
|
||||
struct LayoutPanelState {
|
||||
struct LayoutPanelState *next = nullptr, *prev = nullptr;
|
||||
/** Identifier of the panel. */
|
||||
char *idname = nullptr;
|
||||
LayoutPanelStateFlag flag = {};
|
||||
char _pad[3] = {};
|
||||
/**
|
||||
* A logical time set from #layout_panel_states_clock when the panel is used by the UI. This is
|
||||
* used to detect the least-recently-used panel states when some panel states should be removed.
|
||||
*/
|
||||
uint32_t last_used = 0;
|
||||
};
|
||||
|
||||
struct Panel {
|
||||
struct Panel *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Runtime. */
|
||||
struct PanelType *type = nullptr;
|
||||
/** Runtime for drawing. */
|
||||
ui::Layout *layout = nullptr;
|
||||
|
||||
char panelname[/*BKE_ST_MAXNAME*/ 64] = "";
|
||||
/** Panel name is identifier for restoring location. */
|
||||
char *drawname = nullptr;
|
||||
/** Offset within the region. */
|
||||
int ofsx = 0, ofsy = 0;
|
||||
/** Panel size including children. */
|
||||
int sizex = 0, sizey = 0;
|
||||
/** Panel size excluding children. */
|
||||
int blocksizex = 0, blocksizey = 0;
|
||||
short labelofs = 0;
|
||||
ePanel_Flag flag = {};
|
||||
short runtime_flag = 0;
|
||||
char _pad[6] = {};
|
||||
/** Panels are aligned according to increasing sort-order. */
|
||||
int sortorder = 0;
|
||||
/** Runtime for panel manipulation. */
|
||||
void *activedata = nullptr;
|
||||
/** Sub panels. */
|
||||
ListBaseT<Panel> children = {nullptr, nullptr};
|
||||
|
||||
/**
|
||||
* This stores the open-close-state of layout-panels created with
|
||||
* `layout.panel(...)` in Python. For more information on layout-panels, see
|
||||
* `ui::Layout::panel_prop`.
|
||||
*/
|
||||
ListBaseT<LayoutPanelState> layout_panel_states = {nullptr, nullptr};
|
||||
/**
|
||||
* This is increased whenever a layout panel state is used by the UI. This is used to allow for
|
||||
* some garbage collection of panel states when #layout_panel_states becomes large. It works by
|
||||
* removing all least-recently-used panel states up to a certain threshold.
|
||||
*/
|
||||
uint32_t layout_panel_states_clock = 0;
|
||||
char _pad2[4] = {};
|
||||
|
||||
struct Panel_Runtime *runtime = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Notes on Panel Categories:
|
||||
*
|
||||
* - #ARegion.panels_category (#PanelCategoryDyn)
|
||||
* is a runtime only list of categories collected during draw.
|
||||
*
|
||||
* - #ARegion.panels_category_active (#PanelCategoryStack)
|
||||
* is basically a list of strings (category id's).
|
||||
*
|
||||
* Clicking on a tab moves it to the front of region->panels_category_active,
|
||||
* If the context changes so this tab is no longer displayed,
|
||||
* then the first-most tab in #ARegion.panels_category_active is used.
|
||||
*
|
||||
* This way you can change modes and always have the tab you last clicked on.
|
||||
*/
|
||||
|
||||
/* region level tabs */
|
||||
#
|
||||
#
|
||||
struct PanelCategoryDyn {
|
||||
struct PanelCategoryDyn *next = nullptr, *prev = nullptr;
|
||||
char idname[64] = "";
|
||||
int icon = 0;
|
||||
};
|
||||
|
||||
/** Region stack of active tabs. */
|
||||
struct PanelCategoryStack {
|
||||
struct PanelCategoryStack *next = nullptr, *prev = nullptr;
|
||||
char idname[64] = "";
|
||||
};
|
||||
|
||||
/** #uiList.layout_type */
|
||||
enum euiList_LayoutType : int {
|
||||
UILST_LAYOUT_DEFAULT = 0,
|
||||
UILST_LAYOUT_COMPACT = 1,
|
||||
};
|
||||
|
||||
/** #uiList.flag */
|
||||
enum euiList_Flag : int {
|
||||
/** Scroll list to make active item visible. */
|
||||
UILST_SCROLL_TO_ACTIVE_ITEM = 1 << 0,
|
||||
};
|
||||
ENUM_OPERATORS(euiList_Flag)
|
||||
|
||||
/** Value (in number of items) we have to go below minimum shown items to enable auto size. */
|
||||
#define UI_LIST_AUTO_SIZE_THRESHOLD 1
|
||||
|
||||
/** uiList filter flags (dyn_data)
|
||||
*
|
||||
* \warning Lower 16 bits are meant for custom use in Python, don't use them here! Only use the
|
||||
* higher 16 bits.
|
||||
* \warning Those values are used by integer RNA too, which does not handle well values > INT_MAX.
|
||||
* So please do not use 32nd bit here.
|
||||
*/
|
||||
enum euiList_Filter : int {
|
||||
/* Don't use (1 << 0) to (1 << 15) here! See warning above. */
|
||||
|
||||
/* Filtering returned #UI_LIST_ITEM_NEVER_SHOW. */
|
||||
UILST_FLT_ITEM_NEVER_SHOW = (1 << 16),
|
||||
UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
|
||||
};
|
||||
ENUM_OPERATORS(euiList_Filter)
|
||||
|
||||
/** #uiList.filter_flag */
|
||||
enum euiList_FilterFlag : int {
|
||||
UILST_FLT_SHOW = 1 << 0, /* Show filtering UI. */
|
||||
UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */
|
||||
};
|
||||
ENUM_OPERATORS(euiList_FilterFlag)
|
||||
|
||||
/** #uiList.filter_sort_flag */
|
||||
enum euiList_FilterSortFlag : int {
|
||||
/* Plain values (only one is valid at a time, once masked with UILST_FLT_SORT_MASK). */
|
||||
/** Just for sake of consistency. */
|
||||
/* UILST_FLT_SORT_INDEX = 0, */ /* UNUSED */
|
||||
UILST_FLT_SORT_ALPHA = 1,
|
||||
|
||||
/* Bitflags affecting behavior of any kind of sorting. */
|
||||
/** Special flag to indicate that order is locked (not user-changeable). */
|
||||
UILST_FLT_SORT_LOCK = int(1u << 30),
|
||||
/** Special value, bit-flag used to reverse order! */
|
||||
UILST_FLT_SORT_REVERSE = int(1u << 31),
|
||||
};
|
||||
ENUM_OPERATORS(euiList_FilterSortFlag)
|
||||
|
||||
#define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1)
|
||||
|
||||
typedef void (*uiListFreeRuntimeDataFunc)(struct uiList *ui_list);
|
||||
|
||||
/* uiList dynamic data... */
|
||||
/* These two lines with # tell `makesdna` this struct can be excluded. */
|
||||
#
|
||||
#
|
||||
struct uiListDyn {
|
||||
/** Callback to free UI data when freeing UI-Lists in BKE. */
|
||||
uiListFreeRuntimeDataFunc free_runtime_data_fn = {};
|
||||
|
||||
/** Number of rows needed to draw all elements. */
|
||||
int height = 0;
|
||||
/** Actual visual height of the list (in rows). */
|
||||
int visual_height = 0;
|
||||
/** Minimal visual height of the list (in rows). */
|
||||
int visual_height_min = 0;
|
||||
|
||||
/** Number of items in collection. */
|
||||
int items_len = 0;
|
||||
/** Number of items actually visible after filtering. */
|
||||
int items_shown = 0;
|
||||
|
||||
/* Those are temp data used during drag-resize with GRIP button
|
||||
* (they are in pixels, the meaningful data is the
|
||||
* difference between resize_prev and resize)...
|
||||
*/
|
||||
int resize = 0;
|
||||
int resize_prev = 0;
|
||||
|
||||
/** Allocated custom data. Freed together with the #uiList (and when re-assigning). */
|
||||
void *customdata = nullptr;
|
||||
|
||||
/* Filtering data. */
|
||||
/** This bit-field is effectively exposed in Python, and scripts are explicitly allowed to assign
|
||||
* any own meaning to the lower 16 ones.
|
||||
* #items_len length. */
|
||||
int *items_filter_flags = nullptr;
|
||||
/** Org_idx -> new_idx, items_len length. */
|
||||
int *items_filter_neworder = nullptr;
|
||||
|
||||
struct wmOperatorType *custom_drag_optype = nullptr;
|
||||
};
|
||||
|
||||
struct uiList { /* some list UI data need to be saved in file */
|
||||
struct uiList *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Runtime. */
|
||||
struct uiListType *type = nullptr;
|
||||
|
||||
char list_id[/*UI_MAX_NAME_STR*/ 256] = "";
|
||||
|
||||
/** How items are laid out in the list. */
|
||||
euiList_LayoutType layout_type = UILST_LAYOUT_DEFAULT;
|
||||
euiList_Flag flag = {};
|
||||
|
||||
int list_scroll = 0;
|
||||
int list_grip = 0;
|
||||
int list_last_len = 0;
|
||||
int list_last_activei = 0;
|
||||
|
||||
/* Filtering data. */
|
||||
/** Defined as . */
|
||||
char filter_byname[/*UI_MAX_NAME_STR*/ 256] = "";
|
||||
euiList_FilterFlag filter_flag = {};
|
||||
euiList_FilterSortFlag filter_sort_flag = {};
|
||||
|
||||
/** Custom sub-classes properties. */
|
||||
IDProperty *properties = nullptr;
|
||||
|
||||
/** Dynamic data (runtime). */
|
||||
uiListDyn *dyn_data = nullptr;
|
||||
};
|
||||
|
||||
enum uiViewStateFlag : uint16_t {
|
||||
UI_VIEW_SHOW_FILTER_OPTIONS = (1 << 0),
|
||||
UI_VIEW_SORT_ALPHA = (1 << 1),
|
||||
UI_VIEW_FILTER_INVERT = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(uiViewStateFlag)
|
||||
|
||||
/** See #uiViewStateLink. */
|
||||
struct uiViewState {
|
||||
/**
|
||||
* User set height of the view in unscaled pixels. A value of 0 means no custom height was set
|
||||
* and the default should be used.
|
||||
*/
|
||||
int custom_height = 0;
|
||||
/**
|
||||
* Amount of vertical scrolling. View types decide on the unit:
|
||||
* - Tree views: Number of items scrolled out of view (#scroll_offset of 5 means 5 items are
|
||||
* scrolled out of view).
|
||||
*/
|
||||
int scroll_offset = 0;
|
||||
uiViewStateFlag flag = {};
|
||||
char _pad[5] = {};
|
||||
uint8_t invert_sort_type = 0;
|
||||
char search_string[/*UI_MAX_NAME_STR*/ 256] = "";
|
||||
};
|
||||
|
||||
/**
|
||||
* Persistent storage for some state of views (#ui::AbstractView), for storage in a region. The
|
||||
* view state is matched to the view using the view's idname.
|
||||
*
|
||||
* The actual state is stored in #uiViewState, so views can manage this conveniently without having
|
||||
* to care about the idname and listbase pointers themselves.
|
||||
*/
|
||||
struct uiViewStateLink {
|
||||
struct uiViewStateLink *next = nullptr, *prev = nullptr;
|
||||
|
||||
char idname[/*BKE_ST_MAXNAME*/ 64] = "";
|
||||
|
||||
uiViewState state;
|
||||
};
|
||||
|
||||
struct TransformOrientation {
|
||||
struct TransformOrientation *next = nullptr, *prev = nullptr;
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
float mat[3][3] = {};
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
enum uiPreviewTag : short {
|
||||
/** Preview needs re-rendering, handled in #ED_preview_draw(). */
|
||||
UI_PREVIEW_TAG_DIRTY = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(uiPreviewTag)
|
||||
|
||||
/** Some preview UI data need to be saved in file. */
|
||||
struct uiPreview {
|
||||
struct uiPreview *next = nullptr, *prev = nullptr;
|
||||
|
||||
char preview_id[/*BKE_ST_MAXNAME*/ 64] = "";
|
||||
short height = 0;
|
||||
|
||||
/* Unset on file read. */
|
||||
uiPreviewTag tag = {};
|
||||
|
||||
/** #ID.session_uid of the ID this preview is made for. Unset on file read. */
|
||||
unsigned int id_session_uid = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* State storage for text-boxes (#ui::ButtonTextBox).
|
||||
*/
|
||||
struct TextboxState {
|
||||
int visible_lines = 3;
|
||||
int scroll = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Persistent storage for text-boxes (#ui::ButtonTextBox) in a region. The state is matched to the
|
||||
* textbox buttons using the RNA struct identifier + property name.
|
||||
*
|
||||
* The actual state is stored in #uiTextboxState, so textbox buttons can manage this conveniently
|
||||
* without having to care about the idname and listbase pointers themselves.
|
||||
*/
|
||||
struct uiTextboxStateLink {
|
||||
struct uiTextboxStateLink *next = nullptr, *prev = nullptr;
|
||||
char *idname = nullptr;
|
||||
TextboxState state;
|
||||
};
|
||||
|
||||
enum GlobalAreaFlag : short {
|
||||
GLOBAL_AREA_IS_HIDDEN = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(GlobalAreaFlag)
|
||||
|
||||
enum GlobalAreaAlign : short {
|
||||
GLOBAL_AREA_ALIGN_TOP = 0,
|
||||
GLOBAL_AREA_ALIGN_BOTTOM = 1,
|
||||
};
|
||||
|
||||
struct ScrGlobalAreaData {
|
||||
/**
|
||||
* Global areas have a non-dynamic size. That means, changing the window size doesn't
|
||||
* affect their size at all. However, they can still be 'collapsed', by changing this value.
|
||||
* Ignores DPI (#ED_area_global_size_y and winx/winy don't).
|
||||
*/
|
||||
short cur_fixed_height = 0;
|
||||
/**
|
||||
* For global areas, this is the min and max size they can use depending on
|
||||
* if they are 'collapsed' or not.
|
||||
*/
|
||||
short size_min = 0, size_max = 0;
|
||||
GlobalAreaAlign align = GLOBAL_AREA_ALIGN_TOP;
|
||||
|
||||
GlobalAreaFlag flag = {};
|
||||
char _pad[2] = {};
|
||||
};
|
||||
|
||||
/** #ScrArea.flag */
|
||||
enum eScrArea_Flag : short {
|
||||
HEADER_NO_PULLDOWN = (1 << 0),
|
||||
// AREA_FLAG_UNUSED_1 = (1 << 1),
|
||||
// AREA_FLAG_UNUSED_2 = (1 << 2),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
|
||||
#endif
|
||||
/** Update size of regions within the area. */
|
||||
AREA_FLAG_REGION_SIZE_UPDATE = (1 << 3),
|
||||
AREA_FLAG_ACTIVE_TOOL_UPDATE = (1 << 4),
|
||||
// AREA_FLAG_UNUSED_5 = (1 << 5),
|
||||
|
||||
AREA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
|
||||
|
||||
/**
|
||||
* For temporary full-screens (file browser, image editor render)
|
||||
* that are opened above user set full-screens.
|
||||
*/
|
||||
AREA_FLAG_STACKED_FULLSCREEN = (1 << 7),
|
||||
/** Update action zones (even if the mouse is not intersecting them). */
|
||||
AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8),
|
||||
/** For off-screen areas. */
|
||||
AREA_FLAG_OFFSCREEN = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(eScrArea_Flag)
|
||||
|
||||
#define AREAGRID 1
|
||||
#define AREAMINX 29
|
||||
#define HEADER_PADDING_Y 6
|
||||
#define HEADERY (20 + HEADER_PADDING_Y)
|
||||
|
||||
struct ScrArea_Runtime {
|
||||
struct bToolRef *tool = nullptr;
|
||||
char is_tool_set = 0;
|
||||
char _pad0[7] = {};
|
||||
};
|
||||
|
||||
struct ScrArea {
|
||||
DNA_DEFINE_CXX_METHODS(ScrArea)
|
||||
|
||||
struct ScrArea *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Ordered (bottom-left, top-left, top-right, bottom-right). */
|
||||
ScrVert *v1 = nullptr, *v2 = nullptr, *v3 = nullptr, *v4 = nullptr;
|
||||
/** If area==full, this is the parent. */
|
||||
bScreen *full = nullptr;
|
||||
|
||||
/** Rect bound by v1 v2 v3 v4. */
|
||||
rcti totrct = {};
|
||||
|
||||
/** eSpace_Type (SPACE_FOO). */
|
||||
char spacetype = 0;
|
||||
/**
|
||||
* eSpace_Type (SPACE_FOO).
|
||||
*
|
||||
* Temporarily used while switching area type, otherwise this should be SPACE_EMPTY.
|
||||
* Also, versioning uses it to nicely replace deprecated editors.
|
||||
* It's been there for ages, name doesn't fit any more.
|
||||
*/
|
||||
char butspacetype = 0;
|
||||
short butspacetype_subtype = 0;
|
||||
|
||||
/** Size. */
|
||||
short winx = 0, winy = 0;
|
||||
|
||||
/** OLD! 0=no header, 1= down, 2= up. */
|
||||
DNA_DEPRECATED char headertype = 0;
|
||||
/** Private, for spacetype refresh callback. */
|
||||
char do_refresh = 0;
|
||||
eScrArea_Flag flag = {};
|
||||
/**
|
||||
* Index of last used region of 'RGN_TYPE_WINDOW'
|
||||
* runtime variable, updated by executing operators.
|
||||
*/
|
||||
short region_active_win = 0;
|
||||
char _pad[2] = {};
|
||||
|
||||
/** Callbacks for this space type. */
|
||||
struct SpaceType *type = nullptr;
|
||||
|
||||
/** Non-NULL if this area is global. */
|
||||
ScrGlobalAreaData *global = nullptr;
|
||||
|
||||
float quadview_ratio[2] = {};
|
||||
|
||||
/**
|
||||
* A list of space links (editors) that were open in this area before. When
|
||||
* changing the editor type, we try to reuse old editor data from this list.
|
||||
* The first item is the active/visible one.
|
||||
*/
|
||||
ListBaseT<SpaceLink> spacedata = {nullptr, nullptr};
|
||||
/**
|
||||
* \note This region list is the one from the active/visible editor (first item in
|
||||
* spacedata list). Use SpaceLink.regionbase if it's inactive (but only then)!
|
||||
*/
|
||||
ListBaseT<ARegion> regionbase = {nullptr, nullptr};
|
||||
ListBaseT<struct wmEventHandler> handlers = {nullptr, nullptr};
|
||||
|
||||
ListBaseT<struct AZone> actionzones = {nullptr, nullptr};
|
||||
|
||||
ScrArea_Runtime runtime;
|
||||
};
|
||||
|
||||
/**
|
||||
* regiontype, first two are the default set.
|
||||
* \warning Do NOT change order, append on end. Types are hard-coded needed.
|
||||
*/
|
||||
enum eRegion_Type : short {
|
||||
RGN_TYPE_WINDOW = 0,
|
||||
RGN_TYPE_HEADER = 1,
|
||||
RGN_TYPE_CHANNELS = 2,
|
||||
RGN_TYPE_TEMPORARY = 3,
|
||||
RGN_TYPE_UI = 4,
|
||||
RGN_TYPE_TOOLS = 5,
|
||||
RGN_TYPE_TOOL_PROPS = 6,
|
||||
RGN_TYPE_PREVIEW = 7,
|
||||
RGN_TYPE_HUD = 8,
|
||||
/* Region to navigate the main region from (RGN_TYPE_WINDOW). */
|
||||
RGN_TYPE_NAV_BAR = 9,
|
||||
/* A place for buttons to trigger execution of something that was set up in other regions. */
|
||||
RGN_TYPE_EXECUTE = 10,
|
||||
RGN_TYPE_FOOTER = 11,
|
||||
RGN_TYPE_TOOL_HEADER = 12,
|
||||
/* Region type used exclusively by internal code and add-ons to register draw callbacks to the XR
|
||||
* context (surface, mirror view). Does not represent any real region. */
|
||||
RGN_TYPE_XR = 13,
|
||||
RGN_TYPE_ASSET_SHELF = 14,
|
||||
RGN_TYPE_ASSET_SHELF_HEADER = 15,
|
||||
RGN_TYPE_SCRUBBING = 16,
|
||||
|
||||
#define RGN_TYPE_NUM (RGN_TYPE_SCRUBBING + 1)
|
||||
};
|
||||
|
||||
/** Use for function args. */
|
||||
#define RGN_TYPE_ANY -1
|
||||
|
||||
/** Check for any kind of header region. */
|
||||
#define RGN_TYPE_IS_HEADER_ANY(regiontype) \
|
||||
(((1 << (regiontype)) & \
|
||||
((1 << RGN_TYPE_HEADER) | 1 << (RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_FOOTER) | \
|
||||
(1 << RGN_TYPE_ASSET_SHELF_HEADER) | (1 << RGN_TYPE_SCRUBBING))) != 0)
|
||||
|
||||
/** #ARegion.alignment */
|
||||
enum eRegion_Alignment : short {
|
||||
RGN_ALIGN_NONE = 0,
|
||||
RGN_ALIGN_TOP = 1,
|
||||
RGN_ALIGN_BOTTOM = 2,
|
||||
RGN_ALIGN_LEFT = 3,
|
||||
RGN_ALIGN_RIGHT = 4,
|
||||
RGN_ALIGN_HSPLIT = 5,
|
||||
RGN_ALIGN_VSPLIT = 6,
|
||||
RGN_ALIGN_FLOAT = 7,
|
||||
RGN_ALIGN_QSPLIT = 8,
|
||||
/* Maximum 15. */
|
||||
|
||||
/* Flags start here. */
|
||||
/** Region is split into the previous one, they share the same space along a common edge.
|
||||
* Includes the #RGN_ALIGN_HIDE_WITH_PREV behavior. */
|
||||
RGN_SPLIT_PREV = 1 << 5,
|
||||
/** Always let scaling this region scale the previous region instead. Useful to let regions
|
||||
* appear like they are one (while having independent layout, scrolling, etc.). */
|
||||
RGN_SPLIT_SCALE_PREV = 1 << 6,
|
||||
/** Whenever the previous region is hidden, this region becomes invisible too. #RGN_FLAG_HIDDEN
|
||||
* should only be set for the previous region, not this. The evaluated visibility respecting this
|
||||
* flag can be queried via #ARegion.visible */
|
||||
RGN_ALIGN_HIDE_WITH_PREV = 1 << 7,
|
||||
/** Region scaling is handed off when reaching limits. When the previous region is at maximum
|
||||
* size, drag-outs are forwarded to this region, and when this region is at minimum size,
|
||||
* drag-ins are forwarded to the previous region. */
|
||||
RGN_STACK_ON_PREV = 1 << 8,
|
||||
};
|
||||
ENUM_OPERATORS(eRegion_Alignment)
|
||||
|
||||
/** Mask out flags so we can check the alignment. */
|
||||
#define RGN_ALIGN_ENUM_FROM_MASK(align) ((align) & eRegion_Alignment((1 << 4) - 1))
|
||||
#define RGN_ALIGN_FLAG_FROM_MASK(align) ((align) & ~eRegion_Alignment((1 << 4) - 1))
|
||||
|
||||
/** #ARegion.flag */
|
||||
enum eRegion_Flag : short {
|
||||
RGN_FLAG_HIDDEN = (1 << 0),
|
||||
RGN_FLAG_TOO_SMALL = (1 << 1),
|
||||
/** Enable dynamically changing the region size in the #ARegionType::layout() callback. */
|
||||
RGN_FLAG_DYNAMIC_SIZE = (1 << 2),
|
||||
/** Region data is NULL'd on read, never written. */
|
||||
RGN_FLAG_TEMP_REGIONDATA = (1 << 3),
|
||||
/** Region resizing by the user is disabled, but the region edge can still be dragged to
|
||||
* hide/unhide the region. */
|
||||
RGN_FLAG_NO_USER_RESIZE = (1 << 4),
|
||||
/** Size has been clamped (floating regions only). */
|
||||
RGN_FLAG_SIZE_CLAMP_X = (1 << 5),
|
||||
RGN_FLAG_SIZE_CLAMP_Y = (1 << 6),
|
||||
/** When the user sets the region is hidden,
|
||||
* needed for floating regions that may be hidden for other reasons. */
|
||||
RGN_FLAG_HIDDEN_BY_USER = (1 << 7),
|
||||
/** Property search filter is active. */
|
||||
RGN_FLAG_SEARCH_FILTER_ACTIVE = (1 << 8),
|
||||
/**
|
||||
* Update the expansion of the region's panels and switch contexts. Only Set
|
||||
* temporarily when the search filter is updated and cleared at the end of the
|
||||
* region's layout pass. so that expansion is still interactive,
|
||||
*/
|
||||
RGN_FLAG_SEARCH_FILTER_UPDATE = (1 << 9),
|
||||
/** #ARegionType.poll() failed for the current context, and the region should be treated as if it
|
||||
* wouldn't exist. Runtime only flag. */
|
||||
RGN_FLAG_POLL_FAILED = (1 << 10),
|
||||
RGN_FLAG_RESIZE_RESPECT_BUTTON_SECTIONS = (1 << 11),
|
||||
RGN_FLAG_INDICATE_OVERFLOW = (1 << 12),
|
||||
};
|
||||
ENUM_OPERATORS(eRegion_Flag)
|
||||
|
||||
/** #ARegion.do_draw */
|
||||
enum eRegion_DrawFlag : int {
|
||||
/** Region must be fully redrawn. */
|
||||
RGN_DRAW = 1,
|
||||
/**
|
||||
* Redraw only part of region, for sculpting and painting to get smoother
|
||||
* stroke painting on heavy meshes.
|
||||
*/
|
||||
RGN_DRAW_PARTIAL = 2,
|
||||
/**
|
||||
* For outliner, to do faster redraw without rebuilding outliner tree.
|
||||
* For 3D viewport, to display a new progressive render sample without
|
||||
* while other buffers and overlays remain unchanged.
|
||||
*/
|
||||
RGN_DRAW_NO_REBUILD = 4,
|
||||
|
||||
/** Set while region is being drawn. */
|
||||
RGN_DRAWING = 8,
|
||||
/** For popups, to refresh UI layout along with drawing. */
|
||||
RGN_REFRESH_UI = 16,
|
||||
|
||||
/** Only editor overlays (currently gizmos only!) should be redrawn. */
|
||||
RGN_DRAW_EDITOR_OVERLAYS = 32,
|
||||
};
|
||||
ENUM_OPERATORS(eRegion_DrawFlag)
|
||||
|
||||
struct ARegion {
|
||||
struct ARegion *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** 2D-View scrolling/zoom info (most regions are 2d anyways). */
|
||||
View2D v2d;
|
||||
/** Coordinates of region. */
|
||||
rcti winrct = {};
|
||||
/** Size. */
|
||||
short winx = 0, winy = 0;
|
||||
/**
|
||||
* This is a Y offset on the panel tabs that represents pixels,
|
||||
* where zero represents no scroll - the first category always shows first at the top.
|
||||
*/
|
||||
int category_scroll = 0;
|
||||
|
||||
/** Window, header, etc. identifier for drawing. */
|
||||
eRegion_Type regiontype = RGN_TYPE_WINDOW;
|
||||
/** How it should split. */
|
||||
eRegion_Alignment alignment = RGN_ALIGN_NONE;
|
||||
/** Hide, .... */
|
||||
eRegion_Flag flag = {};
|
||||
|
||||
/** Current split size in unscaled pixels (if zero it uses regiontype).
|
||||
* To convert to pixels use: `UI_SCALE_FAC * region->sizex + 0.5f`.
|
||||
* However to get the current region size, you should usually use winx/winy from above, not this!
|
||||
*/
|
||||
short sizex = 0, sizey = 0;
|
||||
|
||||
/** Private, set for indicate drawing overlapped. */
|
||||
short overlap = 0;
|
||||
/** Temporary copy of flag settings for clean full-screen. */
|
||||
short flagfullscreen = 0;
|
||||
|
||||
char _pad[2] = {};
|
||||
|
||||
ListBaseT<Panel> panels = {nullptr, nullptr};
|
||||
/** Stack of panel categories. */
|
||||
ListBaseT<PanelCategoryStack> panels_category_active = {nullptr, nullptr};
|
||||
ListBaseT<uiList> ui_lists = {nullptr, nullptr};
|
||||
ListBaseT<uiPreview> ui_previews = {nullptr, nullptr};
|
||||
/**
|
||||
* Permanent state storage of #ui::AbstractView instances, so hiding regions with views or
|
||||
* loading files remembers the view state.
|
||||
*/
|
||||
ListBaseT<uiViewStateLink> view_states = {nullptr, nullptr};
|
||||
/**
|
||||
* Permanent state storage of #ui::ButtonTextBox instances, so hiding regions with textbox
|
||||
* buttons or loading files remembers the textbox state.
|
||||
*/
|
||||
ListBaseT<uiTextboxStateLink> textbox_states = {nullptr, nullptr};
|
||||
|
||||
/** XXX 2.50, need spacedata equivalent? */
|
||||
void *regiondata = nullptr;
|
||||
|
||||
bke::ARegionRuntime *runtime = nullptr;
|
||||
};
|
||||
|
||||
/* #AssetShelfSettings.display_flag */
|
||||
enum AssetShelfSettings_DisplayFlag : short {
|
||||
ASSETSHELF_SHOW_NAMES = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(AssetShelfSettings_DisplayFlag)
|
||||
|
||||
/* #AssetShelfSettings.instance_flag */
|
||||
enum AssetShelf_InstanceFlag : short {
|
||||
/**
|
||||
* Remember the last known region visibility state or this shelf, so it can be restored if the
|
||||
* shelf is reactivated. Practically this makes the shelf visibility be remembered per mode.
|
||||
* Continuously updated for the visible region.
|
||||
*/
|
||||
ASSETSHELF_REGION_IS_HIDDEN = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(AssetShelf_InstanceFlag);
|
||||
|
||||
struct AssetShelfSettings {
|
||||
AssetLibraryReference asset_library_reference;
|
||||
|
||||
ListBaseT<AssetCatalogPathLink> enabled_catalog_paths = {nullptr, nullptr};
|
||||
/** If not set (null or empty string), all assets will be displayed ("All" catalog behavior). */
|
||||
const char *active_catalog_path = nullptr;
|
||||
|
||||
/** For filtering assets displayed in the asset view. */
|
||||
char search_string[64] = "";
|
||||
|
||||
short preview_size = 0;
|
||||
AssetShelfSettings_DisplayFlag display_flag = {};
|
||||
char _pad1[4] = {};
|
||||
|
||||
#if defined(__cplusplus) && !defined(DNA_NO_EXTERNAL_CONSTRUCTORS)
|
||||
/* Zero initializes. */
|
||||
AssetShelfSettings();
|
||||
/* Proper deep copy. */
|
||||
AssetShelfSettings(const AssetShelfSettings &other);
|
||||
AssetShelfSettings &operator=(const AssetShelfSettings &other);
|
||||
~AssetShelfSettings();
|
||||
#endif
|
||||
};
|
||||
|
||||
struct AssetShelf {
|
||||
DNA_DEFINE_CXX_METHODS(AssetShelf)
|
||||
|
||||
struct AssetShelf *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Identifier that matches the #AssetShelfType.idname this shelf was created with. Used to
|
||||
* restore the #AssetShelf.type pointer below on file read. */
|
||||
char idname[/*MAX_NAME*/ 64] = "";
|
||||
/** Runtime. */
|
||||
struct AssetShelfType *type = nullptr;
|
||||
|
||||
AssetShelfSettings settings;
|
||||
|
||||
/** Only for the permanent asset shelf regions, not asset shelves in temporary popups. */
|
||||
short preferred_row_count = 0;
|
||||
AssetShelf_InstanceFlag instance_flag = {};
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Region-data for the main asset shelf region (#RGN_TYPE_ASSET_SHELF). Managed by the asset shelf
|
||||
* internals.
|
||||
*
|
||||
* Contains storage for all previously activated asset shelf instances plus info on the currently
|
||||
* active one (only one can be active at any time).
|
||||
*/
|
||||
struct RegionAssetShelf {
|
||||
/** Owning list of previously activated asset shelves. */
|
||||
ListBaseT<AssetShelf> shelves = {nullptr, nullptr};
|
||||
/**
|
||||
* The currently active shelf, if any. Updated on redraw, so that context changes are reflected.
|
||||
* Note that this may still be set even though the shelf isn't available anymore
|
||||
* (#AssetShelfType.poll() fails). The pointer isn't necessarily unset when polling.
|
||||
*/
|
||||
AssetShelf *active_shelf = nullptr; /* Non-owning. */
|
||||
#ifdef __cplusplus
|
||||
static RegionAssetShelf *get_from_asset_shelf_region(const ARegion ®ion);
|
||||
/** Creates the asset shelf region data if necessary, and returns it. */
|
||||
static RegionAssetShelf *ensure_from_asset_shelf_region(ARegion ®ion);
|
||||
#endif
|
||||
};
|
||||
|
||||
struct FileHandler {
|
||||
DNA_DEFINE_CXX_METHODS(FileHandler)
|
||||
/** Runtime. */
|
||||
bke::FileHandlerType *type = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
54
blender-5.2.0/source/blender/makesdna/DNA_sdna_pointers.hh
Normal file
54
blender-5.2.0/source/blender/makesdna/DNA_sdna_pointers.hh
Normal file
@@ -0,0 +1,54 @@
|
||||
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_vector.hh"
|
||||
|
||||
#include "DNA_sdna_types.h"
|
||||
|
||||
namespace blender::dna::pointers {
|
||||
|
||||
/** Information about a single pointer in a DNA struct. */
|
||||
struct PointerInfo {
|
||||
/** Offset in bytes from the start of the struct. */
|
||||
int64_t offset;
|
||||
/** Additional information about the pointer which can be useful for debugging. */
|
||||
const char *member_type_name = nullptr;
|
||||
const char *name = nullptr;
|
||||
};
|
||||
|
||||
/** All pointers within a DNA struct (including nested structs). */
|
||||
struct StructInfo {
|
||||
/** All pointers in that struct. */
|
||||
Vector<PointerInfo> pointers;
|
||||
/** Size of the struct in bytes. */
|
||||
int size_in_bytes = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Contains information about where pointers are stored in DNA structs.
|
||||
*/
|
||||
class PointersInDNA {
|
||||
private:
|
||||
/** The SDNA that this class belongs to. */
|
||||
const SDNA &sdna_;
|
||||
/** Pointer information about all structs. */
|
||||
Vector<StructInfo> structs_;
|
||||
|
||||
public:
|
||||
explicit PointersInDNA(const SDNA &sdna);
|
||||
|
||||
const StructInfo &get_for_struct(const int struct_nr) const
|
||||
{
|
||||
return structs_[struct_nr];
|
||||
}
|
||||
|
||||
private:
|
||||
void gather_pointer_members_recursive(const SDNA_Struct &sdna_struct,
|
||||
int initial_offset,
|
||||
StructInfo &r_struct_info) const;
|
||||
};
|
||||
|
||||
} // namespace blender::dna::pointers
|
||||
25
blender-5.2.0/source/blender/makesdna/DNA_sdna_type_ids.hh
Normal file
25
blender-5.2.0/source/blender/makesdna/DNA_sdna_type_ids.hh
Normal file
@@ -0,0 +1,25 @@
|
||||
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace blender::dna {
|
||||
|
||||
/**
|
||||
* Each DNA struct has an integer identifier which is unique within a specific Blender build, but
|
||||
* not necessarily across different builds. The identifier can be used to index into
|
||||
* `SDNA.structs`.
|
||||
*/
|
||||
template<typename T> int sdna_struct_id_get();
|
||||
|
||||
/**
|
||||
* The maximum identifier that will be returned by #sdna_struct_id_get in this Blender build.
|
||||
*/
|
||||
int sdna_struct_id_get_max();
|
||||
|
||||
} // namespace blender::dna
|
||||
148
blender-5.2.0/source/blender/makesdna/DNA_sdna_types.h
Normal file
148
blender-5.2.0/source/blender/makesdna/DNA_sdna_types.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* The struct index representing type-less bytes buffers.
|
||||
*
|
||||
* Although code has historically (pre-4.3) be fairly unreliable (logically incorrect, see inline
|
||||
* code-comments for #DNA_struct_get_compareflags regarding this), most of read/write blend-file
|
||||
* code would assume that the `0` value was raw data, so keep it at this value.
|
||||
*/
|
||||
#define SDNA_RAW_DATA_STRUCT_INDEX 0
|
||||
|
||||
struct MemArena;
|
||||
struct GHash;
|
||||
|
||||
#
|
||||
#
|
||||
struct SDNA_StructMember {
|
||||
/** This struct must not change, it's only a convenience view for raw data stored in SDNA. */
|
||||
|
||||
/** An index into SDNA->types. */
|
||||
short type_index;
|
||||
/** An index into SDNA->members. */
|
||||
short member_index;
|
||||
};
|
||||
|
||||
#
|
||||
#
|
||||
struct SDNA_Struct {
|
||||
/** This struct must not change, it's only a convenience view for raw data stored in SDNA. */
|
||||
|
||||
/** An index into SDNA->types. */
|
||||
short type_index;
|
||||
/** The amount of members in this struct. */
|
||||
short members_num;
|
||||
/** "Flexible array member" that contains information about all members of this struct. */
|
||||
SDNA_StructMember members[];
|
||||
};
|
||||
|
||||
#
|
||||
#
|
||||
struct SDNA {
|
||||
/** The 'encoded' data (full copy when #data_alloc is set, otherwise borrowed memory). */
|
||||
const char *data;
|
||||
/** Length of #data, in bytes. */
|
||||
int data_size;
|
||||
bool data_alloc;
|
||||
|
||||
/** Size of a pointer in bytes. */
|
||||
int pointer_size;
|
||||
|
||||
/* ***** Start of SDNA types. ***** */
|
||||
/**
|
||||
* This covers all known types (basic and structs ones) from SDNA.
|
||||
*
|
||||
* NOTE: This data is not in sync with the SDNA #structs info below. Among other things:
|
||||
* - Basic types (int, float, etc.) have _no_ matching struct definitions currently.
|
||||
* - Types can be discovered and added before their struct definition, when they are used for
|
||||
* members of another struct which gets parsed first.
|
||||
*/
|
||||
/** Number of types. */
|
||||
int types_num;
|
||||
/** Type names. */
|
||||
const char **types;
|
||||
/** Type lengths. */
|
||||
short *types_size;
|
||||
/**
|
||||
* Alignment used when allocating pointers to this type. The actual minimum alignment of the
|
||||
* type may be lower in some cases. For example, the pointer alignment of a single char is at
|
||||
* least 8 bytes, but the alignment of the type itself is 1.
|
||||
*/
|
||||
int *types_alignment;
|
||||
/* ***** End of SDNA types. ***** */
|
||||
|
||||
/* ***** Start of SDNA structs. ***** */
|
||||
/**
|
||||
* This covers all known structs from SDNA (pointers to #SDNA_Struct data).
|
||||
*
|
||||
* NOTE: See comment above about SDNA types above for differences between structs and types
|
||||
* definitions.
|
||||
*/
|
||||
/** Number of struct definitions. */
|
||||
int structs_num;
|
||||
/** Information about structs and their members. */
|
||||
SDNA_Struct **structs;
|
||||
/* ***** End of SDNA structs. ***** */
|
||||
|
||||
/* ***** Start of SDNA struct members. ***** */
|
||||
/** Total number of struct members. */
|
||||
int members_num;
|
||||
/**
|
||||
* Contains the number of allocated items in both #members and #members_array_num arrays below.
|
||||
*
|
||||
* Typically same as #members_len, unless after versioning DNA info (these arrays are
|
||||
* reallocated by chunks, see #DNA_sdna_patch_struct_member).
|
||||
*/
|
||||
int members_num_alloc;
|
||||
/** Struct member names. */
|
||||
const char **members;
|
||||
/**
|
||||
* Aligned with #members. The total number of items in the array defined by the matching member,
|
||||
* if any, otherwise 1.
|
||||
*
|
||||
* Result of #DNA_member_array_num.
|
||||
*/
|
||||
short *members_array_num;
|
||||
/* ***** End of SDNA struct members. ***** */
|
||||
|
||||
/**
|
||||
* Mapping between type names (from #types array above) and struct indices (into #structs array
|
||||
* above).
|
||||
*
|
||||
* Requires WITH_DNA_GHASH to be used for now.
|
||||
*/
|
||||
GHash *types_to_structs_map;
|
||||
|
||||
/**
|
||||
* Runtime versions of data stored in DNA, lazy initialized, only different when renaming is
|
||||
* done.
|
||||
*
|
||||
* Contains mapping from original (static) types/members names to their current (alias)
|
||||
* DNA-defined versions (i.e. results from calling #DNA_alias_maps with
|
||||
* #DNA_RENAME_ALIAS_FROM_STATIC).
|
||||
*/
|
||||
struct {
|
||||
/** Aligned with #SDNA.types, same pointers when unchanged. */
|
||||
const char **types;
|
||||
/** Aligned with #SDNA.members, same pointers when unchanged. */
|
||||
const char **members;
|
||||
/** A version of #SDNA.types_to_structs_map that uses #SDNA.alias.types for its keys. */
|
||||
GHash *types_to_structs_map;
|
||||
} alias;
|
||||
|
||||
/** Temporary memory currently only used for version patching DNA. */
|
||||
MemArena *mem_arena;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
1031
blender-5.2.0/source/blender/makesdna/DNA_sequence_types.h
Normal file
1031
blender-5.2.0/source/blender/makesdna/DNA_sequence_types.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* Is a structure because of the following considerations:
|
||||
*
|
||||
* - It is not possible to use custom types in DNA members: `makesdna` does not recognize them.
|
||||
* - It allows to add more bits, more than standard fixed-size types can store. For example, if
|
||||
* we ever need to go 128 bits, it is as simple as adding extra 64bit field.
|
||||
*/
|
||||
struct SessionUID {
|
||||
/**
|
||||
* Never access directly, as it might cause a headache when more bits are needed: if the field
|
||||
* is used directly it will not be easy to find all places where partial access is used.
|
||||
*/
|
||||
uint64_t uid_ = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
251
blender-5.2.0/source/blender/makesdna/DNA_shader_fx_types.h
Normal file
251
blender-5.2.0/source/blender/makesdna/DNA_shader_fx_types.h
Normal file
@@ -0,0 +1,251 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
struct DRWShadingGroup;
|
||||
namespace blender {
|
||||
|
||||
enum ShaderFxMode : int {
|
||||
eShaderFxMode_Realtime = (1 << 0),
|
||||
eShaderFxMode_Render = (1 << 1),
|
||||
eShaderFxMode_Editmode = (1 << 2),
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
eShaderFxMode_Expanded_DEPRECATED = (1 << 3),
|
||||
#endif
|
||||
};
|
||||
ENUM_OPERATORS(ShaderFxMode)
|
||||
|
||||
enum ShaderFxFlag : short {
|
||||
/* This fx has been inserted in local override, and hence can be fully edited. */
|
||||
eShaderFxFlag_OverrideLibrary_Local = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(ShaderFxFlag)
|
||||
|
||||
enum eBlurShaderFx_Flag : int {
|
||||
FX_BLUR_DOF_MODE = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eBlurShaderFx_Flag)
|
||||
|
||||
enum ColorizeShaderFxModes : int {
|
||||
eShaderFxColorizeMode_GrayScale = 0,
|
||||
eShaderFxColorizeMode_Sepia = 1,
|
||||
eShaderFxColorizeMode_Duotone = 2,
|
||||
eShaderFxColorizeMode_Custom = 3,
|
||||
eShaderFxColorizeMode_Transparent = 4,
|
||||
};
|
||||
|
||||
enum eFlipShaderFx_Flag : int {
|
||||
FX_FLIP_HORIZONTAL = (1 << 0),
|
||||
FX_FLIP_VERTICAL = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eFlipShaderFx_Flag)
|
||||
|
||||
enum GlowShaderFxModes : int {
|
||||
eShaderFxGlowMode_Luminance = 0,
|
||||
eShaderFxGlowMode_Color = 1,
|
||||
};
|
||||
|
||||
enum eGlowShaderFx_Flag : int {
|
||||
FX_GLOW_USE_ALPHA = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eGlowShaderFx_Flag)
|
||||
|
||||
enum ePixelShaderFx_Flag : int {
|
||||
FX_PIXEL_FILTER_NEAREST = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(ePixelShaderFx_Flag)
|
||||
|
||||
enum RimShaderFxModes : int {
|
||||
eShaderFxRimMode_Normal = 0,
|
||||
eShaderFxRimMode_Overlay = 1,
|
||||
eShaderFxRimMode_Add = 2,
|
||||
eShaderFxRimMode_Subtract = 3,
|
||||
eShaderFxRimMode_Multiply = 4,
|
||||
eShaderFxRimMode_Divide = 5,
|
||||
};
|
||||
|
||||
enum eShadowShaderFx_Flag : int {
|
||||
FX_SHADOW_USE_OBJECT = (1 << 0),
|
||||
FX_SHADOW_USE_WAVE = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eShadowShaderFx_Flag)
|
||||
|
||||
enum eSwirlShaderFx_Flag : int {
|
||||
FX_SWIRL_MAKE_TRANSPARENT = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eSwirlShaderFx_Flag)
|
||||
|
||||
/* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE!
|
||||
* (ONLY ADD NEW ITEMS AT THE END)
|
||||
*/
|
||||
|
||||
enum ShaderFxType : int {
|
||||
eShaderFxType_None = 0,
|
||||
eShaderFxType_Blur = 1,
|
||||
eShaderFxType_Flip = 2,
|
||||
eShaderFxType_Light_deprecated = 3, /* DEPRECATED (replaced by scene lights) */
|
||||
eShaderFxType_Pixel = 4,
|
||||
eShaderFxType_Swirl = 5,
|
||||
eShaderFxType_Wave = 6,
|
||||
eShaderFxType_Rim = 7,
|
||||
eShaderFxType_Colorize = 8,
|
||||
eShaderFxType_Shadow = 9,
|
||||
eShaderFxType_Glow = 10,
|
||||
/* Keep last. */
|
||||
NUM_SHADER_FX_TYPES,
|
||||
};
|
||||
|
||||
struct ShaderFxData {
|
||||
struct ShaderFxData *next = nullptr, *prev = nullptr;
|
||||
|
||||
ShaderFxType type = eShaderFxType_None;
|
||||
ShaderFxMode mode = {};
|
||||
char _pad0[4] = {};
|
||||
ShaderFxFlag flag = {};
|
||||
/* An "expand" bit for each of the constraint's (sub)panels (uiPanelDataExpansion). */
|
||||
short ui_expand_flag = 0;
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
char *error = nullptr;
|
||||
};
|
||||
|
||||
/** Runtime temp data. */
|
||||
struct ShaderFxData_Runtime {
|
||||
float loc[3] = {};
|
||||
char _pad[4] = {};
|
||||
struct DRWShadingGroup *fx_sh = nullptr;
|
||||
struct DRWShadingGroup *fx_sh_b = nullptr;
|
||||
struct DRWShadingGroup *fx_sh_c = nullptr;
|
||||
};
|
||||
|
||||
struct BlurShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
float radius[2] = {};
|
||||
/** Flags. */
|
||||
eBlurShaderFx_Flag flag = {};
|
||||
/** Number of samples. */
|
||||
int samples = 0;
|
||||
/** Rotation of blur effect. */
|
||||
float rotation = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct ColorizeShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
ColorizeShaderFxModes mode = eShaderFxColorizeMode_GrayScale;
|
||||
float low_color[4] = {};
|
||||
float high_color[4] = {};
|
||||
float factor = 0;
|
||||
/** Flags. */
|
||||
int flag = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct FlipShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
/** Flags. */
|
||||
eFlipShaderFx_Flag flag = {};
|
||||
/** Internal, not visible in rna. */
|
||||
int flipmode = 0;
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct GlowShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
float glow_color[4] = {};
|
||||
float select_color[3] = {};
|
||||
float threshold = 0;
|
||||
/** Flags. */
|
||||
eGlowShaderFx_Flag flag = {};
|
||||
GlowShaderFxModes mode = eShaderFxGlowMode_Luminance;
|
||||
float blur[2] = {};
|
||||
int samples = 0;
|
||||
/** Rotation of effect. */
|
||||
float rotation = 0;
|
||||
/** Blend modes. */
|
||||
int blend_mode = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct PixelShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
/** Last element used for shader only. */
|
||||
int size[3] = {};
|
||||
/** Flags. */
|
||||
ePixelShaderFx_Flag flag = {};
|
||||
float rgba[4] = {};
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct RimShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
int offset[2] = {};
|
||||
/** Flags. */
|
||||
int flag = 0;
|
||||
float rim_rgb[3] = {};
|
||||
float mask_rgb[3] = {};
|
||||
RimShaderFxModes mode = eShaderFxRimMode_Normal;
|
||||
int blur[2] = {};
|
||||
int samples = 0;
|
||||
char _pad[4] = {};
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct ShadowShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
struct Object *object = nullptr;
|
||||
int offset[2] = {};
|
||||
/** Flags. */
|
||||
eShadowShaderFx_Flag flag = {};
|
||||
float shadow_rgba[4] = {};
|
||||
float amplitude = 0;
|
||||
float period = 0;
|
||||
float phase = 0;
|
||||
int orientation = 0;
|
||||
float scale[2] = {};
|
||||
float rotation = 0;
|
||||
int blur[2] = {};
|
||||
int samples = 0;
|
||||
char _pad[4] = {};
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct SwirlShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
struct Object *object = nullptr;
|
||||
/** Flags. */
|
||||
eSwirlShaderFx_Flag flag = {};
|
||||
int radius = 0;
|
||||
float angle = 0;
|
||||
/** Not visible in rna. */
|
||||
int transparent = 0;
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
struct WaveShaderFxData {
|
||||
ShaderFxData shaderfx;
|
||||
float amplitude = 0;
|
||||
float period = 0;
|
||||
float phase = 0;
|
||||
int orientation = 0;
|
||||
/** Flags. */
|
||||
int flag = 0;
|
||||
char _pad[4] = {};
|
||||
ShaderFxData_Runtime runtime;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
75
blender-5.2.0/source/blender/makesdna/DNA_sound_types.h
Normal file
75
blender-5.2.0/source/blender/makesdna/DNA_sound_types.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
struct SoundRuntime;
|
||||
} // namespace bke
|
||||
|
||||
struct PackedFile;
|
||||
|
||||
/** #bSound.flags */
|
||||
enum eSound_Flag : short {
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
/* deprecated! used for sound actuator loading */
|
||||
SOUND_FLAGS_3D = (1 << 3),
|
||||
#endif
|
||||
SOUND_FLAGS_CACHING = (1 << 4),
|
||||
SOUND_FLAGS_MONO = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eSound_Flag)
|
||||
|
||||
struct bSound {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_SO;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
/**
|
||||
* The path to the sound file.
|
||||
*/
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
/**
|
||||
* The packed file.
|
||||
*/
|
||||
struct PackedFile *packedfile = nullptr;
|
||||
|
||||
/**
|
||||
* Deprecated; used for loading pre 2.5 files.
|
||||
*/
|
||||
struct PackedFile *newpackedfile = nullptr;
|
||||
void *_pad0 = nullptr;
|
||||
|
||||
double offset_time = 0;
|
||||
float volume = 0;
|
||||
float attenuation = 0;
|
||||
float pitch = 0;
|
||||
float min_gain = 0;
|
||||
float max_gain = 0;
|
||||
float distance = 0;
|
||||
/* Description of Audio channels, as of #eSoundChannels. */
|
||||
int audio_channels = 0;
|
||||
int samplerate = 0;
|
||||
eSound_Flag flags = {};
|
||||
short stream_index = 0;
|
||||
char _pad1[4] = {};
|
||||
|
||||
bke::SoundRuntime *runtime = nullptr;
|
||||
void *_pad2 = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
1194
blender-5.2.0/source/blender/makesdna/DNA_space_enums.h
Normal file
1194
blender-5.2.0/source/blender/makesdna/DNA_space_enums.h
Normal file
File diff suppressed because it is too large
Load Diff
1305
blender-5.2.0/source/blender/makesdna/DNA_space_types.h
Normal file
1305
blender-5.2.0/source/blender/makesdna/DNA_space_types.h
Normal file
File diff suppressed because it is too large
Load Diff
63
blender-5.2.0/source/blender/makesdna/DNA_speaker_types.h
Normal file
63
blender-5.2.0/source/blender/makesdna/DNA_speaker_types.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cfloat>
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct bSound;
|
||||
|
||||
/* **************** SPEAKER ********************* */
|
||||
|
||||
/** #Speaker::flag */
|
||||
enum eSpeaker_Flag : short {
|
||||
SPK_DS_EXPAND = 1 << 0,
|
||||
SPK_MUTED = 1 << 1,
|
||||
// SPK_RELATIVE = 1 << 2, /* UNUSED */
|
||||
};
|
||||
ENUM_OPERATORS(eSpeaker_Flag)
|
||||
|
||||
struct Speaker {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_SPK;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
struct bSound *sound = nullptr;
|
||||
|
||||
/* not animatable properties */
|
||||
float volume_max = 1.0f;
|
||||
float volume_min = 0.0f;
|
||||
float distance_max = FLT_MAX;
|
||||
float distance_reference = 1.0f;
|
||||
float attenuation = 1.0f;
|
||||
float cone_angle_outer = 360.0f;
|
||||
float cone_angle_inner = 360.0f;
|
||||
float cone_volume_outer = 1.0f;
|
||||
|
||||
/* animatable properties */
|
||||
float volume = 1.0f;
|
||||
float pitch = 1.0f;
|
||||
|
||||
/* flag */
|
||||
eSpeaker_Flag flag = {};
|
||||
char _pad1[6] = {};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
84
blender-5.2.0/source/blender/makesdna/DNA_text_types.h
Normal file
84
blender-5.2.0/source/blender/makesdna/DNA_text_types.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Text blocks used for Python-Scripts, OpenShadingLanguage
|
||||
* and arbitrary text data to store in blend files.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** #Text.flags */
|
||||
enum eText_Flag : int {
|
||||
/** Set if the file in run-time differs from the file on disk, or if there is no file on disk. */
|
||||
TXT_ISDIRTY = 1 << 0,
|
||||
/** When the text hasn't been written to a file. #Text.filepath may be NULL or invalid. */
|
||||
TXT_ISMEM = 1 << 2,
|
||||
/** Should always be set if the Text is not to be written into the `.blend`. */
|
||||
TXT_ISEXT = 1 << 3,
|
||||
/** Load the script as a Python module when loading the `.blend` file. */
|
||||
TXT_ISSCRIPT = 1 << 4,
|
||||
|
||||
TXT_FLAG_UNUSED_8 = 1 << 8, /* cleared */
|
||||
TXT_FLAG_UNUSED_9 = 1 << 9, /* cleared */
|
||||
|
||||
/** Use space instead of tabs. */
|
||||
TXT_TABSTOSPACES = 1 << 10,
|
||||
};
|
||||
ENUM_OPERATORS(eText_Flag)
|
||||
|
||||
struct TextLine {
|
||||
struct TextLine *next = nullptr, *prev = nullptr;
|
||||
|
||||
char *line = nullptr;
|
||||
/** May be NULL if syntax is off or not yet formatted. */
|
||||
char *format = nullptr;
|
||||
int len = 0;
|
||||
char _pad0[4] = {};
|
||||
};
|
||||
|
||||
struct Text {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_TXT;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
void *_pad1 = nullptr;
|
||||
|
||||
/**
|
||||
* Optional file path, when NULL text is considered internal.
|
||||
* Otherwise this path will be used when saving/reloading.
|
||||
*
|
||||
* When set this is where the file will or has been saved.
|
||||
*/
|
||||
char *filepath = nullptr;
|
||||
|
||||
/**
|
||||
* Python code object for this text (cached result of #Py_CompileStringObject).
|
||||
*/
|
||||
void *compiled = nullptr;
|
||||
|
||||
eText_Flag flags = {};
|
||||
char _pad0[4] = {};
|
||||
|
||||
ListBaseT<TextLine> lines = {nullptr, nullptr};
|
||||
TextLine *curl = nullptr, *sell = nullptr;
|
||||
int curc = 0, selc = 0;
|
||||
|
||||
double mtime = 0;
|
||||
};
|
||||
|
||||
#define TXT_TABSIZE 4
|
||||
|
||||
} // namespace blender
|
||||
456
blender-5.2.0/source/blender/makesdna/DNA_texture_types.h
Normal file
456
blender-5.2.0/source/blender/makesdna/DNA_texture_types.h
Normal file
@@ -0,0 +1,456 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_constants.h"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_colorband_types.h"
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_image_types.h" /* ImageUser */
|
||||
#include "DNA_material_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct AnimData;
|
||||
struct ColorBand;
|
||||
struct CurveMapping;
|
||||
struct Image;
|
||||
struct Object;
|
||||
struct PreviewImage;
|
||||
struct Tex;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #TexMapping Types
|
||||
* \{ */
|
||||
|
||||
/** #TexMapping::flag bit-mask. */
|
||||
enum eTexMapping_Flag : int {
|
||||
TEXMAP_CLIP_MIN = 1 << 0,
|
||||
TEXMAP_CLIP_MAX = 1 << 1,
|
||||
TEXMAP_UNIT_MATRIX = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eTexMapping_Flag)
|
||||
|
||||
/** #TexMapping::type. */
|
||||
enum eTexMapping_Type : int {
|
||||
TEXMAP_TYPE_POINT = 0,
|
||||
TEXMAP_TYPE_TEXTURE = 1,
|
||||
TEXMAP_TYPE_VECTOR = 2,
|
||||
TEXMAP_TYPE_NORMAL = 3,
|
||||
};
|
||||
|
||||
/** #ColorMapping::flag bit-mask. */
|
||||
enum eColorMapping_Flag : int {
|
||||
COLORMAP_USE_RAMP = 1,
|
||||
};
|
||||
ENUM_OPERATORS(eColorMapping_Flag)
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #Tex Types
|
||||
* \{ */
|
||||
|
||||
/** #Tex::type. */
|
||||
enum eTex_Type : short {
|
||||
TEX_CLOUDS = 1,
|
||||
TEX_WOOD = 2,
|
||||
TEX_MARBLE = 3,
|
||||
TEX_MAGIC = 4,
|
||||
TEX_BLEND = 5,
|
||||
TEX_STUCCI = 6,
|
||||
TEX_NOISE = 7,
|
||||
TEX_IMAGE = 8,
|
||||
// TEX_PLUGIN = 9, /* Deprecated */
|
||||
// TEX_ENVMAP = 10, /* Deprecated */
|
||||
TEX_MUSGRAVE = 11,
|
||||
TEX_VORONOI = 12,
|
||||
TEX_DISTNOISE = 13,
|
||||
// TEX_POINTDENSITY = 14, /* Deprecated */
|
||||
// TEX_VOXELDATA = 15, /* Deprecated */
|
||||
// TEX_OCEAN = 16, /* Deprecated */
|
||||
};
|
||||
|
||||
/** #Tex::stype musgrave. */
|
||||
enum eTex_MusgraveType : short {
|
||||
TEX_MFRACTAL = 0,
|
||||
TEX_RIDGEDMF = 1,
|
||||
TEX_HYBRIDMF = 2,
|
||||
TEX_FBM = 3,
|
||||
TEX_HTERRAIN = 4,
|
||||
};
|
||||
|
||||
/** #Tex::noisebasis, #Tex::noisebasis2. */
|
||||
enum eTex_NoiseBasis : short {
|
||||
TEX_BLENDER = 0,
|
||||
TEX_STDPERLIN = 1,
|
||||
TEX_NEWPERLIN = 2,
|
||||
TEX_VORONOI_F1 = 3,
|
||||
TEX_VORONOI_F2 = 4,
|
||||
TEX_VORONOI_F3 = 5,
|
||||
TEX_VORONOI_F4 = 6,
|
||||
TEX_VORONOI_F2F1 = 7,
|
||||
TEX_VORONOI_CRACKLE = 8,
|
||||
TEX_CELLNOISE = 14,
|
||||
};
|
||||
|
||||
/** #Tex::vn_distm voronoi distance metrics. */
|
||||
enum eTex_VoronoiDistMetric : short {
|
||||
TEX_DISTANCE = 0,
|
||||
TEX_DISTANCE_SQUARED = 1,
|
||||
TEX_MANHATTAN = 2,
|
||||
TEX_CHEBYCHEV = 3,
|
||||
TEX_MINKOVSKY_HALF = 4,
|
||||
TEX_MINKOVSKY_FOUR = 5,
|
||||
TEX_MINKOVSKY = 6,
|
||||
};
|
||||
|
||||
/** #Tex::imaflag bit-mask. */
|
||||
enum eTex_ImaFlag : short {
|
||||
TEX_INTERPOL = 1 << 0,
|
||||
TEX_USEALPHA = 1 << 1,
|
||||
TEX_IMAROT = 1 << 4,
|
||||
TEX_CALCALPHA = 1 << 5,
|
||||
TEX_NORMALMAP = 1 << 11,
|
||||
TEX_DERIVATIVEMAP = 1 << 14,
|
||||
};
|
||||
ENUM_OPERATORS(eTex_ImaFlag)
|
||||
|
||||
/** #Tex::flag bit-mask. */
|
||||
enum eTex_Flag : short {
|
||||
TEX_COLORBAND = 1 << 0,
|
||||
TEX_FLIPBLEND = 1 << 1,
|
||||
TEX_NEGALPHA = 1 << 2,
|
||||
TEX_CHECKER_ODD = 1 << 3,
|
||||
TEX_CHECKER_EVEN = 1 << 4,
|
||||
TEX_PRV_ALPHA = 1 << 5,
|
||||
TEX_PRV_NOR = 1 << 6,
|
||||
TEX_REPEAT_XMIR = 1 << 7,
|
||||
TEX_REPEAT_YMIR = 1 << 8,
|
||||
TEX_DS_EXPAND = 1 << 9,
|
||||
TEX_NO_CLAMP = 1 << 10,
|
||||
};
|
||||
ENUM_OPERATORS(eTex_Flag)
|
||||
|
||||
/** #Tex::extend (starts with 1 because of backward compatibility). */
|
||||
enum eTex_Extend : short {
|
||||
TEX_EXTEND = 1,
|
||||
TEX_CLIP = 2,
|
||||
TEX_REPEAT = 3,
|
||||
TEX_CLIPCUBE = 4,
|
||||
TEX_CHECKER = 5,
|
||||
};
|
||||
|
||||
/** #Tex::noisetype type. */
|
||||
enum eTex_NoiseType : short {
|
||||
TEX_NOISESOFT = 0,
|
||||
TEX_NOISEPERL = 1,
|
||||
};
|
||||
|
||||
/** #Tex::noisebasis2 wood waveforms. */
|
||||
enum eTex_WoodWaveform : short {
|
||||
TEX_SIN = 0,
|
||||
TEX_SAW = 1,
|
||||
TEX_TRI = 2,
|
||||
};
|
||||
|
||||
/** #Tex::stype wood types. */
|
||||
enum eTex_WoodType : short {
|
||||
TEX_BAND = 0,
|
||||
TEX_RING = 1,
|
||||
TEX_BANDNOISE = 2,
|
||||
TEX_RINGNOISE = 3,
|
||||
};
|
||||
|
||||
/** #Tex::stype cloud types. */
|
||||
enum eTex_CloudType : short {
|
||||
TEX_DEFAULT = 0,
|
||||
TEX_COLOR = 1,
|
||||
};
|
||||
|
||||
/** #Tex::stype marble types. */
|
||||
enum eTex_MarbleType : short {
|
||||
TEX_SOFT = 0,
|
||||
TEX_SHARP = 1,
|
||||
TEX_SHARPER = 2,
|
||||
};
|
||||
|
||||
/** #Tex::stype blend types. */
|
||||
enum eTex_BlendType : short {
|
||||
TEX_LIN = 0,
|
||||
TEX_QUAD = 1,
|
||||
TEX_EASE = 2,
|
||||
TEX_DIAG = 3,
|
||||
TEX_SPHERE = 4,
|
||||
TEX_HALO = 5,
|
||||
TEX_RAD = 6,
|
||||
};
|
||||
|
||||
/** #Tex::stype stucci types. */
|
||||
enum eTex_StucciType : short {
|
||||
TEX_PLASTIC = 0,
|
||||
TEX_WALLIN = 1,
|
||||
TEX_WALLOUT = 2,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #TexMapping Types
|
||||
* \{ */
|
||||
|
||||
/** #Tex::vn_coltype voronoi color types. */
|
||||
enum eTex_VoronoiColType : short {
|
||||
TEX_INTENSITY = 0,
|
||||
TEX_COL1 = 1,
|
||||
TEX_COL2 = 2,
|
||||
TEX_COL3 = 3,
|
||||
};
|
||||
|
||||
/** Return value. */
|
||||
enum eTex_ReturnValue : short {
|
||||
TEX_INT = 0,
|
||||
TEX_RGB = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* - #Material::pr_texture
|
||||
* - #Light::pr_texture
|
||||
* - #World::pr_texture
|
||||
* - #FreestyleLineStyle::pr_texture
|
||||
*/
|
||||
enum eTex_PreviewType : short {
|
||||
TEX_PR_TEXTURE = 0,
|
||||
TEX_PR_OTHER = 1,
|
||||
TEX_PR_BOTH = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* #TexMapping::projx
|
||||
* #TexMapping::projy
|
||||
* #TexMapping::projz
|
||||
*/
|
||||
enum eTex_Projection : char {
|
||||
PROJ_N = 0,
|
||||
PROJ_X = 1,
|
||||
PROJ_Y = 2,
|
||||
PROJ_Z = 3,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #MTex Types
|
||||
* \{ */
|
||||
|
||||
/** #MTex::mapping. */
|
||||
enum eMTex_Mapping : char {
|
||||
MTEX_FLAT = 0,
|
||||
MTEX_CUBE = 1,
|
||||
MTEX_TUBE = 2,
|
||||
MTEX_SPHERE = 3,
|
||||
};
|
||||
|
||||
/** #MTex::blendtype. */
|
||||
enum eMTex_BlendType : short {
|
||||
MTEX_BLEND = 0,
|
||||
MTEX_MUL = 1,
|
||||
MTEX_ADD = 2,
|
||||
MTEX_SUB = 3,
|
||||
MTEX_DIV = 4,
|
||||
MTEX_DARK = 5,
|
||||
MTEX_DIFF = 6,
|
||||
MTEX_LIGHT = 7,
|
||||
MTEX_SCREEN = 8,
|
||||
MTEX_OVERLAY = 9,
|
||||
MTEX_BLEND_HUE = 10,
|
||||
MTEX_BLEND_SAT = 11,
|
||||
MTEX_BLEND_VAL = 12,
|
||||
MTEX_BLEND_COLOR = 13,
|
||||
MTEX_SOFT_LIGHT = 15,
|
||||
MTEX_LIN_LIGHT = 16,
|
||||
};
|
||||
|
||||
/** #MTex::brush_map_mode. */
|
||||
enum eMTex_BrushMapMode : char {
|
||||
MTEX_MAP_MODE_VIEW = 0,
|
||||
MTEX_MAP_MODE_TILED = 1,
|
||||
MTEX_MAP_MODE_3D = 2,
|
||||
MTEX_MAP_MODE_AREA = 3,
|
||||
MTEX_MAP_MODE_RANDOM = 4,
|
||||
MTEX_MAP_MODE_STENCIL = 5,
|
||||
};
|
||||
|
||||
/** #MTex::brush_angle_mode. */
|
||||
enum eMTex_BrushAngleMode : char {
|
||||
MTEX_ANGLE_RANDOM = 1,
|
||||
MTEX_ANGLE_RAKE = 2,
|
||||
};
|
||||
ENUM_OPERATORS(eMTex_BrushAngleMode)
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #MTex
|
||||
* \{ */
|
||||
|
||||
struct MTex {
|
||||
DNA_DEFINE_CXX_METHODS(MTex)
|
||||
|
||||
short texco = TEXCO_UV, mapto = MAP_COL;
|
||||
eMTex_BlendType blendtype = MTEX_BLEND;
|
||||
char _pad2[2] = {};
|
||||
struct Object *object = nullptr;
|
||||
struct Tex *tex = nullptr;
|
||||
char uvname[/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] = "";
|
||||
|
||||
eTex_Projection projx = PROJ_X, projy = PROJ_Y, projz = PROJ_Z;
|
||||
eMTex_Mapping mapping = MTEX_FLAT;
|
||||
eMTex_BrushMapMode brush_map_mode = MTEX_MAP_MODE_VIEW;
|
||||
eMTex_BrushAngleMode brush_angle_mode = {};
|
||||
|
||||
/**
|
||||
* Match against the texture node (#TEX_NODE_OUTPUT, #bNode::custom1 value).
|
||||
* otherwise zero when unspecified (default).
|
||||
*/
|
||||
short which_output = 0;
|
||||
|
||||
float ofs[3] = {0.0f, 0.0f, 0.0f};
|
||||
float size[3] = {1.0f, 1.0f, 1.0f};
|
||||
float rot = 0, random_angle = 2.0f * float(M_PI);
|
||||
|
||||
float r = 1.0, g = 0.0, b = 1.0, k = 1.0;
|
||||
float def_var = 1.0;
|
||||
|
||||
/* common */
|
||||
float colfac = 1.0;
|
||||
float alphafac = 1.0f;
|
||||
|
||||
/* particles */
|
||||
float timefac = 1.0f, lengthfac = 1.0f, clumpfac = 1.0f, dampfac = 1.0f;
|
||||
float kinkfac = 1.0f, kinkampfac = 1.0f, roughfac = 1.0f, padensfac = 1.0f, gravityfac = 1.0f;
|
||||
float lifefac = 1.0f, sizefac = 1.0f, ivelfac = 1.0f, fieldfac = 1.0f;
|
||||
float twistfac = 1.0f;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name #Tex
|
||||
* \{ */
|
||||
|
||||
struct Tex_Runtime {
|
||||
/* The Depsgraph::update_count when this ID was last updated. Covers any IDRecalcFlag. */
|
||||
uint64_t last_update = 0;
|
||||
};
|
||||
|
||||
struct Tex {
|
||||
#ifdef __cplusplus
|
||||
DNA_DEFINE_CXX_METHODS(Tex)
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_TE;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
/** Animation data (must be immediately after id for utilities to use it). */
|
||||
struct AnimData *adt = nullptr;
|
||||
|
||||
void *_pad3 = nullptr;
|
||||
|
||||
float noisesize = 0.25, turbul = 5.0;
|
||||
float bright = 1.0, contrast = 1.0, saturation = 1.0, rfac = 1.0, gfac = 1.0, bfac = 1.0;
|
||||
float filtersize = 1.0;
|
||||
|
||||
/* newnoise: musgrave parameters */
|
||||
float mg_H = 1.0, mg_lacunarity = 2.0, mg_octaves = 2.0, mg_offset = 1.0, mg_gain = 1.0;
|
||||
|
||||
/* newnoise: distorted noise amount, musgrave & voronoi output scale */
|
||||
float dist_amount = 1.0, ns_outscale = 1.0;
|
||||
|
||||
/* newnoise: voronoi nearest neighbor weights, minkovsky exponent,
|
||||
* distance metric & color type */
|
||||
float vn_w1 = 1.0;
|
||||
float vn_w2 = 0.0;
|
||||
float vn_w3 = 0.0;
|
||||
float vn_w4 = 0.0;
|
||||
float vn_mexp = 2.5;
|
||||
eTex_VoronoiDistMetric vn_distm = {};
|
||||
eTex_VoronoiColType vn_coltype = {};
|
||||
|
||||
/* noisedepth MUST be <= 30 else we get floating point exceptions */
|
||||
short noisedepth = 2;
|
||||
eTex_NoiseType noisetype = {};
|
||||
|
||||
/* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
|
||||
eTex_NoiseBasis noisebasis = {}, noisebasis2 = {};
|
||||
|
||||
eTex_ImaFlag imaflag = TEX_INTERPOL | TEX_USEALPHA;
|
||||
eTex_Flag flag = TEX_CHECKER_ODD | TEX_NO_CLAMP;
|
||||
eTex_Type type = TEX_IMAGE;
|
||||
short stype = 0;
|
||||
|
||||
float cropxmin = 0.0, cropymin = 0.0, cropxmax = 1.0, cropymax = 1.0;
|
||||
short xrepeat = 1, yrepeat = 1;
|
||||
eTex_Extend extend = TEX_REPEAT;
|
||||
|
||||
/* Variables only used for versioning, moved to struct member `iuser`. */
|
||||
short _pad0 = {};
|
||||
DNA_DEPRECATED int len = 0;
|
||||
DNA_DEPRECATED int frames = 0;
|
||||
DNA_DEPRECATED int offset = 0;
|
||||
DNA_DEPRECATED int sfra = 1;
|
||||
|
||||
float checkerdist = 0, nabla = 0.025; /* also in do_versions. */
|
||||
|
||||
struct ImageUser iuser;
|
||||
|
||||
struct bNodeTree *nodetree = nullptr;
|
||||
struct Image *ima = nullptr;
|
||||
struct ColorBand *coba = nullptr;
|
||||
struct PreviewImage *preview = nullptr;
|
||||
|
||||
char use_nodes = 0;
|
||||
char _pad[7] = {};
|
||||
|
||||
Tex_Runtime runtime;
|
||||
};
|
||||
|
||||
/** Used for mapping and texture nodes. */
|
||||
struct TexMapping {
|
||||
float loc[3] = {};
|
||||
/** Rotation in radians. */
|
||||
float rot[3] = {};
|
||||
float size[3] = {};
|
||||
eTexMapping_Flag flag = {};
|
||||
eTex_Projection projx = {}, projy = {}, projz = {};
|
||||
char mapping = 0;
|
||||
eTexMapping_Type type = {};
|
||||
|
||||
float mat[4][4] = {};
|
||||
float min[3] = {}, max[3] = {};
|
||||
struct Object *ob = nullptr;
|
||||
};
|
||||
|
||||
struct ColorMapping {
|
||||
struct ColorBand coba;
|
||||
|
||||
float bright = 0, contrast = 0, saturation = 0;
|
||||
eColorMapping_Flag flag = {};
|
||||
|
||||
float blend_color[3] = {};
|
||||
float blend_factor = 0;
|
||||
int blend_type = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
} // namespace blender
|
||||
572
blender-5.2.0/source/blender/makesdna/DNA_theme_types.h
Normal file
572
blender-5.2.0/source/blender/makesdna/DNA_theme_types.h
Normal file
@@ -0,0 +1,572 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace blender {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Scaling factor for all UI elements, based on the "Resolution Scale" user preference and the
|
||||
* DPI/OS Scale of each monitor. This is a read-only, run-time value calculated by
|
||||
* `WM_window_dpi_set_userdef` at various times, including between the drawing of each window and
|
||||
* so can vary between monitors.
|
||||
*/
|
||||
#define UI_SCALE_FAC ((void)0, U.scale_factor)
|
||||
|
||||
/* Inverse of UI_SCALE_FAC ( 1 / UI_SCALE_FAC). */
|
||||
#define UI_INV_SCALE_FAC ((void)0, U.inv_scale_factor)
|
||||
|
||||
/* 16 to copy ICON_DEFAULT_HEIGHT */
|
||||
#define UI_ICON_SIZE ((float)16 * U.scale_factor)
|
||||
|
||||
/* Themes; defines in `BIF_resource.h`. */
|
||||
|
||||
/* ************************ style definitions ******************** */
|
||||
|
||||
/**
|
||||
* Default offered by Blender.
|
||||
* #uiFont.uifont_id
|
||||
*/
|
||||
typedef enum eUIFont_ID {
|
||||
UIFONT_DEFAULT = 0,
|
||||
// UIFONT_BITMAP = 1, /* UNUSED */
|
||||
|
||||
/* free slots */
|
||||
UIFONT_CUSTOM1 = 2,
|
||||
// UIFONT_CUSTOM2 = 3, /* UNUSED */
|
||||
} eUIFont_ID;
|
||||
|
||||
/**
|
||||
* Default fonts to load/initialize.
|
||||
* First font is the default (index 0), others optional.
|
||||
*/
|
||||
#
|
||||
#
|
||||
typedef struct uiFont {
|
||||
struct uiFont *next, *prev;
|
||||
char filepath[/*FILE_MAX*/ 1024];
|
||||
/** From BLF library. */
|
||||
short blf_id;
|
||||
/** Own id (eUIFont_ID). */
|
||||
short uifont_id;
|
||||
} uiFont;
|
||||
|
||||
/** This state defines appearance of text. */
|
||||
typedef struct uiFontStyle {
|
||||
/** Saved in file, 0 is default. */
|
||||
short uifont_id;
|
||||
char _pad1[2];
|
||||
/** Actual size depends on 'global' DPI. */
|
||||
float points;
|
||||
/** Style hint. */
|
||||
short italic, bold;
|
||||
/** Value is amount of pixels blur. */
|
||||
short shadow;
|
||||
/** Shadow offset in pixels. */
|
||||
short shadx, shady;
|
||||
char _pad0[2];
|
||||
/** Total alpha. */
|
||||
float shadowalpha;
|
||||
/** 1 value, typically white or black anyway. */
|
||||
float shadowcolor;
|
||||
/** Weight class 100-900, 400 is normal. */
|
||||
int character_weight;
|
||||
} uiFontStyle;
|
||||
|
||||
/* this is fed to the layout engine and widget code */
|
||||
|
||||
typedef struct uiStyle {
|
||||
struct uiStyle *next, *prev;
|
||||
|
||||
char name[/*MAX_NAME*/ 64];
|
||||
|
||||
uiFontStyle paneltitle;
|
||||
uiFontStyle grouplabel;
|
||||
uiFontStyle widget;
|
||||
uiFontStyle tooltip;
|
||||
|
||||
float panelzoom;
|
||||
|
||||
/** In characters. */
|
||||
short minlabelchars;
|
||||
/** In characters. */
|
||||
short minwidgetchars;
|
||||
|
||||
short columnspace;
|
||||
short templatespace;
|
||||
short boxspace;
|
||||
short buttonspacex;
|
||||
short buttonspacey;
|
||||
short panelspace;
|
||||
short panelouter;
|
||||
|
||||
char _pad0[2];
|
||||
} uiStyle;
|
||||
|
||||
typedef struct ThemeRegionsAssetShelf {
|
||||
unsigned char back[4];
|
||||
unsigned char header_back[4];
|
||||
} ThemeRegionsAssetShelf;
|
||||
|
||||
typedef struct ThemeRegionsChannels {
|
||||
unsigned char back[4];
|
||||
unsigned char text[4];
|
||||
unsigned char text_selected[4];
|
||||
char _pad0[4];
|
||||
} ThemeRegionsChannels;
|
||||
|
||||
typedef struct ThemeRegionsScrubbing {
|
||||
unsigned char back[4];
|
||||
unsigned char text[4];
|
||||
unsigned char time_marker[4], time_marker_selected[4];
|
||||
} ThemeRegionsScrubbing;
|
||||
|
||||
typedef struct ThemeRegionsSidebars {
|
||||
unsigned char back[4];
|
||||
unsigned char tab_back[4];
|
||||
} ThemeRegionsSidebars;
|
||||
|
||||
typedef struct ThemeRegions {
|
||||
ThemeRegionsAssetShelf asset_shelf;
|
||||
ThemeRegionsChannels channels;
|
||||
ThemeRegionsScrubbing scrubbing;
|
||||
ThemeRegionsSidebars sidebars;
|
||||
} ThemeRegions;
|
||||
|
||||
typedef struct ThemeCommonAnim {
|
||||
unsigned char playhead[4];
|
||||
unsigned char preview_range[4];
|
||||
|
||||
unsigned char channels[4], channels_sub[4];
|
||||
unsigned char channel_group[4], channel_group_active[4];
|
||||
unsigned char channel[4], channel_selected[4];
|
||||
|
||||
/** Key-types. */
|
||||
unsigned char keyframe[4], keyframe_extreme[4], keyframe_breakdown[4], keyframe_jitter[4],
|
||||
keyframe_moving_hold[4], keyframe_generated[4];
|
||||
unsigned char keyframe_selected[4], keyframe_extreme_selected[4], keyframe_breakdown_selected[4],
|
||||
keyframe_jitter_selected[4], keyframe_moving_hold_selected[4],
|
||||
keyframe_generated_selected[4];
|
||||
unsigned char long_key[4], long_key_selected[4];
|
||||
|
||||
unsigned char scene_strip_range[4];
|
||||
char _pad0[4];
|
||||
} ThemeCommonAnim;
|
||||
|
||||
typedef struct ThemeCommonCurves {
|
||||
/** Curve handles. */
|
||||
unsigned char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4],
|
||||
handle_auto_clamped[4];
|
||||
unsigned char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4],
|
||||
handle_sel_auto_clamped[4];
|
||||
|
||||
/** Curve points. */
|
||||
unsigned char handle_vertex[4];
|
||||
unsigned char handle_vertex_select[4];
|
||||
unsigned char handle_vertex_size;
|
||||
|
||||
char _pad0[3];
|
||||
} ThemeCommonCurves;
|
||||
|
||||
typedef struct ThemeCommon {
|
||||
ThemeCommonAnim anim;
|
||||
ThemeCommonCurves curves;
|
||||
char _pad0[4];
|
||||
} ThemeCommon;
|
||||
|
||||
typedef struct uiWidgetColors {
|
||||
unsigned char outline[4];
|
||||
unsigned char outline_sel[4];
|
||||
unsigned char inner[4];
|
||||
unsigned char inner_sel[4];
|
||||
unsigned char item[4];
|
||||
unsigned char text[4];
|
||||
unsigned char text_sel[4];
|
||||
unsigned char shaded;
|
||||
char _pad0[3];
|
||||
short shadetop, shadedown;
|
||||
float roundness;
|
||||
} uiWidgetColors;
|
||||
|
||||
typedef struct uiWidgetStateColors {
|
||||
unsigned char error[4];
|
||||
unsigned char warning[4];
|
||||
unsigned char info[4];
|
||||
unsigned char success[4];
|
||||
unsigned char inner_anim[4];
|
||||
unsigned char inner_anim_sel[4];
|
||||
unsigned char inner_key[4];
|
||||
unsigned char inner_key_sel[4];
|
||||
unsigned char inner_driven[4];
|
||||
unsigned char inner_driven_sel[4];
|
||||
unsigned char inner_overridden[4];
|
||||
unsigned char inner_overridden_sel[4];
|
||||
unsigned char inner_changed[4];
|
||||
unsigned char inner_changed_sel[4];
|
||||
float blend;
|
||||
char _pad0[4];
|
||||
} uiWidgetStateColors;
|
||||
|
||||
typedef struct ThemeUI {
|
||||
/* Interface Elements (buttons, menus, icons) */
|
||||
uiWidgetColors wcol_regular, wcol_tool, wcol_toolbar_item, wcol_text;
|
||||
uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
|
||||
uiWidgetColors wcol_num, wcol_numslider, wcol_tab, wcol_curve;
|
||||
uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip;
|
||||
uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item, wcol_pie_menu;
|
||||
|
||||
uiWidgetStateColors wcol_state;
|
||||
|
||||
unsigned char widget_emboss[4];
|
||||
|
||||
/* fac: 0 - 1 for blend factor, width in pixels */
|
||||
float menu_shadow_fac;
|
||||
short menu_shadow_width;
|
||||
|
||||
unsigned char editor_border[4];
|
||||
unsigned char editor_outline[4];
|
||||
unsigned char editor_outline_active[4];
|
||||
|
||||
/* Transparent Grid */
|
||||
unsigned char transparent_checker_primary[4], transparent_checker_secondary[4];
|
||||
unsigned char transparent_checker_size;
|
||||
unsigned char link[4];
|
||||
char _pad1[1];
|
||||
|
||||
float icon_alpha;
|
||||
float icon_saturation;
|
||||
unsigned char widget_text_cursor[4];
|
||||
|
||||
/* Axis Colors */
|
||||
unsigned char xaxis[4], yaxis[4], zaxis[4], waxis[4];
|
||||
|
||||
/* Gizmo Colors. */
|
||||
unsigned char gizmo_hi[4];
|
||||
unsigned char gizmo_primary[4];
|
||||
unsigned char gizmo_secondary[4];
|
||||
unsigned char gizmo_view_align[4];
|
||||
unsigned char gizmo_a[4];
|
||||
unsigned char gizmo_b[4];
|
||||
|
||||
/* Icon Colors. */
|
||||
/** Scene items. */
|
||||
unsigned char icon_scene[4];
|
||||
/** Collection items. */
|
||||
unsigned char icon_collection[4];
|
||||
/** Object items. */
|
||||
unsigned char icon_object[4];
|
||||
/** Object data items. */
|
||||
unsigned char icon_object_data[4];
|
||||
/** Modifier and constraint items. */
|
||||
unsigned char icon_modifier[4];
|
||||
/** Shading related items. */
|
||||
unsigned char icon_shading[4];
|
||||
/** File folders. */
|
||||
unsigned char icon_folder[4];
|
||||
/** Auto Keying indicator. */
|
||||
unsigned char icon_autokey[4];
|
||||
char _pad3[4];
|
||||
/** Intensity of the border icons. >0 will render an border around themed
|
||||
* icons. */
|
||||
float icon_border_intensity;
|
||||
/* Panels. */
|
||||
float panel_roundness;
|
||||
unsigned char panel_header[4];
|
||||
unsigned char panel_back[4];
|
||||
unsigned char panel_sub_back[4];
|
||||
unsigned char panel_outline[4];
|
||||
unsigned char panel_title[4];
|
||||
unsigned char panel_text[4];
|
||||
unsigned char panel_active[4];
|
||||
|
||||
} ThemeUI;
|
||||
|
||||
/* try to put them all in one, if needed a special struct can be created as well
|
||||
* for example later on, when we introduce wire colors for ob types or so...
|
||||
*/
|
||||
typedef struct ThemeSpace {
|
||||
/* main window colors */
|
||||
unsigned char back[4];
|
||||
unsigned char back_grad[4];
|
||||
|
||||
char background_type;
|
||||
char _pad0[3];
|
||||
|
||||
/** Panel title. */
|
||||
unsigned char title[4];
|
||||
unsigned char text[4];
|
||||
unsigned char text_hi[4];
|
||||
|
||||
/* header colors */
|
||||
/** Region background. */
|
||||
unsigned char header[4];
|
||||
/** Unused. */
|
||||
unsigned char header_title[4];
|
||||
unsigned char header_text[4];
|
||||
unsigned char header_text_hi[4];
|
||||
|
||||
/* button/tool regions */
|
||||
unsigned char shade1[4];
|
||||
unsigned char shade2[4];
|
||||
|
||||
unsigned char hilite[4];
|
||||
unsigned char grid[4], grid_major[4];
|
||||
float grid_axis_brightness;
|
||||
|
||||
unsigned char view_overlay[4];
|
||||
|
||||
unsigned char wire[4], wire_edit[4], select[4];
|
||||
unsigned char lamp[4], speaker[4], empty[4], camera[4];
|
||||
unsigned char active[4], transform[4];
|
||||
unsigned char vertex[4], vertex_select[4], vertex_active[4], vertex_unreferenced[4];
|
||||
unsigned char edge[4], edge_select[4], edge_mode_select[4];
|
||||
/** Solid faces. */
|
||||
unsigned char face[4], face_select[4], face_mode_select[4], face_retopology[4];
|
||||
unsigned char face_back[4], face_front[4];
|
||||
/** Selected color. */
|
||||
unsigned char extra_edge_len[4], extra_edge_angle[4], extra_face_angle[4], extra_face_area[4];
|
||||
unsigned char normal[4];
|
||||
unsigned char vertex_normal[4];
|
||||
unsigned char loop_normal[4];
|
||||
unsigned char bone_solid[4], bone_pose[4], bone_pose_active[4], bone_locked_weight[4];
|
||||
unsigned char strip[4], strip_select[4];
|
||||
unsigned char before_current_frame[4], after_current_frame[4];
|
||||
unsigned char time_gp_keyframe[4];
|
||||
|
||||
/** Geometry attributes. */
|
||||
unsigned char bevel[4], seam[4], sharp[4], crease[4], freestyle[4];
|
||||
|
||||
unsigned char nurb_uline[4], nurb_vline[4];
|
||||
unsigned char nurb_sel_uline[4], nurb_sel_vline[4];
|
||||
|
||||
/** Dope-sheet. */
|
||||
unsigned char anim_interpolation_linear[4], anim_interpolation_constant[4],
|
||||
anim_interpolation_other[4];
|
||||
/** Keyframe border. */
|
||||
unsigned char keyborder[4], keyborder_select[4];
|
||||
char _pad4[3];
|
||||
|
||||
unsigned char console_output[4], console_input[4], console_info[4], console_error[4];
|
||||
unsigned char console_cursor[4], console_select[4];
|
||||
|
||||
unsigned char vertex_size, edge_width, outline_width, obcenter_dia, facedot_size;
|
||||
unsigned char noodle_curving;
|
||||
unsigned char grid_levels;
|
||||
char _pad2[2];
|
||||
float dash_alpha;
|
||||
|
||||
/* Syntax for text-window and nodes. */
|
||||
unsigned char syntaxl[4], syntaxs[4]; /* In node-space used for backdrop matte. */
|
||||
unsigned char syntaxb[4], syntaxn[4]; /* In node-space used for color input. */
|
||||
unsigned char syntaxv[4], syntaxc[4]; /* In node-space used for converter group. */
|
||||
unsigned char syntaxd[4], syntaxr[4]; /* In node-space used for distort. */
|
||||
|
||||
unsigned char line_numbers[4];
|
||||
|
||||
unsigned char node_outline[4];
|
||||
|
||||
unsigned char nodeclass_output[4], nodeclass_filter[4];
|
||||
unsigned char nodeclass_vector[4], nodeclass_texture[4];
|
||||
unsigned char nodeclass_shader[4], nodeclass_script[4];
|
||||
unsigned char nodeclass_geometry[4], nodeclass_attribute[4];
|
||||
|
||||
unsigned char node_zone_simulation[4];
|
||||
unsigned char node_zone_repeat[4];
|
||||
unsigned char node_zone_foreach_geometry_element[4];
|
||||
unsigned char node_zone_closure[4];
|
||||
unsigned char simulated_frames[4];
|
||||
|
||||
/** For sequence editor. */
|
||||
unsigned char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];
|
||||
unsigned char effect[4], transition[4], meta[4], text_strip[4], color_strip[4];
|
||||
unsigned char active_strip[4], selected_strip[4], text_strip_cursor[4], selected_text[4];
|
||||
|
||||
/** For dope-sheet - scale factor for size of keyframes (i.e. height of channels). */
|
||||
float keyframe_scale_fac;
|
||||
|
||||
unsigned char editmesh_active[4];
|
||||
char _pad3[1];
|
||||
|
||||
unsigned char clipping_border_3d[4];
|
||||
|
||||
unsigned char marker_outline[4], marker[4], act_marker[4], sel_marker[4], dis_marker[4],
|
||||
lock_marker[4];
|
||||
unsigned char bundle_solid[4];
|
||||
unsigned char path_before[4], path_after[4];
|
||||
unsigned char path_keyframe_before[4], path_keyframe_after[4];
|
||||
unsigned char camera_path[4];
|
||||
unsigned char camera_passepartout[4];
|
||||
unsigned char _pad1[2];
|
||||
|
||||
unsigned char gp_wire_edit[4];
|
||||
unsigned char gp_vertex_size;
|
||||
unsigned char gp_vertex[4], gp_vertex_select[4];
|
||||
char _pad11[12];
|
||||
|
||||
unsigned char preview_back[4];
|
||||
unsigned char preview_stitch_face[4];
|
||||
unsigned char preview_stitch_edge[4];
|
||||
unsigned char preview_stitch_vert[4];
|
||||
unsigned char preview_stitch_stitchable[4];
|
||||
unsigned char preview_stitch_unstitchable[4];
|
||||
unsigned char preview_stitch_active[4];
|
||||
|
||||
/** Two uses, for uvs with modifier applied on mesh and uvs during painting. */
|
||||
unsigned char uv_shadow[4];
|
||||
|
||||
/** Search filter match, used for property search and in the outliner. */
|
||||
unsigned char match[4];
|
||||
/** Outliner - selected item. */
|
||||
unsigned char selected_highlight[4];
|
||||
/** Outliner - selected object. */
|
||||
unsigned char selected_object[4];
|
||||
/** Outliner - active object. */
|
||||
unsigned char active_object[4];
|
||||
/** Outliner - edited object. */
|
||||
unsigned char edited_object[4];
|
||||
/** Outliner - row color difference. */
|
||||
unsigned char row_alternate[4];
|
||||
|
||||
/** Skin modifier root color. */
|
||||
unsigned char skin_root[4];
|
||||
|
||||
/* NLA */
|
||||
/** Active Action + Summary Channel. */
|
||||
unsigned char anim_active[4];
|
||||
/** Active Action = NULL. */
|
||||
unsigned char anim_non_active[4];
|
||||
|
||||
/** NLA 'Tweaking' action/strip. */
|
||||
unsigned char nla_tweaking[4];
|
||||
/** NLA - warning color for duplicate instances of tweaking strip. */
|
||||
unsigned char nla_tweakdupli[4];
|
||||
|
||||
/** NLA "Transition" strips. */
|
||||
unsigned char nla_transition[4], nla_transition_sel[4];
|
||||
/** NLA "Meta" strips. */
|
||||
unsigned char nla_meta[4], nla_meta_sel[4];
|
||||
/** NLA "Sound" strips. */
|
||||
unsigned char nla_sound[4], nla_sound_sel[4];
|
||||
|
||||
/* info */
|
||||
unsigned char info_selected[4], info_selected_text[4];
|
||||
unsigned char info_error_text[4];
|
||||
unsigned char info_warning_text[4];
|
||||
unsigned char info_info_text[4];
|
||||
unsigned char info_debug[4], info_debug_text[4];
|
||||
unsigned char info_property[4], info_property_text[4];
|
||||
unsigned char info_operator[4], info_operator_text[4];
|
||||
|
||||
unsigned char metadatabg[4];
|
||||
unsigned char metadatatext[4];
|
||||
} ThemeSpace;
|
||||
|
||||
/* Viewport Background Gradient Types. */
|
||||
|
||||
typedef enum eBackgroundGradientTypes {
|
||||
TH_BACKGROUND_SINGLE_COLOR = 0,
|
||||
TH_BACKGROUND_GRADIENT_LINEAR = 1,
|
||||
TH_BACKGROUND_GRADIENT_RADIAL = 2,
|
||||
} eBackgroundGradientTypes;
|
||||
|
||||
/** Set of colors for use as a custom color set for Objects/Bones wire drawing. */
|
||||
typedef struct ThemeWireColor {
|
||||
unsigned char solid[4];
|
||||
unsigned char select[4];
|
||||
unsigned char active[4];
|
||||
|
||||
/** #eWireColor_Flags. */
|
||||
short flag;
|
||||
char _pad0[2];
|
||||
} ThemeWireColor;
|
||||
|
||||
/** #ThemeWireColor.flag */
|
||||
typedef enum eWireColor_Flags {
|
||||
TH_WIRECOLOR_CONSTCOLS = (1 << 0),
|
||||
/* TH_WIRECOLOR_TEXTCOLS = (1 << 1), */ /* UNUSED */
|
||||
} eWireColor_Flags;
|
||||
|
||||
typedef struct ThemeCollectionColor {
|
||||
unsigned char color[4];
|
||||
} ThemeCollectionColor;
|
||||
|
||||
typedef struct ThemeStripColor {
|
||||
unsigned char color[4];
|
||||
} ThemeStripColor;
|
||||
|
||||
/**
|
||||
* A theme.
|
||||
*
|
||||
* \note Currently only the first theme is used at once.
|
||||
* Different theme presets are stored as external files now.
|
||||
*/
|
||||
typedef struct bTheme {
|
||||
struct bTheme *next, *prev;
|
||||
char name[/*MAX_NAME*/ 64];
|
||||
|
||||
/* NOTE: Values after `name` are copied when resetting the default theme. */
|
||||
|
||||
/**
|
||||
* The file-path for the preset that was loaded into this theme.
|
||||
*
|
||||
* This is needed so it's possible to know if updating or removing a theme preset
|
||||
* should apply changes to the current theme.
|
||||
*/
|
||||
char filepath[/*FILE_MAX*/ 1024];
|
||||
|
||||
ThemeUI tui;
|
||||
|
||||
ThemeRegions regions;
|
||||
ThemeCommon common;
|
||||
|
||||
/**
|
||||
* Individual Space-types:
|
||||
* \note Ensure #UI_THEMESPACE_END is updated when adding.
|
||||
*/
|
||||
ThemeSpace space_properties;
|
||||
ThemeSpace space_view3d;
|
||||
ThemeSpace space_file;
|
||||
ThemeSpace space_graph;
|
||||
ThemeSpace space_info;
|
||||
ThemeSpace space_action;
|
||||
ThemeSpace space_nla;
|
||||
ThemeSpace space_sequencer;
|
||||
ThemeSpace space_image;
|
||||
ThemeSpace space_text;
|
||||
ThemeSpace space_outliner;
|
||||
ThemeSpace space_node;
|
||||
ThemeSpace space_preferences;
|
||||
ThemeSpace space_console;
|
||||
ThemeSpace space_clip;
|
||||
ThemeSpace space_topbar;
|
||||
ThemeSpace space_statusbar;
|
||||
ThemeSpace space_spreadsheet;
|
||||
|
||||
/* 20 sets of bone colors for this theme */
|
||||
ThemeWireColor tarm[20];
|
||||
// ThemeWireColor tobj[20];
|
||||
|
||||
/* See COLLECTION_COLOR_TOT for the number of collection colors. */
|
||||
ThemeCollectionColor collection_color[8];
|
||||
|
||||
/* See STRIP_COLOR_TOT for the total number of strip colors. */
|
||||
ThemeStripColor strip_color[9];
|
||||
|
||||
int active_theme_area;
|
||||
} bTheme;
|
||||
|
||||
#define UI_THEMESPACE_START(btheme) \
|
||||
(CHECK_TYPE_INLINE(btheme, bTheme *), &((btheme)->space_properties))
|
||||
#define UI_THEMESPACE_END(btheme) \
|
||||
(CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->space_spreadsheet) + 1))
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // namespace blender
|
||||
#endif
|
||||
616
blender-5.2.0/source/blender/makesdna/DNA_tracking_types.h
Normal file
616
blender-5.2.0/source/blender/makesdna/DNA_tracking_types.h
Normal file
@@ -0,0 +1,616 @@
|
||||
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Structs used for camera tracking and the movie-clip editor.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* match-moving data */
|
||||
|
||||
struct Image;
|
||||
struct MovieReconstructedCamera;
|
||||
struct MovieTracking;
|
||||
struct MovieTrackingCamera;
|
||||
struct MovieTrackingMarker;
|
||||
struct MovieTrackingTrack;
|
||||
struct bGPdata;
|
||||
|
||||
enum TrackingDistortionModel : short {
|
||||
TRACKING_DISTORTION_MODEL_POLYNOMIAL = 0,
|
||||
TRACKING_DISTORTION_MODEL_DIVISION = 1,
|
||||
TRACKING_DISTORTION_MODEL_NUKE = 2,
|
||||
TRACKING_DISTORTION_MODEL_BROWN = 3,
|
||||
};
|
||||
|
||||
enum TrackingCameraUnits : short {
|
||||
CAMERA_UNITS_PX = 0,
|
||||
CAMERA_UNITS_MM = 1,
|
||||
};
|
||||
|
||||
enum TrackingMarkerFlag : int {
|
||||
MARKER_DISABLED = (1 << 0),
|
||||
MARKER_TRACKED = (1 << 1),
|
||||
MARKER_GRAPH_SEL_X = (1 << 2),
|
||||
MARKER_GRAPH_SEL_Y = (1 << 3),
|
||||
MARKER_GRAPH_SEL = (MARKER_GRAPH_SEL_X | MARKER_GRAPH_SEL_Y),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingMarkerFlag)
|
||||
|
||||
enum TrackingTrackFlag : int {
|
||||
TRACK_SELECT = (1 << 0),
|
||||
TRACK_HAS_BUNDLE = (1 << 1),
|
||||
TRACK_DISABLE_RED = (1 << 2),
|
||||
TRACK_DISABLE_GREEN = (1 << 3),
|
||||
TRACK_DISABLE_BLUE = (1 << 4),
|
||||
TRACK_HIDDEN = (1 << 5),
|
||||
TRACK_LOCKED = (1 << 6),
|
||||
TRACK_CUSTOMCOLOR = (1 << 7),
|
||||
TRACK_USE_2D_STAB = (1 << 8),
|
||||
TRACK_PREVIEW_GRAYSCALE = (1 << 9),
|
||||
TRACK_DOPE_SEL = (1 << 10),
|
||||
TRACK_PREVIEW_ALPHA = (1 << 11),
|
||||
TRACK_USE_2D_STAB_ROT = (1 << 12),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingTrackFlag)
|
||||
|
||||
enum TrackingMotionModel : short {
|
||||
TRACK_MOTION_MODEL_TRANSLATION = 0,
|
||||
TRACK_MOTION_MODEL_TRANSLATION_ROTATION = 1,
|
||||
TRACK_MOTION_MODEL_TRANSLATION_SCALE = 2,
|
||||
TRACK_MOTION_MODEL_TRANSLATION_ROTATION_SCALE = 3,
|
||||
TRACK_MOTION_MODEL_AFFINE = 4,
|
||||
TRACK_MOTION_MODEL_HOMOGRAPHY = 5,
|
||||
};
|
||||
|
||||
enum TrackingAlgorithmFlag : int {
|
||||
TRACK_ALGORITHM_FLAG_USE_BRUTE = (1 << 0),
|
||||
TRACK_ALGORITHM_FLAG_USE_NORMALIZATION = (1 << 2),
|
||||
TRACK_ALGORITHM_FLAG_USE_MASK = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingAlgorithmFlag)
|
||||
|
||||
enum eTrackFrameMatch : short {
|
||||
TRACK_MATCH_KEYFRAME = 0,
|
||||
TRACK_MATCH_PREVIOUS_FRAME = 1,
|
||||
};
|
||||
|
||||
enum TrackingMotionFlag : short {
|
||||
TRACKING_MOTION_TRIPOD = (1 << 0),
|
||||
TRACKING_MOTION_MODAL = (TRACKING_MOTION_TRIPOD),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingMotionFlag)
|
||||
|
||||
enum TrackingSpeed : short {
|
||||
TRACKING_SPEED_FASTEST = 0,
|
||||
TRACKING_SPEED_REALTIME = 1,
|
||||
TRACKING_SPEED_HALF = 2,
|
||||
TRACKING_SPEED_QUARTER = 4,
|
||||
TRACKING_SPEED_DOUBLE = 5,
|
||||
};
|
||||
|
||||
enum TrackingSettingsReconstructionFlag : int {
|
||||
/* TRACKING_USE_FALLBACK_RECONSTRUCTION = (1 << 0), */ /* DEPRECATED */
|
||||
TRACKING_USE_KEYFRAME_SELECTION = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingSettingsReconstructionFlag)
|
||||
|
||||
enum TrackingRefineCameraFlag : int {
|
||||
REFINE_NO_INTRINSICS = (0),
|
||||
|
||||
REFINE_FOCAL_LENGTH = (1 << 0),
|
||||
REFINE_PRINCIPAL_POINT = (1 << 1),
|
||||
REFINE_RADIAL_DISTORTION = (1 << 2),
|
||||
REFINE_TANGENTIAL_DISTORTION = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingRefineCameraFlag)
|
||||
|
||||
enum TrackingStabilizationFlag : int {
|
||||
TRACKING_2D_STABILIZATION = (1 << 0),
|
||||
TRACKING_AUTOSCALE = (1 << 1),
|
||||
TRACKING_STABILIZE_ROTATION = (1 << 2),
|
||||
TRACKING_STABILIZE_SCALE = (1 << 3),
|
||||
TRACKING_SHOW_STAB_TRACKS = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingStabilizationFlag)
|
||||
|
||||
enum TrackingStabilizationFilter : int {
|
||||
TRACKING_FILTER_NEAREST = 0,
|
||||
TRACKING_FILTER_BILINEAR = 1,
|
||||
TRACKING_FILTER_BICUBIC = 2,
|
||||
};
|
||||
|
||||
enum TrackingReconstructionFlag : int {
|
||||
TRACKING_RECONSTRUCTED = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingReconstructionFlag)
|
||||
|
||||
enum TrackingObjectFlag : int {
|
||||
TRACKING_OBJECT_CAMERA = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingObjectFlag)
|
||||
|
||||
enum TrackingDopesheetSort : short {
|
||||
TRACKING_DOPE_SORT_NAME = 0,
|
||||
TRACKING_DOPE_SORT_LONGEST = 1,
|
||||
TRACKING_DOPE_SORT_TOTAL = 2,
|
||||
TRACKING_DOPE_SORT_AVERAGE_ERROR = 3,
|
||||
TRACKING_DOPE_SORT_START = 4,
|
||||
TRACKING_DOPE_SORT_END = 5,
|
||||
};
|
||||
|
||||
enum TrackingDopesheetFlag : short {
|
||||
TRACKING_DOPE_SORT_INVERSE = (1 << 0),
|
||||
TRACKING_DOPE_SELECTED_ONLY = (1 << 1),
|
||||
TRACKING_DOPE_SHOW_HIDDEN = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingDopesheetFlag)
|
||||
|
||||
enum TrackingCoverage : int {
|
||||
TRACKING_COVERAGE_BAD = 0,
|
||||
TRACKING_COVERAGE_ACCEPTABLE = 1,
|
||||
TRACKING_COVERAGE_OK = 2,
|
||||
};
|
||||
|
||||
enum TrackingPlaneMarkerFlag : int {
|
||||
PLANE_MARKER_DISABLED = (1 << 0),
|
||||
PLANE_MARKER_TRACKED = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingPlaneMarkerFlag)
|
||||
|
||||
enum TrackingPlaneTrackFlag : int {
|
||||
PLANE_TRACK_SELECT = (1 << 0),
|
||||
PLANE_TRACK_HIDDEN = (1 << 1),
|
||||
PLANE_TRACK_LOCKED = (1 << 2),
|
||||
PLANE_TRACK_AUTOKEY = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(TrackingPlaneTrackFlag)
|
||||
|
||||
struct MovieReconstructedCamera {
|
||||
int framenr = 0;
|
||||
float error = 0;
|
||||
float mat[4][4] = {};
|
||||
};
|
||||
|
||||
struct MovieTrackingCamera {
|
||||
/** Intrinsics handle. */
|
||||
void *intrinsics = nullptr;
|
||||
|
||||
TrackingDistortionModel distortion_model = TRACKING_DISTORTION_MODEL_POLYNOMIAL;
|
||||
char _pad[2] = {};
|
||||
|
||||
/** Width of CCD sensor. */
|
||||
float sensor_width = 0;
|
||||
/** Pixel aspect ratio. */
|
||||
float pixel_aspect = 0;
|
||||
/** Focal length. */
|
||||
float focal = 0;
|
||||
/** Units of focal length user is working with. */
|
||||
TrackingCameraUnits units = CAMERA_UNITS_PX;
|
||||
char _pad1[2] = {};
|
||||
|
||||
/**
|
||||
* Principal point (optical center) stored in normalized coordinates.
|
||||
*
|
||||
* The normalized space stores principal point relative to the frame center which has normalized
|
||||
* principal coordinate of (0, 0). The right top corer of the frame corresponds to a normalized
|
||||
* principal coordinate of (1, 1), and the left bottom corner corresponds to coordinate of
|
||||
* (-1, -1).
|
||||
*/
|
||||
float principal_point[2] = {};
|
||||
|
||||
/** Legacy principal point in pixel space. */
|
||||
float principal_legacy[2] = {};
|
||||
|
||||
/* Polynomial distortion */
|
||||
/** Polynomial radial distortion. */
|
||||
float k1 = 0, k2 = 0, k3 = 0;
|
||||
|
||||
/* Division distortion model coefficients */
|
||||
float division_k1 = 0, division_k2 = 0;
|
||||
|
||||
/* Nuke distortion model coefficients */
|
||||
float nuke_k1 = 0, nuke_k2 = 0;
|
||||
float nuke_p1 = 0, nuke_p2 = 0;
|
||||
|
||||
/* Brown-Conrady distortion model coefficients */
|
||||
/** Brown-Conrady radial distortion. */
|
||||
float brown_k1 = 0, brown_k2 = 0, brown_k3 = 0, brown_k4 = 0;
|
||||
/** Brown-Conrady tangential distortion. */
|
||||
float brown_p1 = 0, brown_p2 = 0;
|
||||
};
|
||||
|
||||
struct MovieTrackingMarker {
|
||||
/** 2d position of marker on frame (in unified 0..1 space). */
|
||||
float pos[2] = {0.0f, 0.0f};
|
||||
|
||||
/* corners of pattern in the following order:
|
||||
*
|
||||
* Y
|
||||
* ^
|
||||
* | (3) --- (2)
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | (0) --- (1)
|
||||
* +-------------> X
|
||||
*
|
||||
* the coordinates are stored relative to pos.
|
||||
*/
|
||||
float pattern_corners[4][2] = {};
|
||||
|
||||
/* positions of left-bottom and right-top corners of search area (in unified 0..1 units,
|
||||
* relative to marker->pos)
|
||||
*/
|
||||
float search_min[2] = {}, search_max[2] = {};
|
||||
|
||||
/** Number of frame marker is associated with. */
|
||||
int framenr = 0;
|
||||
/** Marker's flag (alive, ...). */
|
||||
TrackingMarkerFlag flag = {};
|
||||
};
|
||||
|
||||
struct MovieTrackingTrack {
|
||||
struct MovieTrackingTrack *next = nullptr, *prev = nullptr;
|
||||
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/* ** settings ** */
|
||||
|
||||
/* positions of left-bottom and right-top corners of pattern (in unified 0..1 units,
|
||||
* relative to marker->pos)
|
||||
* moved to marker's corners since planar tracking implementation
|
||||
*/
|
||||
float pat_min_legacy[2] = {}, pat_max_legacy[2] = {};
|
||||
|
||||
/* positions of left-bottom and right-top corners of search area (in unified 0..1 units,
|
||||
* relative to marker->pos)
|
||||
* moved to marker since affine tracking implementation
|
||||
*/
|
||||
float search_min_legacy[2] = {}, search_max_legacy[2] = {};
|
||||
|
||||
/** Offset to "parenting" point. */
|
||||
float offset[2] = {};
|
||||
|
||||
/* ** track ** */
|
||||
/** Count of markers in track. */
|
||||
int markersnr = 0;
|
||||
/** Most recently used marker. */
|
||||
int _pad = {};
|
||||
/** Markers in track. */
|
||||
MovieTrackingMarker *markers = nullptr;
|
||||
|
||||
/* ** reconstruction data ** */
|
||||
/** Reconstructed position. */
|
||||
float bundle_pos[3] = {};
|
||||
/** Average track reprojection error. */
|
||||
float error = 0;
|
||||
|
||||
/* ** UI editing ** */
|
||||
/** Flags (selection, ...). */
|
||||
TrackingTrackFlag flag = {}, pat_flag = {}, search_flag = {};
|
||||
/** Custom color for track. */
|
||||
float color[3] = {};
|
||||
|
||||
/* ** control how tracking happens */
|
||||
/**
|
||||
* Number of frames to be tracked during single tracking session
|
||||
* (if TRACKING_FRAMES_LIMIT is set).
|
||||
*/
|
||||
short frames_limit = 0;
|
||||
/** Margin from frame boundaries. */
|
||||
short margin = 0;
|
||||
/** Denotes which frame is used for the reference during tracking. */
|
||||
eTrackFrameMatch pattern_match = TRACK_MATCH_KEYFRAME;
|
||||
|
||||
/* tracking parameters */
|
||||
/** Model of the motion for this track. */
|
||||
TrackingMotionModel motion_model = TRACK_MOTION_MODEL_TRANSLATION;
|
||||
/** Flags for the tracking algorithm (use brute, use ESM, use pyramid, etc),
|
||||
* #TrackingAlgorithmFlag. */
|
||||
TrackingAlgorithmFlag algorithm_flag = {};
|
||||
/** Minimal correlation which is still treated as successful tracking. */
|
||||
float minimum_correlation = 0;
|
||||
|
||||
/** Grease-pencil data. */
|
||||
struct bGPdata *gpd = nullptr;
|
||||
|
||||
/* Weight of this track.
|
||||
*
|
||||
* Weight defines how much the track affects on the final reconstruction,
|
||||
* usually gets animated in a way so when track has just appeared its
|
||||
* weight is zero and then it gets faded up.
|
||||
*
|
||||
* Used to prevent jumps of the camera when tracks are appearing or
|
||||
* disappearing.
|
||||
*/
|
||||
float weight = 0;
|
||||
|
||||
/* track weight especially for 2D stabilization */
|
||||
float weight_stab = 0;
|
||||
};
|
||||
|
||||
struct MovieTrackingPlaneMarker {
|
||||
/* Corners of the plane in the following order:
|
||||
*
|
||||
* Y
|
||||
* ^
|
||||
* | (3) --- (2)
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | (0) --- (1)
|
||||
* +-------------> X
|
||||
*
|
||||
* The coordinates are stored in frame normalized coordinates.
|
||||
*/
|
||||
float corners[4][2] = {};
|
||||
|
||||
/** Number of frame plane marker is associated with. */
|
||||
int framenr = 0;
|
||||
/** Marker's flag (alive, ...). */
|
||||
TrackingPlaneMarkerFlag flag = {};
|
||||
};
|
||||
|
||||
struct MovieTrackingPlaneTrack {
|
||||
struct MovieTrackingPlaneTrack *next = nullptr, *prev = nullptr;
|
||||
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
|
||||
/**
|
||||
* Array of point tracks used to define this plane.
|
||||
* Each element is a pointer to MovieTrackingTrack.
|
||||
*/
|
||||
MovieTrackingTrack **point_tracks = nullptr;
|
||||
/** Number of tracks in point_tracks array. */
|
||||
int point_tracksnr = 0;
|
||||
char _pad[4] = {};
|
||||
|
||||
/** Markers in the plane track. */
|
||||
MovieTrackingPlaneMarker *markers = nullptr;
|
||||
/** Count of markers in track (size of markers array). */
|
||||
int markersnr = 0;
|
||||
|
||||
/** Flags (selection, ...). */
|
||||
TrackingPlaneTrackFlag flag = {};
|
||||
|
||||
/** Image displaying during editing. */
|
||||
struct Image *image = nullptr;
|
||||
/** Opacity of the image. */
|
||||
float image_opacity = 0;
|
||||
|
||||
/* Runtime data */
|
||||
/** Most recently used marker. */
|
||||
int last_marker = 0;
|
||||
};
|
||||
|
||||
struct MovieTrackingSettings {
|
||||
/* ** default tracker settings */
|
||||
/** Model of the motion for this track. */
|
||||
TrackingMotionModel default_motion_model = TRACK_MOTION_MODEL_TRANSLATION;
|
||||
short _pad = {};
|
||||
/** Flags for the tracking algorithm (use brute, use ESM, use pyramid, etc.),
|
||||
* #TrackingAlgorithmFlag. */
|
||||
TrackingAlgorithmFlag default_algorithm_flag = {};
|
||||
/** Minimal correlation which is still treated as successful tracking. */
|
||||
float default_minimum_correlation = 0;
|
||||
/** Size of pattern area for new tracks, measured in pixels. */
|
||||
short default_pattern_size = 0;
|
||||
/** Size of search area for new tracks, measured in pixels. */
|
||||
short default_search_size = 0;
|
||||
/** Number of frames to be tracked during single tracking session
|
||||
* (if TRACKING_FRAMES_LIMIT is set). */
|
||||
short default_frames_limit = 0;
|
||||
/** Margin from frame boundaries. */
|
||||
short default_margin = 0;
|
||||
/** Denotes which frame is used for the reference during tracking. */
|
||||
eTrackFrameMatch default_pattern_match = TRACK_MATCH_KEYFRAME;
|
||||
short _pad1 = {};
|
||||
/** Default flags like color channels used by default. */
|
||||
TrackingTrackFlag default_flag = {};
|
||||
/** Default weight of the track. */
|
||||
float default_weight = 0;
|
||||
|
||||
/** Flags describes motion type. */
|
||||
TrackingMotionFlag motion_flag = {};
|
||||
|
||||
/* ** common tracker settings ** */
|
||||
/** Speed of tracking. */
|
||||
TrackingSpeed speed = TRACKING_SPEED_FASTEST;
|
||||
|
||||
/* ** reconstruction settings ** */
|
||||
/* two keyframes for reconstruction initialization
|
||||
* were moved to per-tracking object settings
|
||||
*/
|
||||
int keyframe1_legacy = 0;
|
||||
int keyframe2_legacy = 0;
|
||||
|
||||
TrackingSettingsReconstructionFlag reconstruction_flag = {};
|
||||
|
||||
/* Which camera intrinsics to refine. */
|
||||
TrackingRefineCameraFlag refine_camera_intrinsics = REFINE_NO_INTRINSICS;
|
||||
|
||||
/* ** tool settings ** */
|
||||
|
||||
/* set scale */
|
||||
/** Distance between two bundles used for scene scaling. */
|
||||
float dist = 0;
|
||||
|
||||
/* cleanup */
|
||||
int clean_frames = 0, clean_action = 0;
|
||||
float clean_error = 0;
|
||||
|
||||
/* set object scale */
|
||||
/** Distance between two bundles used for object scaling. */
|
||||
float object_distance = 0;
|
||||
};
|
||||
|
||||
struct MovieTrackingStabilization {
|
||||
TrackingStabilizationFlag flag = {};
|
||||
/** Total number of translation tracks and index of active track in list. */
|
||||
int tot_track = 0, act_track = 0;
|
||||
/** Total number of rotation tracks and index of active track in list. */
|
||||
int tot_rot_track = 0, act_rot_track = 0;
|
||||
|
||||
/* 2d stabilization */
|
||||
/** Max auto-scale factor. */
|
||||
float maxscale = 0;
|
||||
/** Use TRACK_USE_2D_STAB_ROT on individual tracks instead. */
|
||||
MovieTrackingTrack *rot_track_legacy = nullptr;
|
||||
|
||||
/** Reference point to anchor stabilization offset. */
|
||||
int anchor_frame = 0;
|
||||
/** Expected target position of frame after raw stabilization, will be subtracted. */
|
||||
float target_pos[2] = {};
|
||||
/** Expected target rotation of frame after raw stabilization, will be compensated. */
|
||||
float target_rot = 0;
|
||||
/** Zoom factor known to be present on original footage. Also used for auto-scale. */
|
||||
float scale = 0;
|
||||
|
||||
/** Influence on location, scale and rotation. */
|
||||
float locinf = 0, scaleinf = 0, rotinf = 0;
|
||||
|
||||
/** Filter used for pixel interpolation. */
|
||||
TrackingStabilizationFilter filter = TRACKING_FILTER_NEAREST;
|
||||
|
||||
int _pad = {};
|
||||
};
|
||||
|
||||
struct MovieTrackingReconstruction {
|
||||
TrackingReconstructionFlag flag = {};
|
||||
|
||||
/** Average error of reconstruction. */
|
||||
float error = 0;
|
||||
|
||||
/** Most recently used camera. */
|
||||
int last_camera = 0;
|
||||
/** Number of reconstructed cameras. */
|
||||
int camnr = 0;
|
||||
/** Reconstructed cameras. */
|
||||
struct MovieReconstructedCamera *cameras = nullptr;
|
||||
};
|
||||
|
||||
struct MovieTrackingObject {
|
||||
struct MovieTrackingObject *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Name of tracking object. */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
TrackingObjectFlag flag = {};
|
||||
/** Scale of object solution in camera space. */
|
||||
float scale = 0;
|
||||
|
||||
/** Lists of point and plane tracks use to tracking this object. */
|
||||
ListBaseT<MovieTrackingTrack> tracks = {nullptr, nullptr};
|
||||
ListBaseT<MovieTrackingPlaneTrack> plane_tracks = {nullptr, nullptr};
|
||||
|
||||
/** Active point and plane tracks. */
|
||||
MovieTrackingTrack *active_track = nullptr;
|
||||
MovieTrackingPlaneTrack *active_plane_track = nullptr;
|
||||
|
||||
/** Reconstruction data for this object. */
|
||||
MovieTrackingReconstruction reconstruction;
|
||||
|
||||
/* reconstruction options */
|
||||
/** Two keyframes for reconstruction initialization. */
|
||||
int keyframe1 = 0, keyframe2 = 0;
|
||||
};
|
||||
|
||||
struct MovieTrackingStats {
|
||||
char message[256] = "";
|
||||
};
|
||||
|
||||
struct MovieTrackingDopesheetChannel {
|
||||
struct MovieTrackingDopesheetChannel *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Motion track for which channel is created. */
|
||||
MovieTrackingTrack *track = nullptr;
|
||||
char _pad[4] = {};
|
||||
|
||||
/** Name of channel. */
|
||||
char name[64] = "";
|
||||
|
||||
/** Total number of segments. */
|
||||
int tot_segment = 0;
|
||||
/** Tracked segments. */
|
||||
int *segments = nullptr;
|
||||
/** Longest segment length and total number of tracked frames. */
|
||||
int max_segment = 0, total_frames = 0;
|
||||
/** These numbers are valid only if tot_segment > 0. */
|
||||
int first_not_disabled_marker_framenr = 0, last_not_disabled_marker_framenr = 0;
|
||||
};
|
||||
|
||||
struct MovieTrackingDopesheetCoverageSegment {
|
||||
struct MovieTrackingDopesheetCoverageSegment *next = nullptr, *prev = nullptr;
|
||||
|
||||
TrackingCoverage coverage = TRACKING_COVERAGE_BAD;
|
||||
int start_frame = 0;
|
||||
int end_frame = 0;
|
||||
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct MovieTrackingDopesheet {
|
||||
/** Flag if dopesheet information is still relevant. */
|
||||
int ok = 0;
|
||||
|
||||
/** Method to be used to sort tracks. */
|
||||
TrackingDopesheetSort sort_method = TRACKING_DOPE_SORT_NAME;
|
||||
/** Dope-sheet building flag such as inverted order of sort. */
|
||||
TrackingDopesheetFlag flag = {};
|
||||
|
||||
/* ** runtime stuff ** */
|
||||
|
||||
/* summary */
|
||||
ListBaseT<MovieTrackingDopesheetCoverageSegment> coverage_segments = {nullptr, nullptr};
|
||||
|
||||
/* detailed */
|
||||
ListBaseT<MovieTrackingDopesheetChannel> channels = {nullptr, nullptr};
|
||||
int tot_channel = 0;
|
||||
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct MovieTracking {
|
||||
/** Different tracking-related settings. */
|
||||
MovieTrackingSettings settings;
|
||||
/** Camera intrinsics. */
|
||||
MovieTrackingCamera camera;
|
||||
/** Lists of point and plane tracks used for camera object.
|
||||
* NOTE: Only left for the versioning purposes. */
|
||||
ListBaseT<MovieTrackingTrack> tracks_legacy = {nullptr, nullptr};
|
||||
ListBaseT<MovieTrackingPlaneTrack> plane_tracks_legacy = {nullptr, nullptr};
|
||||
|
||||
/** Reconstruction data for camera object.
|
||||
* NOTE: Only left for the versioning purposes. */
|
||||
MovieTrackingReconstruction reconstruction_legacy;
|
||||
|
||||
/** Stabilization data. */
|
||||
MovieTrackingStabilization stabilization;
|
||||
|
||||
/** Active point and plane tracks.
|
||||
* NOTE: Only left for the versioning purposes. */
|
||||
MovieTrackingTrack *act_track_legacy = nullptr;
|
||||
MovieTrackingPlaneTrack *act_plane_track_legacy = nullptr;
|
||||
|
||||
ListBaseT<MovieTrackingObject> objects = {nullptr, nullptr};
|
||||
/** Index of active object and total number of objects. */
|
||||
int objectnr = 0, tot_object = 0;
|
||||
|
||||
/** Statistics displaying in clip editor. */
|
||||
MovieTrackingStats *stats = nullptr;
|
||||
|
||||
/** Dope-sheet data. */
|
||||
MovieTrackingDopesheet dopesheet;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
57
blender-5.2.0/source/blender/makesdna/DNA_userdef_enums.h
Normal file
57
blender-5.2.0/source/blender/makesdna/DNA_userdef_enums.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* #UserDef.dupflag
|
||||
*
|
||||
* The flag tells #BKE_object_duplicate() whether to copy data linked to the object,
|
||||
* or to reference the existing data.
|
||||
* #U.dupflag should be used for default operations or you can construct a flag as Python does.
|
||||
* If #eDupli_ID_Flags is 0 then no data will be copied (linked duplicate).
|
||||
*/
|
||||
enum eDupli_ID_Flags {
|
||||
USER_DUP_MESH = (1 << 0),
|
||||
USER_DUP_CURVE = (1 << 1),
|
||||
USER_DUP_SURF = (1 << 2),
|
||||
USER_DUP_FONT = (1 << 3),
|
||||
USER_DUP_MBALL = (1 << 4),
|
||||
USER_DUP_LAMP = (1 << 5),
|
||||
/* USER_DUP_FCURVE = (1 << 6), */ /* UNUSED, keep because we may implement. */
|
||||
USER_DUP_MAT = (1 << 7),
|
||||
/* USER_DUP_TEX = (1 << 8), */ /* UNUSED, keep because we may implement. */
|
||||
USER_DUP_ARM = (1 << 9),
|
||||
USER_DUP_ACT = (1 << 10),
|
||||
USER_DUP_PSYS = (1 << 11),
|
||||
USER_DUP_LIGHTPROBE = (1 << 12),
|
||||
USER_DUP_GPENCIL = (1 << 13),
|
||||
USER_DUP_CURVES = (1 << 14),
|
||||
USER_DUP_POINTCLOUD = (1 << 15),
|
||||
USER_DUP_VOLUME = (1 << 16),
|
||||
USER_DUP_LATTICE = (1 << 17),
|
||||
USER_DUP_CAMERA = (1 << 18),
|
||||
USER_DUP_SPEAKER = (1 << 19),
|
||||
USER_DUP_NTREE = (1 << 20),
|
||||
|
||||
USER_DUP_OBDATA = (~0) & ((1 << 24) - 1),
|
||||
|
||||
/* Those are not exposed as user preferences, only used internally. */
|
||||
USER_DUP_OBJECT = (1 << 24),
|
||||
/* USER_DUP_COLLECTION = (1 << 25), */ /* UNUSED, keep because we may implement. */
|
||||
|
||||
/* Duplicate (and hence make local) linked data. */
|
||||
USER_DUP_LINKED_ID = (1 << 30),
|
||||
};
|
||||
ENUM_OPERATORS(eDupli_ID_Flags)
|
||||
|
||||
} // namespace blender
|
||||
1283
blender-5.2.0/source/blender/makesdna/DNA_userdef_types.h
Normal file
1283
blender-5.2.0/source/blender/makesdna/DNA_userdef_types.h
Normal file
File diff suppressed because it is too large
Load Diff
35
blender-5.2.0/source/blender/makesdna/DNA_uuid_types.h
Normal file
35
blender-5.2.0/source/blender/makesdna/DNA_uuid_types.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* \brief Universally Unique Identifier according to RFC4122.
|
||||
*
|
||||
* Cannot be named simply `UUID`, because Windows already defines that type.
|
||||
*/
|
||||
struct bUUID {
|
||||
uint32_t time_low = 0;
|
||||
uint16_t time_mid = 0;
|
||||
uint16_t time_hi_and_version = 0;
|
||||
uint8_t clock_seq_hi_and_reserved = 0;
|
||||
uint8_t clock_seq_low = 0;
|
||||
uint8_t node[6] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Memory required for a string representation of a UUID according to RFC4122.
|
||||
* This is 36 characters for the string + a trailing zero byte.
|
||||
*/
|
||||
#define UUID_STRING_SIZE 37
|
||||
|
||||
} // namespace blender
|
||||
40
blender-5.2.0/source/blender/makesdna/DNA_vec_defaults.h
Normal file
40
blender-5.2.0/source/blender/makesdna/DNA_vec_defaults.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Struct members on own line. */
|
||||
/* clang-format off */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Generic Defaults
|
||||
* \{ */
|
||||
|
||||
/** See #unit_m4. */
|
||||
#define _DNA_DEFAULT_UNIT_M4 \
|
||||
{ \
|
||||
{1, 0, 0, 0}, \
|
||||
{0, 1, 0, 0}, \
|
||||
{0, 0, 1, 0}, \
|
||||
{0, 0, 0, 1}, \
|
||||
}
|
||||
|
||||
#define _DNA_DEFAULT_UNIT_M3 \
|
||||
{ \
|
||||
{1, 0, 0}, \
|
||||
{0, 1, 0}, \
|
||||
{0, 0, 1}, \
|
||||
}
|
||||
|
||||
/** See #unit_qt. */
|
||||
#define _DNA_DEFAULT_UNIT_QT \
|
||||
{1, 0, 0, 0}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* clang-format on */
|
||||
101
blender-5.2.0/source/blender/makesdna/DNA_vec_types.h
Normal file
101
blender-5.2.0/source/blender/makesdna/DNA_vec_types.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace blender {
|
||||
|
||||
/* types */
|
||||
|
||||
/** vector of two shorts. */
|
||||
struct vec2s {
|
||||
short x, y;
|
||||
};
|
||||
|
||||
/** vector of two floats. */
|
||||
struct vec2f {
|
||||
float x, y;
|
||||
};
|
||||
|
||||
struct vec2i {
|
||||
int x, y;
|
||||
};
|
||||
|
||||
/* not used at the moment */
|
||||
/*
|
||||
struct vec2d {
|
||||
double x, y;
|
||||
};
|
||||
*/
|
||||
struct vec3i {
|
||||
int x, y, z;
|
||||
};
|
||||
|
||||
struct vec3f {
|
||||
float x, y, z;
|
||||
};
|
||||
/*
|
||||
struct vec3d {
|
||||
double x, y, z;
|
||||
};
|
||||
|
||||
struct vec4i {
|
||||
int x, y, z, w;
|
||||
};
|
||||
*/
|
||||
struct vec4f {
|
||||
float x, y, z, w;
|
||||
};
|
||||
|
||||
/**
|
||||
* This type generally shouldn't be used. It only exists for cases where a DNA type that
|
||||
* corresponds to `blender:float4x4` is required. Note that `float4x4` is 16 byte aligned, but we
|
||||
* can't enforce that this struct yet.
|
||||
*/
|
||||
struct mat4x4f {
|
||||
float value[4][4];
|
||||
};
|
||||
/*
|
||||
struct vec4d {
|
||||
double x, y, z, w;
|
||||
};
|
||||
*/
|
||||
|
||||
/** integer rectangle. */
|
||||
struct rcti {
|
||||
int xmin, xmax;
|
||||
int ymin, ymax;
|
||||
|
||||
#ifdef __cplusplus
|
||||
bool operator==(const rcti &other) const
|
||||
{
|
||||
return xmin == other.xmin && xmax == other.xmax && ymin == other.ymin && ymax == other.ymax;
|
||||
}
|
||||
bool operator!=(const rcti &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
/** float rectangle. */
|
||||
struct rctf {
|
||||
float xmin, xmax;
|
||||
float ymin, ymax;
|
||||
};
|
||||
|
||||
/** dual quaternion. */
|
||||
struct DualQuat {
|
||||
float quat[4] = {};
|
||||
float trans[4] = {};
|
||||
|
||||
float scale[4][4] = {};
|
||||
float scale_weight = 0;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
41
blender-5.2.0/source/blender/makesdna/DNA_vfont_types.h
Normal file
41
blender-5.2.0/source/blender/makesdna/DNA_vfont_types.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Vector Fonts used for text in the 3D Viewport
|
||||
* (unrelated to text used to render the GUI).
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct PackedFile;
|
||||
struct VFontData;
|
||||
|
||||
struct VFont {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_VF;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
|
||||
struct VFontData *data = nullptr;
|
||||
struct PackedFile *packedfile = nullptr;
|
||||
|
||||
/* runtime only, holds memory for freetype to read from
|
||||
* TODO: replace this with #blf_font_new() style loading. */
|
||||
struct PackedFile *temp_pf = nullptr;
|
||||
};
|
||||
|
||||
#define FO_BUILTIN_NAME "<builtin>"
|
||||
|
||||
} // namespace blender
|
||||
199
blender-5.2.0/source/blender/makesdna/DNA_view2d_types.h
Normal file
199
blender-5.2.0/source/blender/makesdna/DNA_view2d_types.h
Normal file
@@ -0,0 +1,199 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_vec_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace ui {
|
||||
struct SmoothView2DStore;
|
||||
}
|
||||
|
||||
/** View zooming restrictions, per axis (#View2D.keepzoom) */
|
||||
enum eView2D_KeepZoom : short {
|
||||
/* zoom is clamped to lie within limits set by minzoom and maxzoom */
|
||||
V2D_LIMITZOOM = (1 << 0),
|
||||
/* aspect ratio is maintained on view resize */
|
||||
V2D_KEEPASPECT = (1 << 1),
|
||||
/* zoom is kept when the window resizes */
|
||||
V2D_KEEPZOOM = (1 << 2),
|
||||
/* zooming on x-axis is not allowed */
|
||||
V2D_LOCKZOOM_X = (1 << 8),
|
||||
/* zooming on y-axis is not allowed */
|
||||
V2D_LOCKZOOM_Y = (1 << 9),
|
||||
};
|
||||
ENUM_OPERATORS(eView2D_KeepZoom)
|
||||
|
||||
/** View panning restrictions, per axis (#View2D.keepofs). */
|
||||
enum eView2D_KeepOfs : short {
|
||||
/* panning on x-axis is not allowed */
|
||||
V2D_LOCKOFS_X = (1 << 1),
|
||||
/* panning on y-axis is not allowed */
|
||||
V2D_LOCKOFS_Y = (1 << 2),
|
||||
/* on resize, keep the x offset */
|
||||
V2D_KEEPOFS_X = (1 << 3),
|
||||
/* on resize, keep the y offset */
|
||||
V2D_KEEPOFS_Y = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eView2D_KeepOfs)
|
||||
|
||||
/** View extent restrictions (#View2D.keeptot). */
|
||||
enum eView2D_KeepTot : short {
|
||||
/** 'cur' view can be out of extents of 'tot' */
|
||||
V2D_KEEPTOT_FREE = 0,
|
||||
/** 'cur' rect is adjusted so that it satisfies the extents of 'tot', with some compromises */
|
||||
V2D_KEEPTOT_BOUNDS = 1,
|
||||
/** 'cur' rect is moved so that the 'minimum' bounds of the 'tot' rect are always respected
|
||||
* (particularly in x-axis) */
|
||||
V2D_KEEPTOT_STRICT = 2,
|
||||
};
|
||||
|
||||
/** General refresh settings (#View2D.flag). */
|
||||
enum eView2D_Flag : short {
|
||||
/* global view2d horizontal locking (for showing same time interval) */
|
||||
V2D_VIEWSYNC_SCREEN_TIME = (1 << 0),
|
||||
/* within area (i.e. between regions) view2d vertical locking */
|
||||
V2D_VIEWSYNC_AREA_VERTICAL = (1 << 1),
|
||||
/* apply pixel offsets on x-axis when setting view matrices */
|
||||
V2D_PIXELOFS_X = (1 << 2),
|
||||
/* apply pixel offsets on y-axis when setting view matrices */
|
||||
V2D_PIXELOFS_Y = (1 << 3),
|
||||
/* zoom, pan or similar action is in progress */
|
||||
V2D_IS_NAVIGATING = (1 << 9),
|
||||
/* view settings need to be set still... */
|
||||
V2D_IS_INIT = (1 << 10),
|
||||
/* Ensure scrolling always snaps to multiples of #View2D.page_size_y or the #View2D.mask height
|
||||
* if this is 0. Zooming doesn't respect this. */
|
||||
V2D_SNAP_TO_PAGESIZE_Y = (1 << 11),
|
||||
/* Ignore keepofs flags only during zoom.
|
||||
* Allows for different behavior between zooming and area resize. */
|
||||
V2D_ZOOM_IGNORE_KEEPOFS = (1 << 12),
|
||||
};
|
||||
ENUM_OPERATORS(eView2D_Flag)
|
||||
|
||||
/** Scroller flags for View2D (#View2D.scroll). */
|
||||
enum eView2D_Scroll : short {
|
||||
/* Left scroll-bar. */
|
||||
V2D_SCROLL_LEFT = (1 << 0),
|
||||
V2D_SCROLL_RIGHT = (1 << 1),
|
||||
V2D_SCROLL_VERTICAL = (V2D_SCROLL_LEFT | V2D_SCROLL_RIGHT),
|
||||
/* Horizontal scroll-bar. */
|
||||
V2D_SCROLL_TOP = (1 << 2),
|
||||
V2D_SCROLL_BOTTOM = (1 << 3),
|
||||
/* UNUSED = (1 << 4), */
|
||||
V2D_SCROLL_HORIZONTAL = (V2D_SCROLL_TOP | V2D_SCROLL_BOTTOM),
|
||||
/* display vertical scale handles */
|
||||
V2D_SCROLL_VERTICAL_HANDLES = (1 << 5),
|
||||
/* display horizontal scale handles */
|
||||
V2D_SCROLL_HORIZONTAL_HANDLES = (1 << 6),
|
||||
/* Induce hiding of scroll-bar - set by region drawing in response to size of region. */
|
||||
V2D_SCROLL_VERTICAL_HIDE = (1 << 7),
|
||||
V2D_SCROLL_HORIZONTAL_HIDE = (1 << 8),
|
||||
/* Scroll-bar extends beyond its available window -
|
||||
* set when calculating scroll-bar for drawing */
|
||||
V2D_SCROLL_VERTICAL_FULLR = (1 << 9),
|
||||
V2D_SCROLL_HORIZONTAL_FULLR = (1 << 10),
|
||||
};
|
||||
ENUM_OPERATORS(eView2D_Scroll)
|
||||
|
||||
/** scroll_ui, activate flag for drawing. */
|
||||
enum eView2D_ScrollUI : short {
|
||||
V2D_SCROLL_H_ACTIVE = (1 << 0),
|
||||
V2D_SCROLL_V_ACTIVE = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eView2D_ScrollUI)
|
||||
|
||||
/**
|
||||
* Alignment flags for `totrect`, flags use 'shading-out' convention (#View2D.align).
|
||||
*/
|
||||
enum eView2D_Align : short {
|
||||
/* all quadrants free */
|
||||
V2D_ALIGN_FREE = 0,
|
||||
/* horizontal restrictions */
|
||||
V2D_ALIGN_NO_POS_X = (1 << 0),
|
||||
V2D_ALIGN_NO_NEG_X = (1 << 1),
|
||||
/* vertical restrictions */
|
||||
V2D_ALIGN_NO_POS_Y = (1 << 2),
|
||||
V2D_ALIGN_NO_NEG_Y = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eView2D_Align)
|
||||
|
||||
/* ---------------------------------- */
|
||||
|
||||
/** View 2D data - stored per region. */
|
||||
struct View2D {
|
||||
/** Total area that data can be drawn in. */
|
||||
rctf tot = {};
|
||||
/** Current region of tot that is visible in viewport. */
|
||||
rctf cur = {};
|
||||
/** Vertical scroll-bar region. */
|
||||
rcti vert = {};
|
||||
/** Horizontal scroll-bar region. */
|
||||
rcti hor = {};
|
||||
/**
|
||||
* Mask region (in screen-space) within which `cur` can be viewed.
|
||||
*
|
||||
* Note that the coordinates are inclusive; to get pixel size you need to use
|
||||
* `BLI_rcti_size_x(mask) + 1` (same for the Y axis).
|
||||
*/
|
||||
rcti mask = {};
|
||||
|
||||
/** Min/max sizes of `cur` rect (only when keepzoom not set). */
|
||||
float min[2] = {}, max[2] = {};
|
||||
/** Allowable zoom factor range (only when (keepzoom & V2D_LIMITZOOM)) is set. */
|
||||
float minzoom = 0, maxzoom = 0;
|
||||
|
||||
/** Scroll-bars to display (bit-flag). */
|
||||
eView2D_Scroll scroll = {};
|
||||
/** Temporary settings used for UI drawing of scroll-bars. */
|
||||
eView2D_ScrollUI scroll_ui = {};
|
||||
|
||||
/** Keeptot - `cur` rect cannot move outside the `tot` rect? */
|
||||
eView2D_KeepTot keeptot = {};
|
||||
/** Keepzoom - axes that zooming cannot occur on, and also clamp within zoom-limits. */
|
||||
eView2D_KeepZoom keepzoom = {};
|
||||
/** Keepofs - axes that translation is not allowed to occur on. */
|
||||
eView2D_KeepOfs keepofs = {};
|
||||
|
||||
/** Settings. */
|
||||
eView2D_Flag flag = {};
|
||||
/** Alignment of content in totrect. */
|
||||
eView2D_Align align = {};
|
||||
|
||||
/** Storage of current winx/winy values, set in view2d_size_update. */
|
||||
short winx = 0, winy = 0;
|
||||
/**
|
||||
* Storage of previous winx/winy values encountered by #view2d_curRect_validate(),
|
||||
* for V2D_KEEPZOOM and V2D_KEEPASPECT.
|
||||
*/
|
||||
short oldwinx = 0, oldwiny = 0;
|
||||
|
||||
/** Pivot point for transforms (rotate and scale). */
|
||||
short around = 0;
|
||||
|
||||
/* Usually set externally (as in, not in view2d files). */
|
||||
/** Alpha of vertical and horizontal scroll-bars (range is [0, 255]). */
|
||||
char alpha_vert = 0, alpha_hor = 0;
|
||||
|
||||
char _pad[2] = {};
|
||||
/**
|
||||
* When set (not 0), determines how many pixels to scroll when scrolling an entire page.
|
||||
* Otherwise the height of #View2D.mask is used.
|
||||
*/
|
||||
float page_size_y = 0;
|
||||
|
||||
/* animated smooth view */
|
||||
ui::SmoothView2DStore *sms = nullptr;
|
||||
struct wmTimer *smooth_timer = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
56
blender-5.2.0/source/blender/makesdna/DNA_view3d_enums.h
Normal file
56
blender-5.2.0/source/blender/makesdna/DNA_view3d_enums.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** Settings for off-screen rendering. */
|
||||
enum eV3DOffscreenDrawFlag : int {
|
||||
V3D_OFSDRAW_NONE = (0),
|
||||
V3D_OFSDRAW_SHOW_ANNOTATION = (1 << 0),
|
||||
V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS = (1 << 1),
|
||||
V3D_OFSDRAW_SHOW_GRIDFLOOR = (1 << 2),
|
||||
V3D_OFSDRAW_SHOW_SELECTION = (1 << 3),
|
||||
V3D_OFSDRAW_XR_SHOW_CONTROLLERS = (1 << 4),
|
||||
V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS = (1 << 5),
|
||||
V3D_OFSDRAW_SHOW_OBJECT_EXTRAS = (1 << 6),
|
||||
V3D_OFSDRAW_XR_SHOW_PASSTHROUGH = (1 << 7),
|
||||
/* By default, the viewport background is set to use the world.
|
||||
* In some specific case, we want to use the actual setting from the viewport or scene data. */
|
||||
V3D_OFSDRAW_NO_WORLD_BACKGROUND_OVERRIDE = (1 << 8),
|
||||
};
|
||||
ENUM_OPERATORS(eV3DOffscreenDrawFlag)
|
||||
|
||||
/** #View3DShading.light */
|
||||
enum eV3DShadingLightingMode : char {
|
||||
V3D_LIGHTING_FLAT = 0,
|
||||
V3D_LIGHTING_STUDIO = 1,
|
||||
V3D_LIGHTING_MATCAP = 2,
|
||||
};
|
||||
|
||||
/** #View3DShading.color_type, #View3DShading.wire_color_type */
|
||||
enum eV3DShadingColorType : char {
|
||||
V3D_SHADING_MATERIAL_COLOR = 0,
|
||||
V3D_SHADING_RANDOM_COLOR = 1,
|
||||
V3D_SHADING_SINGLE_COLOR = 2,
|
||||
V3D_SHADING_TEXTURE_COLOR = 3,
|
||||
V3D_SHADING_OBJECT_COLOR = 4,
|
||||
V3D_SHADING_VERTEX_COLOR = 5,
|
||||
};
|
||||
|
||||
/** #View3DShading.background_type */
|
||||
enum eV3DShadingBackgroundType : char {
|
||||
V3D_SHADING_BACKGROUND_THEME = 0,
|
||||
V3D_SHADING_BACKGROUND_WORLD = 1,
|
||||
V3D_SHADING_BACKGROUND_VIEWPORT = 2,
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
835
blender-5.2.0/source/blender/makesdna/DNA_view3d_types.h
Normal file
835
blender-5.2.0/source/blender/makesdna/DNA_view3d_types.h
Normal file
@@ -0,0 +1,835 @@
|
||||
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
#include "BLI_math_quaternion_types.hh"
|
||||
|
||||
#include "DNA_defs.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_enums.h"
|
||||
#include "DNA_space_enums.h"
|
||||
#include "DNA_view3d_enums.h"
|
||||
#include "DNA_viewer_path_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct BoundBox;
|
||||
struct Object;
|
||||
struct ViewRender;
|
||||
struct SmoothView3DStore;
|
||||
struct SpaceLink;
|
||||
struct bGPdata;
|
||||
struct wmTimer;
|
||||
|
||||
/** #View3DOverlay.handle_display */
|
||||
enum eHandleDisplay : int {
|
||||
/* Display only selected points. */
|
||||
CURVE_HANDLE_SELECTED = 0,
|
||||
/* Display all handles. */
|
||||
CURVE_HANDLE_ALL = 1,
|
||||
/* No display handles. */
|
||||
CURVE_HANDLE_NONE = 2,
|
||||
};
|
||||
|
||||
/** #View3D::stereo3d_flag */
|
||||
enum eView3D_StereoFlag : short {
|
||||
V3D_S3D_DISPCAMERAS = 1 << 0,
|
||||
V3D_S3D_DISPPLANE = 1 << 1,
|
||||
V3D_S3D_DISPVOLUME = 1 << 2,
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_StereoFlag)
|
||||
|
||||
/** #View3D::flag */
|
||||
enum eView3D_Flag : short {
|
||||
V3D_LOCAL_COLLECTIONS = 1 << 0,
|
||||
V3D_FLAG_UNUSED_1 = 1 << 1, /* cleared */
|
||||
V3D_HIDE_HELPLINES = 1 << 2,
|
||||
V3D_FLAG_UNUSED_2 = 1 << 3, /* cleared */
|
||||
V3D_XR_SESSION_MIRROR = 1 << 4,
|
||||
V3D_XR_SESSION_SURFACE = 1 << 5,
|
||||
|
||||
V3D_FLAG_UNUSED_10 = 1 << 10, /* cleared */
|
||||
V3D_SELECT_OUTLINE = 1 << 11,
|
||||
V3D_FLAG_UNUSED_12 = 1 << 12, /* cleared */
|
||||
V3D_GLOBAL_STATS = 1 << 13,
|
||||
V3D_DRAW_CENTERS = short(1u << 15),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_Flag)
|
||||
|
||||
/** #View3D_Runtime.flag */
|
||||
enum eView3D_Runtime_Flag : int {
|
||||
/** The 3D view which the XR session was created in is flagged with this. */
|
||||
V3D_RUNTIME_XR_SESSION_ROOT = (1 << 0),
|
||||
/** Some operators override the depth buffer for dedicated occlusion operations. */
|
||||
V3D_RUNTIME_DEPTHBUF_OVERRIDDEN = (1 << 1),
|
||||
/** Local view may have become empty, and may need to be exited. */
|
||||
V3D_RUNTIME_LOCAL_MAYBE_EMPTY = (1 << 2),
|
||||
/** Last offset is valid. */
|
||||
V3D_RUNTIME_OFS_LAST_CENTER_IS_VALID = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_Runtime_Flag)
|
||||
|
||||
/** #RegionView3D::persp */
|
||||
enum eRegionView3D_Persp : char {
|
||||
RV3D_ORTHO = 0,
|
||||
RV3D_PERSP = 1,
|
||||
RV3D_CAMOB = 2,
|
||||
};
|
||||
|
||||
/** #RegionView3D::rflag */
|
||||
enum eRegionView3D_Flag : short {
|
||||
RV3D_CLIPPING = 1 << 2,
|
||||
RV3D_NAVIGATING = 1 << 3,
|
||||
RV3D_GPULIGHT_UPDATE = 1 << 4,
|
||||
RV3D_PAINTING = 1 << 5,
|
||||
/**
|
||||
* Disable Z-buffer offset, skip calls to #ED_view3d_polygon_offset.
|
||||
* Use when precise surface depth is needed and picking bias isn't, see #45434.
|
||||
*/
|
||||
RV3D_ZOFFSET_DISABLED = 1 << 6,
|
||||
RV3D_WAS_CAMOB = 1 << 7,
|
||||
};
|
||||
ENUM_OPERATORS(eRegionView3D_Flag)
|
||||
|
||||
/** #RegionView3D.viewlock */
|
||||
enum eRegionView3D_ViewLock : char {
|
||||
/**
|
||||
* Used to lock axis views when quad-view is enabled.
|
||||
*
|
||||
* \note this implies locking the perspective as these views
|
||||
* should use an orthographic projection.
|
||||
*/
|
||||
RV3D_LOCK_ROTATION = (1 << 0),
|
||||
RV3D_BOXVIEW = (1 << 1),
|
||||
RV3D_BOXCLIP = (1 << 2),
|
||||
RV3D_LOCK_LOCATION = (1 << 3),
|
||||
RV3D_LOCK_ZOOM_AND_DOLLY = (1 << 4),
|
||||
|
||||
RV3D_LOCK_ANY_TRANSFORM = (RV3D_LOCK_LOCATION | RV3D_LOCK_ROTATION | RV3D_LOCK_ZOOM_AND_DOLLY),
|
||||
};
|
||||
ENUM_OPERATORS(eRegionView3D_ViewLock)
|
||||
|
||||
/** Bit-wise OR of the regular lock-flags with runtime only lock-flags. */
|
||||
#define RV3D_LOCK_FLAGS(rv3d) ((rv3d)->viewlock | ((rv3d)->runtime_viewlock))
|
||||
|
||||
/** #RegionView3D::viewlock_quad */
|
||||
enum eRegionView3D_ViewLockQuad : char {
|
||||
RV3D_VIEWLOCK_INIT = 1 << 7,
|
||||
};
|
||||
ENUM_OPERATORS(eRegionView3D_ViewLockQuad)
|
||||
|
||||
/** #RegionView3D::view */
|
||||
enum eRegionView3D_View : char {
|
||||
RV3D_VIEW_USER = 0,
|
||||
RV3D_VIEW_FRONT = 1,
|
||||
RV3D_VIEW_BACK = 2,
|
||||
RV3D_VIEW_LEFT = 3,
|
||||
RV3D_VIEW_RIGHT = 4,
|
||||
RV3D_VIEW_TOP = 5,
|
||||
RV3D_VIEW_BOTTOM = 6,
|
||||
RV3D_VIEW_CAMERA = 8,
|
||||
};
|
||||
|
||||
#define RV3D_VIEW_IS_AXIS(view) (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
|
||||
|
||||
/**
|
||||
* #RegionView3D.view_axis_roll
|
||||
*
|
||||
* Clockwise rotation to use for axis-views, when #RV3D_VIEW_IS_AXIS is true.
|
||||
*/
|
||||
enum eRegionView3D_ViewAxisRoll : char {
|
||||
RV3D_VIEW_AXIS_ROLL_0 = 0,
|
||||
RV3D_VIEW_AXIS_ROLL_90 = 1,
|
||||
RV3D_VIEW_AXIS_ROLL_180 = 2,
|
||||
RV3D_VIEW_AXIS_ROLL_270 = 3,
|
||||
};
|
||||
|
||||
/** #RegionView3D::ndof_flag */
|
||||
enum eRegionView3D_NDOFFlag : char {
|
||||
/**
|
||||
* When set, #RegionView3D::ndof_ofs may be used instead of #RegionView3D::ofs,
|
||||
*
|
||||
* This value will be recalculated when starting NDOF motion,
|
||||
* however if the center can *not* be calculated, the previous value may be used.
|
||||
*
|
||||
* To prevent strange behavior some checks should be used
|
||||
* to ensure the previously calculated value makes sense.
|
||||
*
|
||||
* The most common case is for perspective views, where orbiting around a point behind
|
||||
* the view (while possible) often seems like a bug from a user perspective.
|
||||
* We could consider other cases invalid too (e.g. values beyond the clipping plane),
|
||||
* although in practice these cases should be fairly rare.
|
||||
*/
|
||||
RV3D_NDOF_OFS_IS_VALID = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eRegionView3D_NDOFFlag)
|
||||
|
||||
#define RV3D_CLIPPING_ENABLED(v3d, rv3d) \
|
||||
((rv3d) && (v3d) && ((rv3d)->rflag & RV3D_CLIPPING) && \
|
||||
ELEM((v3d)->shading.type, OB_WIRE, OB_SOLID) && (rv3d)->clipbb)
|
||||
|
||||
/** #View3D::flag2 (int) */
|
||||
enum eView3D_Flag2 : int {
|
||||
V3D_HIDE_OVERLAYS = 1 << 2,
|
||||
V3D_SHOW_VIEWER = 1 << 3,
|
||||
V3D_SHOW_ANNOTATION = 1 << 4,
|
||||
V3D_LOCK_CAMERA = 1 << 5,
|
||||
V3D_FLAG2_UNUSED_6 = 1 << 6, /* cleared */
|
||||
V3D_SHOW_RECONSTRUCTION = 1 << 7,
|
||||
V3D_SHOW_CAMERAPATH = 1 << 8,
|
||||
V3D_SHOW_BUNDLENAME = 1 << 9,
|
||||
V3D_FLAG2_UNUSED_10 = 1 << 10, /* cleared */
|
||||
V3D_RENDER_BORDER = 1 << 11,
|
||||
V3D_FLAG2_UNUSED_12 = 1 << 12, /* cleared */
|
||||
V3D_FLAG2_UNUSED_13 = 1 << 13, /* cleared */
|
||||
V3D_FLAG2_UNUSED_14 = 1 << 14, /* cleared */
|
||||
V3D_FLAG2_UNUSED_15 = 1 << 15, /* cleared */
|
||||
V3D_XR_SHOW_CONTROLLERS = 1 << 16,
|
||||
V3D_XR_SHOW_CUSTOM_OVERLAYS = 1 << 17,
|
||||
V3D_SHOW_CAMERA_GUIDES = (1 << 18),
|
||||
V3D_SHOW_CAMERA_PASSEPARTOUT = (1 << 19),
|
||||
V3D_XR_SHOW_PASSTHROUGH = 1 << 20,
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_Flag2)
|
||||
|
||||
/** #View3D::gp_flag (short) */
|
||||
enum eView3D_GPFlag : short {
|
||||
/** Fade all non GP objects. */
|
||||
V3D_GP_FADE_OBJECTS = 1 << 0,
|
||||
/** Activate paper grid. */
|
||||
V3D_GP_SHOW_GRID = 1 << 1,
|
||||
V3D_GP_SHOW_EDIT_LINES = 1 << 2,
|
||||
V3D_GP_SHOW_MULTIEDIT_LINES = 1 << 3,
|
||||
/** main switch at view level. */
|
||||
V3D_GP_SHOW_ONION_SKIN = 1 << 4,
|
||||
/** fade layers not active. */
|
||||
V3D_GP_FADE_NOACTIVE_LAYERS = 1 << 5,
|
||||
/** Fade other GPencil objects. */
|
||||
V3D_GP_FADE_NOACTIVE_GPENCIL = 1 << 6,
|
||||
/** Show Strokes Directions. */
|
||||
V3D_GP_SHOW_STROKE_DIRECTION = 1 << 7,
|
||||
/** Show Material names. */
|
||||
V3D_GP_SHOW_MATERIAL_NAME = 1 << 8,
|
||||
/** Show Canvas Grid on Top. */
|
||||
V3D_GP_SHOW_GRID_XRAY = 1 << 9,
|
||||
/** Force 3D depth rendering and ignore per-object stroke depth mode. */
|
||||
V3D_GP_FORCE_STROKE_ORDER_3D = 1 << 10,
|
||||
/** Onion skin for active object only. */
|
||||
V3D_GP_ONION_SKIN_ACTIVE_OBJECT = 1 << 11,
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GPFlag)
|
||||
|
||||
/** #View3DShading.flag */
|
||||
enum eView3DShading_Flag : short {
|
||||
V3D_SHADING_OBJECT_OUTLINE = (1 << 0),
|
||||
V3D_SHADING_XRAY = (1 << 1),
|
||||
V3D_SHADING_SHADOW = (1 << 2),
|
||||
V3D_SHADING_SCENE_LIGHTS = (1 << 3),
|
||||
V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4),
|
||||
V3D_SHADING_CAVITY = (1 << 5),
|
||||
V3D_SHADING_MATCAP_FLIP_X = (1 << 6),
|
||||
V3D_SHADING_SCENE_WORLD = (1 << 7),
|
||||
V3D_SHADING_XRAY_WIREFRAME = (1 << 8),
|
||||
V3D_SHADING_WORLD_ORIENTATION = (1 << 9),
|
||||
V3D_SHADING_BACKFACE_CULLING = (1 << 10),
|
||||
V3D_SHADING_DEPTH_OF_FIELD = (1 << 11),
|
||||
V3D_SHADING_SCENE_LIGHTS_RENDER = (1 << 12),
|
||||
V3D_SHADING_SCENE_WORLD_RENDER = (1 << 13),
|
||||
V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION = (1 << 14),
|
||||
};
|
||||
ENUM_OPERATORS(eView3DShading_Flag)
|
||||
|
||||
/** #View3D.debug_flag */
|
||||
enum eView3D_DebugFlag : short {
|
||||
V3D_DEBUG_FREEZE_CULLING = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_DebugFlag)
|
||||
|
||||
#define V3D_USES_SCENE_LIGHTS(v3d) \
|
||||
((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \
|
||||
(((v3d)->shading.type == OB_RENDER) && \
|
||||
((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER)))
|
||||
|
||||
#define V3D_USES_SCENE_WORLD(v3d) \
|
||||
((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD)) || \
|
||||
(((v3d)->shading.type == OB_RENDER) && \
|
||||
((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER)))
|
||||
|
||||
/** #View3DShading.cavity_type */
|
||||
enum eView3DShading_CavityType : char {
|
||||
V3D_SHADING_CAVITY_SSAO = 0,
|
||||
V3D_SHADING_CAVITY_CURVATURE = 1,
|
||||
V3D_SHADING_CAVITY_BOTH = 2,
|
||||
};
|
||||
|
||||
/** #View3DShading.use_compositor */
|
||||
enum View3DShadingUseCompositor : char {
|
||||
V3D_SHADING_USE_COMPOSITOR_DISABLED = 0,
|
||||
/** The compositor is enabled only in camera view. */
|
||||
V3D_SHADING_USE_COMPOSITOR_CAMERA = 1,
|
||||
/** The compositor is always enabled regardless of the view. */
|
||||
V3D_SHADING_USE_COMPOSITOR_ALWAYS = 2,
|
||||
};
|
||||
|
||||
/** #View3DOverlay.flag */
|
||||
enum eView3DOverlay_Flag : int {
|
||||
V3D_OVERLAY_FACE_ORIENTATION = (1 << 0),
|
||||
V3D_OVERLAY_HIDE_CURSOR = (1 << 1),
|
||||
V3D_OVERLAY_BONE_SELECT = (1 << 2),
|
||||
V3D_OVERLAY_LOOK_DEV = (1 << 3),
|
||||
V3D_OVERLAY_WIREFRAMES = (1 << 4),
|
||||
V3D_OVERLAY_HIDE_TEXT = (1 << 5),
|
||||
V3D_OVERLAY_HIDE_MOTION_PATHS = (1 << 6),
|
||||
V3D_OVERLAY_ONION_SKINS = (1 << 7),
|
||||
V3D_OVERLAY_HIDE_BONES = (1 << 8),
|
||||
V3D_OVERLAY_HIDE_OBJECT_XTRAS = (1 << 9),
|
||||
V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10),
|
||||
V3D_OVERLAY_STATS = (1 << 11),
|
||||
V3D_OVERLAY_FADE_INACTIVE = (1 << 12),
|
||||
V3D_OVERLAY_VIEWER_ATTRIBUTE = (1 << 13),
|
||||
V3D_OVERLAY_SCULPT_SHOW_MASK = (1 << 14),
|
||||
V3D_OVERLAY_SCULPT_SHOW_FACE_SETS = (1 << 15),
|
||||
V3D_OVERLAY_SCULPT_CURVES_CAGE = (1 << 16),
|
||||
V3D_OVERLAY_SHOW_LIGHT_COLORS = (1 << 17),
|
||||
V3D_OVERLAY_VIEWER_ATTRIBUTE_TEXT = (1 << 18),
|
||||
V3D_OVERLAY_PERFORMANCE = (1 << 19),
|
||||
};
|
||||
ENUM_OPERATORS(eView3DOverlay_Flag)
|
||||
|
||||
/** #View3DOverlay.edit_flag */
|
||||
enum eView3DOverlay_EditFlag : int {
|
||||
V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
|
||||
V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
|
||||
V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
|
||||
|
||||
V3D_OVERLAY_EDIT_RETOPOLOGY = (1 << 3),
|
||||
|
||||
V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
|
||||
|
||||
V3D_OVERLAY_EDIT_EDGES_DEPRECATED = (1 << 5),
|
||||
V3D_OVERLAY_EDIT_FACES = (1 << 6),
|
||||
V3D_OVERLAY_EDIT_FACE_DOT = (1 << 7),
|
||||
|
||||
V3D_OVERLAY_EDIT_SEAMS = (1 << 8),
|
||||
V3D_OVERLAY_EDIT_SHARP = (1 << 9),
|
||||
V3D_OVERLAY_EDIT_CREASES = (1 << 10),
|
||||
V3D_OVERLAY_EDIT_BWEIGHTS = (1 << 11),
|
||||
|
||||
V3D_OVERLAY_EDIT_FREESTYLE_EDGE = (1 << 12),
|
||||
V3D_OVERLAY_EDIT_FREESTYLE_FACE = (1 << 13),
|
||||
|
||||
V3D_OVERLAY_EDIT_STATVIS = (1 << 14),
|
||||
V3D_OVERLAY_EDIT_EDGE_LEN = (1 << 15),
|
||||
V3D_OVERLAY_EDIT_EDGE_ANG = (1 << 16),
|
||||
V3D_OVERLAY_EDIT_FACE_ANG = (1 << 17),
|
||||
V3D_OVERLAY_EDIT_FACE_AREA = (1 << 18),
|
||||
V3D_OVERLAY_EDIT_INDICES = (1 << 19),
|
||||
|
||||
/* Deprecated. */
|
||||
// V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
|
||||
|
||||
V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
|
||||
V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS = (1 << 22),
|
||||
};
|
||||
ENUM_OPERATORS(eView3DOverlay_EditFlag)
|
||||
|
||||
/** #View3DOverlay.paint_flag */
|
||||
enum eView3DOverlay_PaintFlag : int {
|
||||
V3D_OVERLAY_PAINT_WIRE = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eView3DOverlay_PaintFlag)
|
||||
|
||||
/** #View3DOverlay.wpaint_flag */
|
||||
enum eView3DOverlay_WPaintFlag : int {
|
||||
V3D_OVERLAY_WPAINT_CONTOURS = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eView3DOverlay_WPaintFlag)
|
||||
|
||||
/** #View3D.around */
|
||||
enum eView3D_Around : int {
|
||||
/* center of the bounding box */
|
||||
V3D_AROUND_CENTER_BOUNDS = 0,
|
||||
/* center from the sum of all points divided by the total */
|
||||
V3D_AROUND_CENTER_MEDIAN = 3,
|
||||
/* pivot around the 2D/3D cursor */
|
||||
V3D_AROUND_CURSOR = 1,
|
||||
/* pivot around each items own origin */
|
||||
V3D_AROUND_LOCAL_ORIGINS = 2,
|
||||
/* pivot around the active items origin */
|
||||
V3D_AROUND_ACTIVE = 4,
|
||||
};
|
||||
|
||||
/** #View3D.gridflag */
|
||||
enum eView3D_GridFlag : char {
|
||||
V3D_SHOW_FLOOR = 1 << 0,
|
||||
V3D_SHOW_X = 1 << 1,
|
||||
V3D_SHOW_Y = 1 << 2,
|
||||
V3D_SHOW_Z = 1 << 3,
|
||||
V3D_SHOW_ORTHO_GRID = 1 << 4,
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GridFlag)
|
||||
|
||||
/** #TransformOrientationSlot.type */
|
||||
enum eView3D_Orientation : int {
|
||||
V3D_ORIENT_GLOBAL = 0,
|
||||
V3D_ORIENT_LOCAL = 1,
|
||||
V3D_ORIENT_NORMAL = 2,
|
||||
V3D_ORIENT_VIEW = 3,
|
||||
V3D_ORIENT_GIMBAL = 4,
|
||||
V3D_ORIENT_CURSOR = 5,
|
||||
V3D_ORIENT_PARENT = 6,
|
||||
V3D_ORIENT_CUSTOM = 1024,
|
||||
/** Runtime only, never saved to DNA. */
|
||||
V3D_ORIENT_CUSTOM_MATRIX = (V3D_ORIENT_CUSTOM - 1),
|
||||
};
|
||||
|
||||
/** #View3d.gizmo_flag */
|
||||
enum eView3D_GizmoFlag : char {
|
||||
/** All gizmos. */
|
||||
V3D_GIZMO_HIDE = (1 << 0),
|
||||
V3D_GIZMO_HIDE_NAVIGATE = (1 << 1),
|
||||
V3D_GIZMO_HIDE_CONTEXT = (1 << 2),
|
||||
V3D_GIZMO_HIDE_TOOL = (1 << 3),
|
||||
V3D_GIZMO_HIDE_MODIFIER = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GizmoFlag)
|
||||
|
||||
/** #View3d.gizmo_show_object */
|
||||
enum eView3D_GizmoShowObject : char {
|
||||
V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0),
|
||||
V3D_GIZMO_SHOW_OBJECT_ROTATE = (1 << 1),
|
||||
V3D_GIZMO_SHOW_OBJECT_SCALE = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GizmoShowObject)
|
||||
|
||||
/** #View3d.gizmo_show_armature */
|
||||
enum eView3D_GizmoShowArmature : char {
|
||||
/** Currently unused (WIP gizmo). */
|
||||
V3D_GIZMO_SHOW_ARMATURE_BBONE = (1 << 0),
|
||||
/** Not yet implemented. */
|
||||
V3D_GIZMO_SHOW_ARMATURE_ROLL = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GizmoShowArmature)
|
||||
|
||||
/** #View3d.gizmo_show_empty */
|
||||
enum eView3D_GizmoShowEmpty : char {
|
||||
V3D_GIZMO_SHOW_EMPTY_IMAGE = (1 << 0),
|
||||
V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GizmoShowEmpty)
|
||||
|
||||
/** #View3d.gizmo_show_light */
|
||||
enum eView3D_GizmoShowLight : char {
|
||||
/** Use for both spot & area size. */
|
||||
V3D_GIZMO_SHOW_LIGHT_SIZE = (1 << 0),
|
||||
V3D_GIZMO_SHOW_LIGHT_LOOK_AT = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GizmoShowLight)
|
||||
|
||||
/** #View3d.gizmo_show_camera */
|
||||
enum eView3D_GizmoShowCamera : char {
|
||||
/** Also used for ortho size. */
|
||||
V3D_GIZMO_SHOW_CAMERA_LENS = (1 << 0),
|
||||
V3D_GIZMO_SHOW_CAMERA_DOF_DIST = (1 << 2),
|
||||
};
|
||||
ENUM_OPERATORS(eView3D_GizmoShowCamera)
|
||||
|
||||
/** #ToolSettings.plane_depth */
|
||||
enum eV3DPlaceDepth : char {
|
||||
V3D_PLACE_DEPTH_SURFACE = 0,
|
||||
V3D_PLACE_DEPTH_CURSOR_PLANE = 1,
|
||||
V3D_PLACE_DEPTH_CURSOR_VIEW = 2,
|
||||
};
|
||||
/** #ToolSettings.plane_orient */
|
||||
enum eV3DPlaceOrient : char {
|
||||
V3D_PLACE_ORIENT_SURFACE = 0,
|
||||
V3D_PLACE_ORIENT_DEFAULT = 1,
|
||||
};
|
||||
|
||||
struct RegionView3D {
|
||||
DNA_DEFINE_CXX_METHODS(RegionView3D)
|
||||
|
||||
/** GL_PROJECTION matrix. */
|
||||
float winmat[4][4] = {};
|
||||
/** GL_MODELVIEW matrix. */
|
||||
float viewmat[4][4] = {};
|
||||
/** Inverse of viewmat. */
|
||||
float viewinv[4][4] = {};
|
||||
/** Viewmat*winmat. */
|
||||
float persmat[4][4] = {};
|
||||
/** Inverse of persmat. */
|
||||
float persinv[4][4] = {};
|
||||
/** Offset/scale for camera GLSL texture-coordinates. */
|
||||
float viewcamtexcofac[4] = {};
|
||||
|
||||
/** viewmat/persmat multiplied with object matrix, while drawing and selection. */
|
||||
float viewmatob[4][4] = {};
|
||||
float persmatob[4][4] = {};
|
||||
|
||||
/** User defined clipping planes. */
|
||||
float clip[6][4] = {};
|
||||
/**
|
||||
* Clip in object space,
|
||||
* means we can test for clipping in edit-mode without first going into world-space.
|
||||
*/
|
||||
float clip_local[6][4] = {};
|
||||
struct BoundBox *clipbb = nullptr;
|
||||
|
||||
/** Allocated backup of itself while in local-view. */
|
||||
struct RegionView3D *localvd = nullptr;
|
||||
struct ViewRender *view_render = nullptr;
|
||||
|
||||
/** Animated smooth view. */
|
||||
struct SmoothView3DStore *sms = nullptr;
|
||||
struct wmTimer *smooth_timer = nullptr;
|
||||
|
||||
/** Transform gizmo matrix. */
|
||||
float twmat[4][4] = {};
|
||||
/** min/max dot product on `twmat` XYZ axis. */
|
||||
float tw_axis_min[3] = {}, tw_axis_max[3] = {};
|
||||
float tw_axis_matrix[3][3] = {};
|
||||
|
||||
DNA_DEPRECATED float gridview = 0;
|
||||
|
||||
/** View rotation, must be kept normalized. */
|
||||
float viewquat[4] = {};
|
||||
/**
|
||||
* Distance from `ofs` along `-viewinv[2]` vector, where result is negative as is `ofs`.
|
||||
*
|
||||
* \note Besides being above zero, the range of this value is not strictly defined,
|
||||
* see #ED_view3d_dist_soft_range_get to calculate a working range
|
||||
* viewport "zoom" functions to use.
|
||||
*/
|
||||
float dist = 0;
|
||||
/** Camera view offsets, 1.0 = viewplane moves entire width/height. */
|
||||
float camdx = 0, camdy = 0;
|
||||
/** Runtime only. */
|
||||
float pixsize = 0;
|
||||
/**
|
||||
* View center & orbit pivot, negative of world-space location,
|
||||
* also matches `-viewinv[3][0:3]` in orthographic mode.
|
||||
*/
|
||||
float ofs[3] = {};
|
||||
/** Viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac. */
|
||||
float camzoom = 0;
|
||||
/**
|
||||
* Check if persp/ortho view, since 'persp' can't be used for this since
|
||||
* it can have cameras assigned as well. (only set in #view3d_winmatrix_set)
|
||||
*/
|
||||
char is_persp = 0;
|
||||
eRegionView3D_Persp persp = RV3D_ORTHO;
|
||||
eRegionView3D_View view = RV3D_VIEW_USER;
|
||||
eRegionView3D_ViewAxisRoll view_axis_roll = RV3D_VIEW_AXIS_ROLL_0;
|
||||
eRegionView3D_ViewLock viewlock = {}; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
|
||||
/** Options for runtime only locking (cleared on file read) */
|
||||
eRegionView3D_ViewLock runtime_viewlock =
|
||||
{}; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
|
||||
/** Options for quadview (store while out of quad view). */
|
||||
eRegionView3D_ViewLockQuad viewlock_quad = {};
|
||||
char _pad[1] = {};
|
||||
/** Normalized offset for locked view: (-1, -1) bottom left, (1, 1) upper right. */
|
||||
float ofs_lock[2] = {};
|
||||
|
||||
/** XXX can easily get rid of this (Julian). */
|
||||
short twdrawflag = 0;
|
||||
eRegionView3D_Flag rflag = {};
|
||||
|
||||
/** Last view (use when switching out of camera view). */
|
||||
float lviewquat[4] = {};
|
||||
/** The last perspective can never be set to #RV3D_CAMOB. */
|
||||
eRegionView3D_Persp lpersp = RV3D_ORTHO;
|
||||
eRegionView3D_View lview = RV3D_VIEW_USER;
|
||||
eRegionView3D_ViewAxisRoll lview_axis_roll = RV3D_VIEW_AXIS_ROLL_0;
|
||||
char _pad8[4] = {};
|
||||
|
||||
eRegionView3D_NDOFFlag ndof_flag = {};
|
||||
/**
|
||||
* Rotation center used for "Auto Orbit" (see #NDOF_ORBIT_CENTER_AUTO).
|
||||
* Any modification should be followed by adjusting #RegionView3D::dist
|
||||
* to prevent problems zooming in after navigation. See: #134732.
|
||||
*/
|
||||
float ndof_ofs[3] = {};
|
||||
|
||||
/** Active rotation from NDOF (run-time only). */
|
||||
float ndof_rot_angle = 0;
|
||||
float ndof_rot_axis[3] = {};
|
||||
};
|
||||
|
||||
struct View3DCursor {
|
||||
float location[3] = {};
|
||||
|
||||
float rotation_quaternion[4] = {1, 0, 0, 0};
|
||||
float rotation_euler[3] = {};
|
||||
float rotation_axis[3] = {0, 1, 0}, rotation_angle = 0;
|
||||
short rotation_mode = ROT_MODE_XYZ;
|
||||
|
||||
char _pad[6] = {};
|
||||
|
||||
#ifdef __cplusplus
|
||||
template<typename T> T matrix() const;
|
||||
math::Quaternion rotation() const;
|
||||
|
||||
void set_rotation(const math::Quaternion &quat, bool use_compat);
|
||||
void set_matrix(const float3x3 &mat, bool use_compat);
|
||||
void set_matrix(const float4x4 &mat, bool use_compat);
|
||||
#endif
|
||||
};
|
||||
|
||||
/** 3D Viewport Shading settings. */
|
||||
struct View3DShading {
|
||||
eDrawType type = OB_SOLID;
|
||||
/** Runtime, for toggle between rendered viewport. */
|
||||
eDrawType prev_type = OB_SOLID;
|
||||
eDrawType prev_type_wire = eDrawType{};
|
||||
|
||||
eV3DShadingColorType color_type = V3D_SHADING_MATERIAL_COLOR;
|
||||
eView3DShading_Flag flag = V3D_SHADING_SPECULAR_HIGHLIGHT | V3D_SHADING_XRAY_WIREFRAME |
|
||||
V3D_SHADING_SCENE_LIGHTS_RENDER | V3D_SHADING_SCENE_WORLD_RENDER;
|
||||
|
||||
eV3DShadingLightingMode light = V3D_LIGHTING_STUDIO;
|
||||
eV3DShadingBackgroundType background_type = V3D_SHADING_BACKGROUND_THEME;
|
||||
eView3DShading_CavityType cavity_type = V3D_SHADING_CAVITY_CURVATURE;
|
||||
eV3DShadingColorType wire_color_type = V3D_SHADING_SINGLE_COLOR;
|
||||
|
||||
/** When to preview the compositor output in the viewport. */
|
||||
View3DShadingUseCompositor use_compositor = V3D_SHADING_USE_COMPOSITOR_DISABLED;
|
||||
|
||||
char _pad = {};
|
||||
|
||||
char studio_light[/*FILE_MAXFILE*/ 256] = "";
|
||||
char lookdev_light[/*FILE_MAXFILE*/ 256] = "";
|
||||
char matcap[/*FILE_MAXFILE*/ 256] = "";
|
||||
|
||||
float shadow_intensity = 0.5f;
|
||||
float single_color[3] = {0.8f, 0.8f, 0.8f};
|
||||
|
||||
float studiolight_rot_z = 0;
|
||||
float studiolight_background = 0;
|
||||
float studiolight_intensity = 1.0f;
|
||||
float studiolight_blur = 0;
|
||||
|
||||
float object_outline_color[3] = {};
|
||||
float xray_alpha = 0.5f;
|
||||
float xray_alpha_wire = 0.5f;
|
||||
|
||||
float cavity_valley_factor = 1.0f;
|
||||
float cavity_ridge_factor = 1.0f;
|
||||
|
||||
float background_color[3] = {0.05f, 0.05f, 0.05f};
|
||||
|
||||
float curvature_ridge_factor = 1.0f;
|
||||
float curvature_valley_factor = 1.0f;
|
||||
|
||||
/* Render pass displayed in the viewport. Is an `eScenePassType` where one bit is set */
|
||||
int render_pass = SCE_PASS_COMBINED;
|
||||
char aov_name[64] = "";
|
||||
|
||||
struct IDProperty *prop = nullptr;
|
||||
void *_pad2 = nullptr;
|
||||
};
|
||||
|
||||
/** 3D Viewport Overlay settings. */
|
||||
struct View3DOverlay {
|
||||
eView3DOverlay_Flag flag = V3D_OVERLAY_VIEWER_ATTRIBUTE | V3D_OVERLAY_SCULPT_SHOW_MASK |
|
||||
V3D_OVERLAY_SCULPT_SHOW_FACE_SETS;
|
||||
|
||||
/** Edit mode settings. */
|
||||
eView3DOverlay_EditFlag edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS |
|
||||
V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE |
|
||||
V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_CREASES |
|
||||
V3D_OVERLAY_EDIT_BWEIGHTS;
|
||||
float normals_length = 0.1f;
|
||||
float normals_constant_screen_size = 7.0f;
|
||||
|
||||
/** Paint mode settings. */
|
||||
eView3DOverlay_PaintFlag paint_flag = {};
|
||||
|
||||
/** Weight paint mode settings. */
|
||||
eView3DOverlay_WPaintFlag wpaint_flag = {};
|
||||
|
||||
/** Alpha for texture, weight, vertex paint overlay. */
|
||||
float texture_paint_mode_opacity = 1.0f;
|
||||
float vertex_paint_mode_opacity = 1.0f;
|
||||
float weight_paint_mode_opacity = 1.0f;
|
||||
float sculpt_mode_mask_opacity = 0.75f;
|
||||
float sculpt_mode_face_sets_opacity = 1.0f;
|
||||
float viewer_attribute_opacity = 1.0f;
|
||||
|
||||
/** Armature edit/pose mode settings. */
|
||||
float xray_alpha_bone = 0.5f;
|
||||
float bone_wire_alpha = 1.0f;
|
||||
|
||||
/** Darken Inactive. */
|
||||
float fade_alpha = 0.40f;
|
||||
|
||||
/** Other settings. */
|
||||
float wireframe_threshold = 1.0f;
|
||||
float wireframe_opacity = 1.0f;
|
||||
float retopology_offset = 0.01f;
|
||||
|
||||
/** Grease pencil settings. */
|
||||
float gpencil_paper_opacity = 0.5f;
|
||||
float gpencil_grid_opacity = 0.9f;
|
||||
float gpencil_fade_layer = 0;
|
||||
|
||||
/* Grease Pencil canvas settings. */
|
||||
float gpencil_grid_color[3] = {0.5f, 0.5f, 0.5f};
|
||||
float gpencil_grid_scale[2] = {1.0f, 1.0f};
|
||||
float gpencil_grid_offset[2] = {0.0f, 0.0f};
|
||||
int gpencil_grid_subdivisions = 4;
|
||||
|
||||
/** Factor for mixing vertex paint with original color */
|
||||
float gpencil_vertex_paint_opacity = 1.0f;
|
||||
/** Handles display type for curves. */
|
||||
eHandleDisplay handle_display = CURVE_HANDLE_SELECTED;
|
||||
|
||||
/** Curves sculpt mode settings. */
|
||||
float sculpt_curves_cage_opacity = 0;
|
||||
};
|
||||
|
||||
struct View3D_Runtime {
|
||||
/** Nkey panel stores stuff here. */
|
||||
void *properties_storage = nullptr;
|
||||
void (*properties_storage_free)(void *properties_storage) = nullptr;
|
||||
/** Runtime only flags. */
|
||||
int flag = 0;
|
||||
|
||||
/**
|
||||
* The previously calculated selection center.
|
||||
* Only use when `flag` #V3D_RUNTIME_OFS_LAST_IS_VALID is set.
|
||||
*/
|
||||
float ofs_last_center[3] = {};
|
||||
|
||||
/* Only used for overlay stats while in local-view. */
|
||||
struct SceneStats *local_stats = nullptr;
|
||||
|
||||
/* Times recorded for performance overlay. */
|
||||
float last_sync_time = 0;
|
||||
float last_submission_time = 0;
|
||||
};
|
||||
|
||||
/** 3D ViewPort Struct. */
|
||||
struct View3D {
|
||||
DNA_DEFINE_CXX_METHODS(View3D)
|
||||
|
||||
struct SpaceLink *next = nullptr, *prev = nullptr;
|
||||
/** Storage of regions for inactive spaces. */
|
||||
ListBaseT<ARegion> regionbase = {nullptr, nullptr};
|
||||
char spacetype = SPACE_VIEW3D;
|
||||
char link_flag = 0;
|
||||
char _pad0[6] = {};
|
||||
/* End 'SpaceLink' header. */
|
||||
|
||||
DNA_DEPRECATED float viewquat[4] = {};
|
||||
DNA_DEPRECATED float dist = 0;
|
||||
|
||||
/** Size of bundles in reconstructed data. */
|
||||
float bundle_size = 0.2f;
|
||||
/** Display style for bundle. */
|
||||
char bundle_drawtype = OB_PLAINAXES;
|
||||
|
||||
DNA_DEPRECATED char drawtype = 0;
|
||||
|
||||
char _pad3[1] = {};
|
||||
|
||||
/** Multiview current eye - for internal use. */
|
||||
char multiview_eye = 0;
|
||||
|
||||
int object_type_exclude_viewport = 0;
|
||||
int object_type_exclude_select = 0;
|
||||
|
||||
DNA_DEPRECATED eRegionView3D_Persp persp = eRegionView3D_Persp{};
|
||||
DNA_DEPRECATED eRegionView3D_View view = eRegionView3D_View{};
|
||||
char _pad8[2] = {};
|
||||
|
||||
struct Object *camera = nullptr, *ob_center = nullptr;
|
||||
rctf render_border = {};
|
||||
|
||||
/** Allocated backup of itself while in local-view. */
|
||||
struct View3D *localvd = nullptr;
|
||||
|
||||
/** Optional string for armature bone to define center. */
|
||||
char ob_center_bone[/*MAXBONENAME*/ 64] = "";
|
||||
|
||||
unsigned short local_view_uid = 0;
|
||||
char _pad6[2] = {};
|
||||
DNA_DEPRECATED int layact = 0;
|
||||
unsigned short local_collections_uid = 0;
|
||||
short _pad7[2] = {};
|
||||
|
||||
short debug_flag = 0;
|
||||
|
||||
/** Optional bool for 3d cursor to define center. */
|
||||
short ob_center_cursor = 0;
|
||||
short scenelock = true;
|
||||
eView3D_GPFlag gp_flag = V3D_GP_SHOW_EDIT_LINES;
|
||||
eView3D_Flag flag = V3D_SELECT_OUTLINE;
|
||||
eView3D_Flag2 flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION | V3D_SHOW_VIEWER |
|
||||
V3D_SHOW_CAMERA_GUIDES | V3D_SHOW_CAMERA_PASSEPARTOUT;
|
||||
|
||||
float lens = 50.0f, grid = 1.0f;
|
||||
float clip_start = 0.01f, clip_end = 1000.0f;
|
||||
float xr_vignette_aperture = 0;
|
||||
DNA_DEPRECATED float ofs[2] = {};
|
||||
|
||||
char _pad[1] = {};
|
||||
|
||||
/** Transform gizmo info. */
|
||||
/** #V3D_GIZMO_SHOW_* */
|
||||
eView3D_GizmoFlag gizmo_flag = {};
|
||||
|
||||
eView3D_GizmoShowObject gizmo_show_object = {};
|
||||
eView3D_GizmoShowArmature gizmo_show_armature = {};
|
||||
eView3D_GizmoShowEmpty gizmo_show_empty = {};
|
||||
eView3D_GizmoShowLight gizmo_show_light = {};
|
||||
eView3D_GizmoShowCamera gizmo_show_camera = {};
|
||||
|
||||
eView3D_GridFlag gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID;
|
||||
|
||||
short gridlines = 16;
|
||||
/** Number of subdivisions in the grid between each highlighted grid line. */
|
||||
short gridsubdiv = 10;
|
||||
|
||||
/** Actually only used to define the opacity of the grease pencil vertex in edit mode. */
|
||||
float vertex_opacity = 1.0f;
|
||||
|
||||
/* XXX deprecated? */
|
||||
/** Grease-Pencil Data (annotation layers). */
|
||||
DNA_DEPRECATED struct bGPdata *gpd = nullptr;
|
||||
|
||||
/** Stereoscopy settings. */
|
||||
eView3D_StereoFlag stereo3d_flag = V3D_S3D_DISPPLANE;
|
||||
char stereo3d_camera = STEREO_3D_ID;
|
||||
char _pad4 = {};
|
||||
float stereo3d_convergence_factor = 0;
|
||||
float stereo3d_volume_alpha = 0.05f;
|
||||
float stereo3d_convergence_alpha = 0.15f;
|
||||
|
||||
/** Display settings. */
|
||||
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;
|
||||
};
|
||||
|
||||
#define RV3D_CAMZOOM_MIN -30
|
||||
#define RV3D_CAMZOOM_MAX 600
|
||||
|
||||
/** #BKE_screen_view3d_zoom_to_fac() values above */
|
||||
#define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f
|
||||
#define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f
|
||||
|
||||
} // namespace blender
|
||||
@@ -0,0 +1,96 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct ID;
|
||||
struct bNodeTree;
|
||||
|
||||
enum ViewerPathElemType : int {
|
||||
VIEWER_PATH_ELEM_TYPE_ID = 0,
|
||||
VIEWER_PATH_ELEM_TYPE_MODIFIER = 1,
|
||||
VIEWER_PATH_ELEM_TYPE_GROUP_NODE = 2,
|
||||
VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE = 3,
|
||||
VIEWER_PATH_ELEM_TYPE_VIEWER_NODE = 4,
|
||||
VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE = 5,
|
||||
VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE = 6,
|
||||
VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE = 7,
|
||||
};
|
||||
|
||||
struct ViewerPathElem {
|
||||
struct ViewerPathElem *next = nullptr, *prev = nullptr;
|
||||
ViewerPathElemType type = VIEWER_PATH_ELEM_TYPE_ID;
|
||||
char _pad[4] = {};
|
||||
char *ui_name = nullptr;
|
||||
};
|
||||
|
||||
struct IDViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
struct ID *id = nullptr;
|
||||
};
|
||||
|
||||
struct ModifierViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
/** #ModifierData.persistent_uid. */
|
||||
int modifier_uid = 0;
|
||||
char _pad[4] = {};
|
||||
};
|
||||
|
||||
struct GroupNodeViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
|
||||
int32_t node_id = 0;
|
||||
char _pad1[4] = {};
|
||||
};
|
||||
|
||||
struct SimulationZoneViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
|
||||
int32_t sim_output_node_id = 0;
|
||||
char _pad1[4] = {};
|
||||
};
|
||||
|
||||
struct RepeatZoneViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
|
||||
int repeat_output_node_id = 0;
|
||||
int iteration = 0;
|
||||
};
|
||||
|
||||
struct ForeachGeometryElementZoneViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
|
||||
int zone_output_node_id = 0;
|
||||
int index = 0;
|
||||
};
|
||||
|
||||
struct ViewerNodeViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
|
||||
int32_t node_id = 0;
|
||||
char _pad1[4] = {};
|
||||
};
|
||||
|
||||
struct EvaluateClosureNodeViewerPathElem {
|
||||
ViewerPathElem base;
|
||||
|
||||
/** The identifier of the node that evaluates the closure. */
|
||||
int32_t evaluate_node_id = 0;
|
||||
/** The identifier of the output node of the closure zone that is evaluated. */
|
||||
int32_t source_output_node_id = 0;
|
||||
/** The node tree that contains the closure zone that is evaluated. */
|
||||
struct bNodeTree *source_node_tree = nullptr;
|
||||
};
|
||||
|
||||
struct ViewerPath {
|
||||
ListBaseT<ViewerPathElem> path = {nullptr, nullptr};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
165
blender-5.2.0/source/blender/makesdna/DNA_volume_types.h
Normal file
165
blender-5.2.0/source/blender/makesdna/DNA_volume_types.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
struct PackedFile;
|
||||
|
||||
namespace draw {
|
||||
struct VolumeBatchCache;
|
||||
}
|
||||
|
||||
namespace bke {
|
||||
struct VolumeRuntime;
|
||||
}
|
||||
|
||||
/** #Volume.flag */
|
||||
enum eVolume_Flag : int {
|
||||
VO_DS_EXPAND = (1 << 0),
|
||||
};
|
||||
ENUM_OPERATORS(eVolume_Flag)
|
||||
|
||||
/** #Volume.sequence_mode */
|
||||
enum VolumeSequenceMode : char {
|
||||
VOLUME_SEQUENCE_CLIP = 0,
|
||||
VOLUME_SEQUENCE_EXTEND = 1,
|
||||
VOLUME_SEQUENCE_REPEAT = 2,
|
||||
VOLUME_SEQUENCE_PING_PONG = 3,
|
||||
};
|
||||
|
||||
/** #VolumeDisplay.wireframe_type */
|
||||
enum VolumeWireframeType : int {
|
||||
VOLUME_WIREFRAME_NONE = 0,
|
||||
VOLUME_WIREFRAME_BOUNDS = 1,
|
||||
VOLUME_WIREFRAME_BOXES = 2,
|
||||
VOLUME_WIREFRAME_POINTS = 3,
|
||||
};
|
||||
|
||||
/** #VolumeDisplay.wireframe_detail */
|
||||
enum VolumeWireframeDetail : int {
|
||||
VOLUME_WIREFRAME_COARSE = 0,
|
||||
VOLUME_WIREFRAME_FINE = 1,
|
||||
};
|
||||
|
||||
/** #VolumeRender.precision */
|
||||
enum VolumeRenderPrecision : int {
|
||||
VOLUME_PRECISION_HALF = 0,
|
||||
VOLUME_PRECISION_FULL = 1,
|
||||
VOLUME_PRECISION_VARIABLE = 2,
|
||||
};
|
||||
|
||||
/** #VolumeRender.space */
|
||||
enum VolumeRenderSpace : int {
|
||||
VOLUME_SPACE_OBJECT = 0,
|
||||
VOLUME_SPACE_WORLD = 1,
|
||||
};
|
||||
|
||||
/** #VolumeDisplay.interpolation_method */
|
||||
enum VolumeDisplayInterpMethod : int {
|
||||
VOLUME_DISPLAY_INTERP_LINEAR = 0,
|
||||
VOLUME_DISPLAY_INTERP_CUBIC = 1,
|
||||
VOLUME_DISPLAY_INTERP_CLOSEST = 2,
|
||||
};
|
||||
|
||||
/** #VolumeDisplay.axis_slice_method */
|
||||
enum AxisAlignedSlicingMethod : int {
|
||||
VOLUME_AXIS_SLICE_FULL = 0,
|
||||
VOLUME_AXIS_SLICE_SINGLE = 1,
|
||||
};
|
||||
|
||||
/** #VolumeDisplay.slice_axis */
|
||||
enum SliceAxis : int {
|
||||
VOLUME_SLICE_AXIS_AUTO = 0,
|
||||
VOLUME_SLICE_AXIS_X = 1,
|
||||
VOLUME_SLICE_AXIS_Y = 2,
|
||||
VOLUME_SLICE_AXIS_Z = 3,
|
||||
};
|
||||
|
||||
struct VolumeDisplay {
|
||||
float density = 1.0f;
|
||||
VolumeWireframeType wireframe_type = VOLUME_WIREFRAME_BOXES;
|
||||
VolumeWireframeDetail wireframe_detail = VOLUME_WIREFRAME_COARSE;
|
||||
VolumeDisplayInterpMethod interpolation_method = VOLUME_DISPLAY_INTERP_LINEAR;
|
||||
AxisAlignedSlicingMethod axis_slice_method = VOLUME_AXIS_SLICE_FULL;
|
||||
SliceAxis slice_axis = VOLUME_SLICE_AXIS_AUTO;
|
||||
float slice_depth = 0.5f;
|
||||
int _pad[1] = {};
|
||||
};
|
||||
|
||||
struct VolumeRender {
|
||||
VolumeRenderPrecision precision = VOLUME_PRECISION_HALF;
|
||||
VolumeRenderSpace space = VOLUME_SPACE_OBJECT;
|
||||
float step_size = 0.0f;
|
||||
float clipping = 0.001f;
|
||||
};
|
||||
|
||||
struct Volume {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_VO;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
struct AnimData *adt = nullptr; /* animation data (must be immediately after id) */
|
||||
|
||||
/* File */
|
||||
char filepath[/*FILE_MAX*/ 1024] = "";
|
||||
struct PackedFile *packedfile = nullptr;
|
||||
|
||||
/* Sequence */
|
||||
char is_sequence = 0;
|
||||
VolumeSequenceMode sequence_mode = VOLUME_SEQUENCE_CLIP;
|
||||
char _pad1[2] = {};
|
||||
int frame_start = 1;
|
||||
int frame_duration = 0;
|
||||
int frame_offset = 0;
|
||||
|
||||
/* Flag */
|
||||
eVolume_Flag flag = {};
|
||||
|
||||
/* Grids */
|
||||
int active_grid = 0;
|
||||
|
||||
/* Material */
|
||||
struct Material **mat = nullptr;
|
||||
short totcol = 0;
|
||||
short _pad2[3] = {};
|
||||
|
||||
/* Render & Display Settings */
|
||||
VolumeRender render;
|
||||
VolumeDisplay display;
|
||||
|
||||
/* Velocity field name. */
|
||||
char velocity_grid[64] = "";
|
||||
|
||||
char _pad3[3] = {};
|
||||
|
||||
/* Unit of time the velocity vectors are expressed in.
|
||||
* This uses the same enumeration values as #CacheFile.velocity_unit. */
|
||||
char velocity_unit = 0;
|
||||
|
||||
/* Factor for velocity vector for artistic control. */
|
||||
float velocity_scale = 1.0f;
|
||||
|
||||
/* Draw Cache */
|
||||
draw::VolumeBatchCache *batch_cache = nullptr;
|
||||
|
||||
/* Runtime Data */
|
||||
bke::VolumeRuntime *runtime = nullptr;
|
||||
};
|
||||
|
||||
/* Only one material supported currently. */
|
||||
#define VOLUME_MATERIAL_NR 1
|
||||
|
||||
} // namespace blender
|
||||
@@ -0,0 +1,76 @@
|
||||
/* SPDX-FileCopyrightText: 2007 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* Operator type return flags: exec(), invoke() modal(), return values.
|
||||
*/
|
||||
enum wmOperatorStatus {
|
||||
OPERATOR_RUNNING_MODAL = (1 << 0),
|
||||
OPERATOR_CANCELLED = (1 << 1),
|
||||
OPERATOR_FINISHED = (1 << 2),
|
||||
/** Add this flag if the event should pass through. */
|
||||
OPERATOR_PASS_THROUGH = (1 << 3),
|
||||
/** In case operator got executed outside WM code (like via file-select). */
|
||||
OPERATOR_HANDLED = (1 << 4),
|
||||
/**
|
||||
* Used for operators that act indirectly (eg. popup menu).
|
||||
* \note this isn't great design (using operators to trigger UI) avoid where possible.
|
||||
*/
|
||||
OPERATOR_INTERFACE = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(wmOperatorStatus);
|
||||
|
||||
#define OPERATOR_FLAGS_ALL \
|
||||
(OPERATOR_RUNNING_MODAL | OPERATOR_CANCELLED | OPERATOR_FINISHED | OPERATOR_PASS_THROUGH | \
|
||||
OPERATOR_HANDLED | OPERATOR_INTERFACE | 0)
|
||||
|
||||
/* sanity checks for debug mode only */
|
||||
#define OPERATOR_RETVAL_CHECK(ret) \
|
||||
{ \
|
||||
CHECK_TYPE(ret, wmOperatorStatus); \
|
||||
BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret); \
|
||||
} \
|
||||
((void)0)
|
||||
|
||||
/** #wmOperator.flag */
|
||||
enum eOperator_Flag : short {
|
||||
/**
|
||||
* Low level flag so exec() operators can tell if they were invoked, use with care.
|
||||
* Typically this shouldn't make any difference, but it rare cases its needed (see smooth-view).
|
||||
*/
|
||||
OP_IS_INVOKE = (1 << 0),
|
||||
/** So we can detect if an operators exec() call is activated by adjusting the last action. */
|
||||
OP_IS_REPEAT = (1 << 1),
|
||||
/**
|
||||
* So we can detect if an operators exec() call is activated from #SCREEN_OT_repeat_last.
|
||||
*
|
||||
* This difference can be important because previous settings may be used,
|
||||
* even with #PROP_SKIP_SAVE the repeat last operator will use the previous settings.
|
||||
* Unlike #OP_IS_REPEAT the selection (and context generally) may be different each time.
|
||||
* See #60777 for an example of when this is needed.
|
||||
*/
|
||||
OP_IS_REPEAT_LAST = (1 << 2),
|
||||
|
||||
/** When the cursor is grabbed */
|
||||
OP_IS_MODAL_GRAB_CURSOR = (1 << 3),
|
||||
|
||||
/**
|
||||
* Allow modal operators to have the region under the cursor for their context
|
||||
* (the region-type is maintained to prevent errors).
|
||||
*/
|
||||
OP_IS_MODAL_CURSOR_REGION = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eOperator_Flag)
|
||||
|
||||
} // namespace blender
|
||||
518
blender-5.2.0/source/blender/makesdna/DNA_windowmanager_types.h
Normal file
518
blender-5.2.0/source/blender/makesdna/DNA_windowmanager_types.h
Normal file
@@ -0,0 +1,518 @@
|
||||
/* SPDX-FileCopyrightText: 2007 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_windowmanager_enums.h" /* Own enums. */
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_screen_types.h" /* for #ScrAreaMap */
|
||||
#include "DNA_xr_types.h" /* for #XrSessionSettings */
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/** Workaround to forward-declare C++ type in C header. */
|
||||
namespace bke {
|
||||
struct WindowManagerRuntime;
|
||||
struct WindowRuntime;
|
||||
} // namespace bke
|
||||
|
||||
namespace ui {
|
||||
struct Layout;
|
||||
} // namespace ui
|
||||
|
||||
#ifdef hyper /* MSVC defines. */
|
||||
# undef hyper
|
||||
#endif
|
||||
|
||||
/* Defined here: */
|
||||
|
||||
struct wmNotifier;
|
||||
struct wmWindow;
|
||||
struct wmWindowManager;
|
||||
|
||||
struct wmEvent_ConsecutiveData;
|
||||
struct wmEvent;
|
||||
struct wmKeyConfig;
|
||||
struct wmKeyMap;
|
||||
struct wmMsgBus;
|
||||
struct wmOperator;
|
||||
struct wmOperatorType;
|
||||
|
||||
/* Forward declarations: */
|
||||
|
||||
struct PointerRNA;
|
||||
struct Report;
|
||||
struct ReportList;
|
||||
struct Stereo3dFormat;
|
||||
struct bContext;
|
||||
struct bScreen;
|
||||
struct wmTimer;
|
||||
|
||||
#define OP_MAX_TYPENAME 64
|
||||
#define KMAP_MAX_NAME 64
|
||||
|
||||
/* Timer custom-data to control reports display. */
|
||||
/* These two lines with # tell `makesdna` this struct can be excluded. */
|
||||
#
|
||||
#
|
||||
struct ReportTimerInfo {
|
||||
float widthfac = 0;
|
||||
float flash_progress = 0;
|
||||
};
|
||||
|
||||
/* reports need to be before wmWindowManager */
|
||||
|
||||
// #ifdef WITH_XR_OPENXR
|
||||
struct wmXrData {
|
||||
/** Runtime information for managing Blender specific behaviors. */
|
||||
struct wmXrRuntimeData *runtime = nullptr;
|
||||
/** Permanent session settings (draw mode, feature toggles, etc). Stored in files and accessible
|
||||
* even before the session runs. */
|
||||
XrSessionSettings session_settings;
|
||||
};
|
||||
// #endif
|
||||
|
||||
/** #wmWindowManager.extensions_updates */
|
||||
enum eWM_ExtensionsUpdates : int {
|
||||
WM_EXTENSIONS_UPDATE_UNSET = -2,
|
||||
WM_EXTENSIONS_UPDATE_CHECKING = -1,
|
||||
};
|
||||
|
||||
/** #wmWindowManager.init_flag */
|
||||
enum eWM_InitFlag : uint8_t {
|
||||
WM_INIT_FLAG_WINDOW = (1 << 0),
|
||||
WM_INIT_FLAG_KEYCONFIG = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(eWM_InitFlag)
|
||||
|
||||
/** #wmWindowManager.outliner_sync_select_dirty */
|
||||
enum eWM_OutlinerSyncSelectDirty : short {
|
||||
WM_OUTLINER_SYNC_SELECT_FROM_OBJECT = (1 << 0),
|
||||
WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE = (1 << 1),
|
||||
WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE = (1 << 2),
|
||||
WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eWM_OutlinerSyncSelectDirty)
|
||||
|
||||
#define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
|
||||
(WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
|
||||
WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
|
||||
|
||||
/** Window-manager is saved, tag WMAN. */
|
||||
struct wmWindowManager {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_WM;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
ListBaseT<wmWindow> windows = {nullptr, nullptr};
|
||||
|
||||
/** Set on file read. */
|
||||
eWM_InitFlag init_flag = {};
|
||||
char _pad0[1] = {};
|
||||
/** Indicator whether data was saved. */
|
||||
short file_saved = 0;
|
||||
/** Operator stack depth to avoid nested undo pushes. */
|
||||
short op_undo_depth = 0;
|
||||
|
||||
/** Set after selection to notify outliner to sync. Stores type of selection */
|
||||
eWM_OutlinerSyncSelectDirty outliner_sync_select_dirty = {};
|
||||
|
||||
/** Available/pending extensions updates. */
|
||||
eWM_ExtensionsUpdates extensions_updates = {};
|
||||
/** Number of blocked & installed extensions. */
|
||||
int extensions_blocked = 0;
|
||||
|
||||
/** Timer for auto save. */
|
||||
struct wmTimer *autosavetimer = nullptr;
|
||||
/** Auto-save timer was up, but it wasn't possible to auto-save in the current mode. */
|
||||
char autosave_scheduled = 0;
|
||||
char _pad2[7] = {};
|
||||
|
||||
// #ifdef WITH_XR_OPENXR
|
||||
wmXrData xr;
|
||||
// #endif
|
||||
|
||||
bke::WindowManagerRuntime *runtime = nullptr;
|
||||
};
|
||||
|
||||
#define WM_KEYCONFIG_ARRAY_P(wm) \
|
||||
&(wm)->runtime->defaultconf, &(wm)->runtime->addonconf, &(wm)->runtime->userconf
|
||||
|
||||
#define WM_KEYCONFIG_STR_DEFAULT "Blender"
|
||||
|
||||
/* IME is win32 and apple only! */
|
||||
#if !(defined(WIN32) || defined(__APPLE__)) && !defined(DNA_DEPRECATED)
|
||||
# ifdef __GNUC__
|
||||
# define ime_data ime_data __attribute__((deprecated))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The saveable part, the rest of the data is local in GHOST.
|
||||
*/
|
||||
struct wmWindow {
|
||||
DNA_DEFINE_CXX_METHODS(wmWindow)
|
||||
|
||||
struct wmWindow *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Parent window. */
|
||||
struct wmWindow *parent = nullptr;
|
||||
|
||||
/** Active scene displayed in this window. */
|
||||
struct Scene *scene = nullptr;
|
||||
/** Temporary when switching. */
|
||||
struct Scene *new_scene = nullptr;
|
||||
/** Active view layer displayed in this window. */
|
||||
char view_layer_name[/*MAX_NAME*/ 64] = "";
|
||||
/** The workspace may temporarily override the window's scene with scene pinning. This is the
|
||||
* "overridden" or "default" scene to restore when entering a workspace with no scene pinned. */
|
||||
struct Scene *unpinned_scene = nullptr;
|
||||
|
||||
struct WorkSpaceInstanceHook *workspace_hook = nullptr;
|
||||
|
||||
/** Global areas aren't part of the screen, but part of the window directly.
|
||||
* \note Code assumes global areas with fixed height, fixed width not supported yet */
|
||||
ScrAreaMap global_areas;
|
||||
|
||||
DNA_DEPRECATED struct bScreen *screen = nullptr;
|
||||
|
||||
/** Window-ID also in screens, is for retrieving this window after read. */
|
||||
int winid = 0;
|
||||
/** Window coords (in pixels). */
|
||||
short posx = 0, posy = 0;
|
||||
/**
|
||||
* Window size (in pixels).
|
||||
*
|
||||
* \note Loading a window typically uses the size & position saved in the blend-file,
|
||||
* there is an exception for startup files which works as follows:
|
||||
* Setting the window size to zero before `ghostwin` has been set has a special meaning,
|
||||
* it causes the window size to be initialized to `wm_init_state.size`.
|
||||
* These default to the main screen size but can be overridden by the `--window-geometry`
|
||||
* command line argument.
|
||||
*
|
||||
* \warning Using these values directly can result in errors on macOS due to HiDPI displays
|
||||
* influencing the window native pixel size. See #WM_window_native_pixel_size for a general use
|
||||
* alternative.
|
||||
*/
|
||||
short sizex = 0, sizey = 0;
|
||||
/** Normal, maximized, full-screen, #GHOST_TWindowState. */
|
||||
char windowstate = 0;
|
||||
/** Set to 1 if an active window, for quick rejects. */
|
||||
char active = 0;
|
||||
/** Current mouse cursor type. */
|
||||
short cursor = 0;
|
||||
/** Previous cursor when setting modal one. */
|
||||
short lastcursor = 0;
|
||||
/** The current modal cursor. */
|
||||
short modalcursor = 0;
|
||||
/** Cursor grab mode #GHOST_TGrabCursorMode (run-time only) */
|
||||
short grabcursor = 0;
|
||||
|
||||
/** Internal, lock pie creation from this event until released. */
|
||||
short pie_event_type_lock = 0;
|
||||
/**
|
||||
* Exception to the above rule for nested pies, store last pie event for operators
|
||||
* that spawn a new pie right after destruction of last pie.
|
||||
*/
|
||||
short pie_event_type_last = 0;
|
||||
|
||||
char tag_cursor_refresh = 0;
|
||||
|
||||
/* Track the state of the event queue,
|
||||
* these store the state that needs to be kept between handling events in the queue. */
|
||||
/** Enable when #KM_PRESS events are not handled (keyboard/mouse-buttons only). */
|
||||
char event_queue_check_click = 0;
|
||||
/** Enable when #KM_PRESS events are not handled (keyboard/mouse-buttons only). */
|
||||
char event_queue_check_drag = 0;
|
||||
/**
|
||||
* Enable when the drag was handled,
|
||||
* to avoid mouse-motion continually triggering drag events which are not handled
|
||||
* but add overhead to gizmo handling (for example), see #87511.
|
||||
*/
|
||||
char event_queue_check_drag_handled = 0;
|
||||
|
||||
/**
|
||||
* The last event type (that passed #WM_event_consecutive_gesture_test check).
|
||||
* A #wmEventType is assigned to this value.
|
||||
*/
|
||||
short event_queue_consecutive_gesture_type = 0;
|
||||
/** The cursor location when `event_queue_consecutive_gesture_type` was set. */
|
||||
int event_queue_consecutive_gesture_xy[2] = {};
|
||||
/** See #WM_event_consecutive_data_get and related API. Freed when consecutive events end. */
|
||||
struct wmEvent_ConsecutiveData *event_queue_consecutive_gesture_data = nullptr;
|
||||
|
||||
/**
|
||||
* Internal: tag this for extra mouse-move event,
|
||||
* makes cursors/buttons active on UI switching.
|
||||
*/
|
||||
char addmousemove = 0;
|
||||
char _pad1[7] = {};
|
||||
|
||||
/** Properties for stereoscopic displays. */
|
||||
struct Stereo3dFormat *stereo3d_format = nullptr;
|
||||
|
||||
bke::WindowRuntime *runtime = nullptr;
|
||||
};
|
||||
|
||||
#ifdef ime_data
|
||||
# undef ime_data
|
||||
#endif
|
||||
|
||||
/* These two lines with # tell `makesdna` this struct can be excluded. */
|
||||
/* should be something like DNA_EXCLUDE
|
||||
* but the preprocessor first removes all comments, spaces etc */
|
||||
#
|
||||
#
|
||||
struct wmOperatorTypeMacro {
|
||||
struct wmOperatorTypeMacro *next = nullptr, *prev = nullptr;
|
||||
|
||||
/* operator id */
|
||||
char idname[/*OP_MAX_TYPENAME*/ 64] = "";
|
||||
/* rna pointer to access properties, like keymap */
|
||||
/** Operator properties, assigned to ptr->data and can be written to a file. */
|
||||
struct IDProperty *properties = nullptr;
|
||||
struct PointerRNA *ptr = nullptr;
|
||||
};
|
||||
|
||||
/** #wmKeyMapItem.flag */
|
||||
enum eKMI_Flag : uint8_t {
|
||||
KMI_INACTIVE = (1 << 0),
|
||||
KMI_EXPANDED = (1 << 1),
|
||||
KMI_USER_MODIFIED = (1 << 2),
|
||||
KMI_UPDATE = (1 << 3),
|
||||
/**
|
||||
* When set, ignore events with `wmEvent.flag & WM_EVENT_IS_REPEAT` enabled.
|
||||
*
|
||||
* \note this flag isn't cleared when editing/loading the key-map items,
|
||||
* so it may be set in cases which don't make sense (modifier-keys or mouse-motion for example).
|
||||
*
|
||||
* Knowing if an event may repeat is something set at the operating-systems event handling level
|
||||
* so rely on #WM_EVENT_IS_REPEAT being false non keyboard events instead of checking if this
|
||||
* flag makes sense.
|
||||
*
|
||||
* Only used when: `ISKEYBOARD(kmi->type) || (kmi->type == KM_TEXTINPUT)`
|
||||
* as mouse, 3d-mouse, timer... etc never repeat.
|
||||
*/
|
||||
KMI_REPEAT_IGNORE = (1 << 4),
|
||||
};
|
||||
ENUM_OPERATORS(eKMI_Flag)
|
||||
|
||||
/** #wmKeyMapItem.maptype */
|
||||
enum eKMI_MapType : uint8_t {
|
||||
KMI_TYPE_KEYBOARD = 0,
|
||||
KMI_TYPE_MOUSE = 1,
|
||||
/* 2 is deprecated, was tweak. */
|
||||
KMI_TYPE_TEXTINPUT = 3,
|
||||
KMI_TYPE_TIMER = 4,
|
||||
KMI_TYPE_NDOF = 5,
|
||||
};
|
||||
|
||||
/** #wmKeyMap.flag */
|
||||
enum eKeyMap_Flag : short {
|
||||
/** Modal map, not using operator-names. */
|
||||
KEYMAP_MODAL = (1 << 0),
|
||||
/** User key-map. */
|
||||
KEYMAP_USER = (1 << 1),
|
||||
KEYMAP_EXPANDED = (1 << 2),
|
||||
KEYMAP_CHILDREN_EXPANDED = (1 << 3),
|
||||
/** Diff key-map for user preferences. */
|
||||
KEYMAP_DIFF = (1 << 4),
|
||||
/** Key-map has user modifications. */
|
||||
KEYMAP_USER_MODIFIED = (1 << 5),
|
||||
KEYMAP_UPDATE = (1 << 6),
|
||||
/** key-map for active tool system. */
|
||||
KEYMAP_TOOL = (1 << 7),
|
||||
};
|
||||
ENUM_OPERATORS(eKeyMap_Flag)
|
||||
|
||||
/**
|
||||
* Partial copy of the event, for matching by event handler.
|
||||
*/
|
||||
struct wmKeyMapItem {
|
||||
struct wmKeyMapItem *next = nullptr, *prev = nullptr;
|
||||
|
||||
/* operator */
|
||||
/** Used to retrieve operator type pointer. */
|
||||
char idname[64] = "";
|
||||
/** Operator properties, assigned to ptr->data and can be written to a file. */
|
||||
IDProperty *properties = nullptr;
|
||||
|
||||
/* modal */
|
||||
/** Runtime temporary storage for loading. */
|
||||
char propvalue_str[64] = "";
|
||||
/** If used, the item is from modal map. */
|
||||
short propvalue = 0;
|
||||
|
||||
/* event */
|
||||
/** Event code itself (#EVT_LEFTCTRLKEY, #LEFTMOUSE etc). */
|
||||
short type = 0;
|
||||
/** Button state (#KM_ANY, #KM_PRESS, #KM_DBL_CLICK, #KM_PRESS_DRAG, #KM_NOTHING etc). */
|
||||
int8_t val = 0;
|
||||
/**
|
||||
* The 2D direction of the event to use when `val == KM_PRESS_DRAG`.
|
||||
* Set to #KM_DIRECTION_N, #KM_DIRECTION_S & related values, #KM_NOTHING for any direction.
|
||||
*/
|
||||
int8_t direction = 0;
|
||||
|
||||
/* Modifier keys:
|
||||
* Valid values:
|
||||
* - #KM_ANY
|
||||
* - #KM_NOTHING
|
||||
* - #KM_MOD_HELD (not #KM_PRESS even though the values match).
|
||||
*/
|
||||
|
||||
int8_t shift = 0;
|
||||
int8_t ctrl = 0;
|
||||
int8_t alt = 0;
|
||||
/** Also known as "Apple", "Windows-Key" or "Super". */
|
||||
int8_t oskey = 0;
|
||||
/** See #KM_HYPER for details. */
|
||||
int8_t hyper = 0;
|
||||
|
||||
char _pad0[7] = {};
|
||||
|
||||
/** Raw-key modifier. */
|
||||
short keymodifier = 0;
|
||||
|
||||
/* flag: inactive, expanded */
|
||||
eKMI_Flag flag = {};
|
||||
|
||||
/* runtime */
|
||||
/** Keymap editor. */
|
||||
eKMI_MapType maptype = KMI_TYPE_KEYBOARD;
|
||||
/** Unique identifier. Positive for kmi that override builtins, negative otherwise. */
|
||||
short id = 0;
|
||||
/**
|
||||
* RNA pointer to access properties.
|
||||
*
|
||||
* \note The `ptr.owner_id` value must be NULL, as a signal not to use the context
|
||||
* when running property callbacks such as ENUM item functions.
|
||||
*/
|
||||
struct PointerRNA *ptr = nullptr;
|
||||
};
|
||||
|
||||
/** Used instead of wmKeyMapItem for diff keymaps. */
|
||||
struct wmKeyMapDiffItem {
|
||||
struct wmKeyMapDiffItem *next = nullptr, *prev = nullptr;
|
||||
|
||||
wmKeyMapItem *remove_item = nullptr;
|
||||
wmKeyMapItem *add_item = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stored in WM, the actively used key-maps.
|
||||
*/
|
||||
struct wmKeyMap {
|
||||
struct wmKeyMap *next = nullptr, *prev = nullptr;
|
||||
|
||||
ListBaseT<wmKeyMapItem> items = {nullptr, nullptr};
|
||||
ListBaseT<wmKeyMapDiffItem> diff_items = {nullptr, nullptr};
|
||||
|
||||
/** Global editor keymaps, or for more per space/region. */
|
||||
char idname[64] = "";
|
||||
/** Same IDs as in DNA_space_types.h. */
|
||||
short spaceid = 0;
|
||||
/** See above. */
|
||||
short regionid = 0;
|
||||
/** Optional, see: #wmOwnerID. */
|
||||
char owner_id[128] = "";
|
||||
|
||||
/** General flags. */
|
||||
eKeyMap_Flag flag = {};
|
||||
/** Last kmi id. */
|
||||
short kmi_id = 0;
|
||||
|
||||
/* runtime */
|
||||
/** Verify if enabled in the current context, use #WM_keymap_poll instead of direct calls. */
|
||||
bool (*poll)(struct bContext *);
|
||||
bool (*poll_modal_item)(const struct wmOperator *op, int value) = {};
|
||||
|
||||
/** For modal, #EnumPropertyItem for now. */
|
||||
const void *modal_items = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* This is similar to addon-preferences,
|
||||
* however unlike add-ons key-configurations aren't saved to disk.
|
||||
*
|
||||
* #wmKeyConfigPref is written to DNA,
|
||||
* #wmKeyConfigPrefType_Runtime has the RNA type.
|
||||
*/
|
||||
struct wmKeyConfigPref {
|
||||
struct wmKeyConfigPref *next = nullptr, *prev = nullptr;
|
||||
/** Unique name. */
|
||||
char idname[64] = "";
|
||||
IDProperty *prop = nullptr;
|
||||
};
|
||||
|
||||
/** #wmKeyConfig.flag */
|
||||
enum eKeyConf_Flag : short {
|
||||
KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
|
||||
KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
|
||||
};
|
||||
ENUM_OPERATORS(eKeyConf_Flag)
|
||||
|
||||
struct wmKeyConfig {
|
||||
struct wmKeyConfig *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** Unique name. */
|
||||
char idname[64] = "";
|
||||
/** ID-name of configuration this is derives from, "" if none. */
|
||||
char basename[64] = "";
|
||||
|
||||
ListBaseT<wmKeyMap> keymaps = {nullptr, nullptr};
|
||||
int actkeymap = 0;
|
||||
eKeyConf_Flag flag = {};
|
||||
char _pad0[2] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* This one is the operator itself, stored in files for macros etc.
|
||||
* operator + operator-type should be able to redo entirely, but for different context's.
|
||||
*/
|
||||
struct wmOperator {
|
||||
struct wmOperator *next = nullptr, *prev = nullptr;
|
||||
|
||||
/* saved */
|
||||
/** Used to retrieve type pointer. */
|
||||
char idname[/*OP_MAX_TYPENAME*/ 64] = "";
|
||||
/** Saved, user-settable properties. */
|
||||
IDProperty *properties = nullptr;
|
||||
|
||||
/* runtime */
|
||||
/** Operator type definition from idname. */
|
||||
struct wmOperatorType *type = nullptr;
|
||||
/** Custom storage, only while operator runs. */
|
||||
void *customdata = nullptr;
|
||||
/** Python stores the class instance here. */
|
||||
void *py_instance = nullptr;
|
||||
|
||||
/** Rna pointer to access properties. */
|
||||
struct PointerRNA *ptr = nullptr;
|
||||
/** Errors and warnings storage. */
|
||||
struct ReportList *reports = nullptr;
|
||||
|
||||
/** List of operators, can be a tree. */
|
||||
ListBaseT<wmOperator> macro = {nullptr, nullptr};
|
||||
/** Current running macro, not saved. */
|
||||
struct wmOperator *opm = nullptr;
|
||||
/** Runtime for drawing. */
|
||||
ui::Layout *layout = nullptr;
|
||||
eOperator_Flag flag = {};
|
||||
char _pad[6] = {};
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
254
blender-5.2.0/source/blender/makesdna/DNA_workspace_types.h
Normal file
254
blender-5.2.0/source/blender/makesdna/DNA_workspace_types.h
Normal file
@@ -0,0 +1,254 @@
|
||||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup DNA
|
||||
*
|
||||
* Use API in BKE_workspace.hh to edit these.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BLI_enum_flags.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_asset_types.h"
|
||||
#include "DNA_viewer_path_types.h"
|
||||
|
||||
namespace blender {
|
||||
|
||||
namespace bke {
|
||||
struct WorkSpaceRuntime;
|
||||
}
|
||||
|
||||
/** #bToolRef_Runtime.flag */
|
||||
enum ebToolRef_Runtime_Flag : int {
|
||||
/**
|
||||
* This tool should use the fallback key-map.
|
||||
* Typically gizmos handle this but some tools (such as the knife tool) don't use a gizmo.
|
||||
*/
|
||||
TOOLREF_FLAG_FALLBACK_KEYMAP = (1 << 0),
|
||||
TOOLREF_FLAG_USE_BRUSHES = (1 << 1),
|
||||
};
|
||||
ENUM_OPERATORS(ebToolRef_Runtime_Flag)
|
||||
|
||||
#
|
||||
#
|
||||
struct bToolRef_Runtime {
|
||||
int cursor = 0;
|
||||
|
||||
/** One of these 4 must be defined. */
|
||||
char keymap[64] = "";
|
||||
char gizmo_group[64] = "";
|
||||
char data_block[64] = "";
|
||||
/**
|
||||
* The brush type this tool is limited too, if #TOOLREF_FLAG_USE_BRUSHES is set. Note that this
|
||||
* is a different enum in different modes, e.g. #eBrushSculptType in sculpt mode,
|
||||
* #eBrushVertexPaintType in vertex paint mode.
|
||||
*
|
||||
* -1 means any brush type may be used (0 is used by brush type enums of some modes).
|
||||
*/
|
||||
int brush_type = 0;
|
||||
|
||||
/** Keymap for #bToolRef.idname_fallback, if set. */
|
||||
char keymap_fallback[64] = "";
|
||||
|
||||
/** Use to infer primary operator to use when setting accelerator keys. */
|
||||
char op[64] = "";
|
||||
|
||||
/** Index when a tool is a member of a group. */
|
||||
int index = 0;
|
||||
/** Options: `TOOLREF_FLAG_*`. */
|
||||
ebToolRef_Runtime_Flag flag = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* \note Stored per mode.
|
||||
*/
|
||||
struct bToolRef {
|
||||
struct bToolRef *next = nullptr, *prev = nullptr;
|
||||
char idname[64] = "";
|
||||
|
||||
/** Optionally use these when not interacting directly with the primary tools gizmo. */
|
||||
char idname_fallback[64] = "";
|
||||
|
||||
/**
|
||||
* A pending request to switch to a different tool,
|
||||
* this will be performed as part of the areas tool initialization.
|
||||
* (see #toolsystem_ref_set_by_id_pending).
|
||||
*
|
||||
* Notes:
|
||||
* - This can be used to synchronize tools between areas (if necessary).
|
||||
* - If the tool doesn't exist, the exiting tool will left as is.
|
||||
* - There is no need for a "fallback" version of this variable
|
||||
* since activating the tool will also set its fallback, if it's defined.
|
||||
* - This is not stored in the run-time because it's possible (for example)
|
||||
* for a request to sync to another area isn't handled if the area isn't visible.
|
||||
* So store this in the file, so the pending change can be performed when the area is shown.
|
||||
*/
|
||||
char idname_pending[64] = "";
|
||||
|
||||
/** Use to avoid initializing the same tool multiple times. */
|
||||
short tag = 0;
|
||||
|
||||
/** #bToolKey (space-type, mode), used in 'WM_api.hh' */
|
||||
short space_type = 0;
|
||||
/**
|
||||
* Value depends on the 'space_type', object mode for 3D view, image editor has its own mode too.
|
||||
* RNA needs to handle using item function.
|
||||
*
|
||||
* See: #eSpaceImageMode for SPACE_IMAGE, #eContextObjectMode for SPACE_VIEW3D, etc
|
||||
*/
|
||||
int mode = 0;
|
||||
|
||||
/**
|
||||
* Use for tool options, each group's name must match a tool name:
|
||||
*
|
||||
* {"Tool Name": {"SOME_OT_operator": {...}, ..}, ..}
|
||||
*
|
||||
* This is done since different tools may call the same operators with their own options.
|
||||
*/
|
||||
IDProperty *properties = nullptr;
|
||||
|
||||
/** Variables needed to operate the tool. */
|
||||
bToolRef_Runtime *runtime = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Wrapper for bScreen.
|
||||
*
|
||||
* #bScreens are IDs and thus stored in a main list-base.
|
||||
* We also want to store a list-base of them within the workspace
|
||||
* (so each workspace can have its own set of screen-layouts)
|
||||
* which would mess with the next/prev pointers.
|
||||
* So we use this struct to wrap a bScreen pointer with another pair of next/prev pointers.
|
||||
*/
|
||||
struct WorkSpaceLayout {
|
||||
struct WorkSpaceLayout *next = nullptr, *prev = nullptr;
|
||||
|
||||
struct bScreen *screen = nullptr;
|
||||
/* The name of this layout, we override the RNA name of the screen with this
|
||||
* (but not ID name itself) */
|
||||
char name[/*MAX_NAME*/ 64] = "";
|
||||
};
|
||||
|
||||
/** Optional tags, which features to use, aligned with #bAddon names by convention. */
|
||||
struct wmOwnerID {
|
||||
struct wmOwnerID *next = nullptr, *prev = nullptr;
|
||||
/** Optional, see: #wmOwnerID. */
|
||||
char name[128] = "";
|
||||
};
|
||||
|
||||
enum eWorkSpaceFlags : int {
|
||||
WORKSPACE_USE_FILTER_BY_ORIGIN = (1 << 1),
|
||||
WORKSPACE_USE_PIN_SCENE = (1 << 2),
|
||||
/* Used for syncing time between sequencer scene strips and the active scene. */
|
||||
WORKSPACE_SYNC_SCENE_TIME = (1 << 3),
|
||||
};
|
||||
ENUM_OPERATORS(eWorkSpaceFlags)
|
||||
|
||||
struct WorkSpace {
|
||||
#ifdef __cplusplus
|
||||
/** See #ID_Type comment for why this is here. */
|
||||
static constexpr ID_Type id_type = ID_WS;
|
||||
#endif
|
||||
|
||||
ID id;
|
||||
|
||||
ListBaseT<WorkSpaceLayout> layouts = {nullptr, nullptr};
|
||||
/* Store for each hook (so for each window) which layout has
|
||||
* been activated the last time this workspace was visible. */
|
||||
ListBaseT<struct WorkSpaceDataRelation> hook_layout_relations = {nullptr, nullptr};
|
||||
|
||||
/* Feature tagging (use for addons) */
|
||||
ListBaseT<wmOwnerID> owner_ids = {nullptr, nullptr};
|
||||
|
||||
ListBaseT<bToolRef> tools = {nullptr, nullptr};
|
||||
|
||||
/** Optional, scene to switch to when enabling this workspace (NULL to disable). Cleared on
|
||||
* link/append. */
|
||||
struct Scene *pin_scene = nullptr;
|
||||
|
||||
/* Scene that is used by the sequence editors in this workspace. */
|
||||
struct Scene *sequencer_scene = nullptr;
|
||||
|
||||
char _pad[4] = {};
|
||||
|
||||
int object_mode = 0;
|
||||
|
||||
eWorkSpaceFlags flags = {};
|
||||
|
||||
/** Number for workspace tab reordering in the UI. */
|
||||
int order = 0;
|
||||
|
||||
/** Info text from modal operators (runtime). */
|
||||
bke::WorkSpaceRuntime *runtime = nullptr;
|
||||
|
||||
/** 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;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generic (and simple/primitive) struct for storing a history of assignments/relations
|
||||
* of workspace data to non-workspace data in a listbase inside the workspace.
|
||||
*
|
||||
* Using this we can restore the old state of a workspace if the user switches back to it.
|
||||
*
|
||||
* Usage
|
||||
* =====
|
||||
* When activating a workspace, it should activate the screen-layout that was active in that
|
||||
* workspace before *in this window*.
|
||||
* More concretely:
|
||||
* * There are two windows, win1 and win2.
|
||||
* * Both show workspace ws1, but both also had workspace ws2 activated at some point before.
|
||||
* * Last time ws2 was active in win1, screen-layout sl1 was activated.
|
||||
* * Last time ws2 was active in win2, screen-layout sl2 was activated.
|
||||
* * When changing from ws1 to ws2 in win1, screen-layout sl1 should be activated again.
|
||||
* * When changing from ws1 to ws2 in win2, screen-layout sl2 should be activated again.
|
||||
* So that means we have to store the active screen-layout in a per workspace, per window
|
||||
* relation. This struct is used to store an active screen-layout for each window within the
|
||||
* workspace.
|
||||
* To find the screen-layout to activate for this window-workspace combination, simply lookup
|
||||
* the WorkSpaceDataRelation with the workspace-hook of the window set as parent.
|
||||
*/
|
||||
struct WorkSpaceDataRelation {
|
||||
struct WorkSpaceDataRelation *next = nullptr, *prev = nullptr;
|
||||
|
||||
/** The data used to identify the relation
|
||||
* (e.g. to find screen-layout (= value) from/for a hook).
|
||||
* NOTE: Now runtime only. */
|
||||
void *parent = nullptr;
|
||||
/** The value for this parent-data/workspace relation. */
|
||||
void *value = nullptr;
|
||||
|
||||
/** Reference to the actual parent window, #wmWindow.winid. Used in read/write code. */
|
||||
int parentid = 0;
|
||||
char _pad_0[4] = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Little wrapper to store data that is going to be per window, but coming from the workspace.
|
||||
* It allows us to keep workspace and window data completely separate.
|
||||
*/
|
||||
struct WorkSpaceInstanceHook {
|
||||
WorkSpace *active = nullptr;
|
||||
struct WorkSpaceLayout *act_layout = nullptr;
|
||||
|
||||
/**
|
||||
* Needed because we can't change work-spaces/layouts in running handler loop,
|
||||
* it would break context.
|
||||
*/
|
||||
WorkSpace *temp_workspace_store = nullptr;
|
||||
struct WorkSpaceLayout *temp_layout_store = nullptr;
|
||||
};
|
||||
|
||||
} // namespace blender
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user