Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/makesdna
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/CMakeLists.txt2
-rw-r--r--source/blender/makesdna/DNA_ID.h920
-rw-r--r--source/blender/makesdna/DNA_action_types.h1305
-rw-r--r--source/blender/makesdna/DNA_anim_types.h1420
-rw-r--r--source/blender/makesdna/DNA_armature_types.h328
-rw-r--r--source/blender/makesdna/DNA_boid_types.h267
-rw-r--r--source/blender/makesdna/DNA_brush_types.h814
-rw-r--r--source/blender/makesdna/DNA_cachefile_types.h54
-rw-r--r--source/blender/makesdna/DNA_camera_types.h216
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h270
-rw-r--r--source/blender/makesdna/DNA_collection_types.h66
-rw-r--r--source/blender/makesdna/DNA_color_types.h255
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h1373
-rw-r--r--source/blender/makesdna/DNA_curve_types.h655
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h296
-rw-r--r--source/blender/makesdna/DNA_defs.h12
-rw-r--r--source/blender/makesdna/DNA_documentation.h1
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h335
-rw-r--r--source/blender/makesdna/DNA_effect_types.h130
-rw-r--r--source/blender/makesdna/DNA_fileglobal_types.h40
-rw-r--r--source/blender/makesdna/DNA_freestyle_types.h154
-rw-r--r--source/blender/makesdna/DNA_genfile.h81
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h863
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h889
-rw-r--r--source/blender/makesdna/DNA_gpu_types.h48
-rw-r--r--source/blender/makesdna/DNA_image_types.h253
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h693
-rw-r--r--source/blender/makesdna/DNA_key_types.h179
-rw-r--r--source/blender/makesdna/DNA_lattice_types.h48
-rw-r--r--source/blender/makesdna/DNA_layer_types.h212
-rw-r--r--source/blender/makesdna/DNA_light_types.h150
-rw-r--r--source/blender/makesdna/DNA_lightprobe_types.h228
-rw-r--r--source/blender/makesdna/DNA_linestyle_types.h656
-rw-r--r--source/blender/makesdna/DNA_listBase.h11
-rw-r--r--source/blender/makesdna/DNA_mask_types.h302
-rw-r--r--source/blender/makesdna/DNA_material_types.h454
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h324
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h320
-rw-r--r--source/blender/makesdna/DNA_meta_types.h166
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h2614
-rw-r--r--source/blender/makesdna/DNA_movieclip_types.h244
-rw-r--r--source/blender/makesdna/DNA_nla_types.h126
-rw-r--r--source/blender/makesdna/DNA_node_types.h1611
-rw-r--r--source/blender/makesdna/DNA_object_enums.h34
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim_types.h262
-rw-r--r--source/blender/makesdna/DNA_object_force_types.h825
-rw-r--r--source/blender/makesdna/DNA_object_types.h907
-rw-r--r--source/blender/makesdna/DNA_outliner_types.h144
-rw-r--r--source/blender/makesdna/DNA_packedFile_types.h28
-rw-r--r--source/blender/makesdna/DNA_particle_types.h1024
-rw-r--r--source/blender/makesdna/DNA_rigidbody_types.h520
-rw-r--r--source/blender/makesdna/DNA_scene_types.h3244
-rw-r--r--source/blender/makesdna/DNA_screen_types.h848
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h100
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h797
-rw-r--r--source/blender/makesdna/DNA_shader_fx_types.h308
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h474
-rw-r--r--source/blender/makesdna/DNA_sound_types.h144
-rw-r--r--source/blender/makesdna/DNA_space_types.h2164
-rw-r--r--source/blender/makesdna/DNA_speaker_types.h50
-rw-r--r--source/blender/makesdna/DNA_text_types.h52
-rw-r--r--source/blender/makesdna/DNA_texture_types.h674
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h862
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h1698
-rw-r--r--source/blender/makesdna/DNA_vec_types.h28
-rw-r--r--source/blender/makesdna/DNA_vfont_types.h34
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h240
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h750
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h660
-rw-r--r--source/blender/makesdna/DNA_workspace_types.h168
-rw-r--r--source/blender/makesdna/DNA_world_types.h137
-rw-r--r--source/blender/makesdna/intern/CMakeLists.txt92
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c2300
-rw-r--r--source/blender/makesdna/intern/dna_utils.c369
-rw-r--r--source/blender/makesdna/intern/dna_utils.h32
-rw-r--r--source/blender/makesdna/intern/makesdna.c2414
76 files changed, 20892 insertions, 20876 deletions
diff --git a/source/blender/makesdna/CMakeLists.txt b/source/blender/makesdna/CMakeLists.txt
index 6e057f79931..e4e54aafa81 100644
--- a/source/blender/makesdna/CMakeLists.txt
+++ b/source/blender/makesdna/CMakeLists.txt
@@ -19,7 +19,7 @@
# ***** END GPL LICENSE BLOCK *****
if(WITH_FREESTYLE)
- add_definitions(-DWITH_FREESTYLE)
+ add_definitions(-DWITH_FREESTYLE)
endif()
add_subdirectory(intern)
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index a2bd50b6ade..e8af6cf0d86 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -45,179 +45,177 @@ typedef void (*DrawDataFreeCb)(struct DrawData *engine_data);
#
#
typedef struct DrawData {
- struct DrawData *next, *prev;
- struct DrawEngineType *engine_type;
- /* Only nested data, NOT the engine data itself. */
- DrawDataFreeCb free;
- /* Accumulated recalc flags, which corresponds to ID->recalc flags. */
- int recalc;
+ struct DrawData *next, *prev;
+ struct DrawEngineType *engine_type;
+ /* Only nested data, NOT the engine data itself. */
+ DrawDataFreeCb free;
+ /* Accumulated recalc flags, which corresponds to ID->recalc flags. */
+ int recalc;
} DrawData;
typedef struct DrawDataList {
- struct DrawData *first, *last;
+ struct DrawData *first, *last;
} DrawDataList;
-
typedef struct IDPropertyData {
- void *pointer;
- ListBase group;
- /** Note, we actually fit a double into these two ints. */
- int val, val2;
+ void *pointer;
+ ListBase group;
+ /** Note, we actually fit a double into these two ints. */
+ int val, val2;
} IDPropertyData;
typedef struct IDProperty {
- struct IDProperty *next, *prev;
- char type, subtype;
- short flag;
- /** MAX_IDPROP_NAME. */
- char name[64];
-
- /* saved is used to indicate if this struct has been saved yet.
- * seemed like a good idea as a '_pad' var was needed anyway :) */
- int saved;
- /** Note, alignment for 64 bits. */
- IDPropertyData data;
-
- /* array length, also (this is important!) string length + 1.
- * the idea is to be able to reuse array realloc functions on strings.*/
- int len;
-
- /* Strings and arrays are both buffered, though the buffer isn't saved. */
- /* totallen is total length of allocated array/string, including a buffer.
- * Note that the buffering is mild; the code comes from python's list implementation. */
- int totallen;
+ struct IDProperty *next, *prev;
+ char type, subtype;
+ short flag;
+ /** MAX_IDPROP_NAME. */
+ char name[64];
+
+ /* saved is used to indicate if this struct has been saved yet.
+ * seemed like a good idea as a '_pad' var was needed anyway :) */
+ int saved;
+ /** Note, alignment for 64 bits. */
+ IDPropertyData data;
+
+ /* array length, also (this is important!) string length + 1.
+ * the idea is to be able to reuse array realloc functions on strings.*/
+ int len;
+
+ /* Strings and arrays are both buffered, though the buffer isn't saved. */
+ /* totallen is total length of allocated array/string, including a buffer.
+ * Note that the buffering is mild; the code comes from python's list implementation. */
+ int totallen;
} IDProperty;
#define MAX_IDPROP_NAME 64
-#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
+#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
/*->type*/
enum {
- IDP_STRING = 0,
- IDP_INT = 1,
- IDP_FLOAT = 2,
- IDP_ARRAY = 5,
- IDP_GROUP = 6,
- IDP_ID = 7,
- IDP_DOUBLE = 8,
- IDP_IDPARRAY = 9,
- IDP_NUMTYPES = 10,
+ IDP_STRING = 0,
+ IDP_INT = 1,
+ IDP_FLOAT = 2,
+ IDP_ARRAY = 5,
+ IDP_GROUP = 6,
+ IDP_ID = 7,
+ IDP_DOUBLE = 8,
+ IDP_IDPARRAY = 9,
+ IDP_NUMTYPES = 10,
};
/*->subtype */
/* IDP_STRING */
enum {
- IDP_STRING_SUB_UTF8 = 0, /* default */
- IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
+ IDP_STRING_SUB_UTF8 = 0, /* default */
+ IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
};
/* IDP_GROUP */
enum {
- IDP_GROUP_SUB_NONE = 0, /* default */
- IDP_GROUP_SUB_MODE_OBJECT = 1, /* object mode settings */
- IDP_GROUP_SUB_MODE_EDIT = 2, /* mesh edit mode settings */
- IDP_GROUP_SUB_ENGINE_RENDER = 3, /* render engine settings */
- IDP_GROUP_SUB_OVERRIDE = 4, /* data override */
- IDP_GROUP_SUB_MODE_PAINT_WEIGHT = 5, /* weight paint mode settings */
- IDP_GROUP_SUB_MODE_PAINT_VERTEX = 6, /* vertex paint mode settings */
+ IDP_GROUP_SUB_NONE = 0, /* default */
+ IDP_GROUP_SUB_MODE_OBJECT = 1, /* object mode settings */
+ IDP_GROUP_SUB_MODE_EDIT = 2, /* mesh edit mode settings */
+ IDP_GROUP_SUB_ENGINE_RENDER = 3, /* render engine settings */
+ IDP_GROUP_SUB_OVERRIDE = 4, /* data override */
+ IDP_GROUP_SUB_MODE_PAINT_WEIGHT = 5, /* weight paint mode settings */
+ IDP_GROUP_SUB_MODE_PAINT_VERTEX = 6, /* vertex paint mode settings */
};
/*->flag*/
enum {
- /** This IDProp may be statically overridden.
- * Should only be used/be relevant for custom properties. */
- IDP_FLAG_OVERRIDABLE_STATIC = 1 << 0,
+ /** This IDProp may be statically overridden.
+ * Should only be used/be relevant for custom properties. */
+ IDP_FLAG_OVERRIDABLE_STATIC = 1 << 0,
- /** 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,
+ /** 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,
};
/* add any future new id property types here.*/
-
/* Static ID override structs. */
typedef struct IDOverrideStaticPropertyOperation {
- struct IDOverrideStaticPropertyOperation *next, *prev;
-
- /* Type of override. */
- short operation;
- short flag;
- char _pad0[4];
-
- /* Sub-item references, if needed (for arrays or collections only).
- * We need both reference and local values to allow e.g. insertion into collections (constraints, modifiers...).
- * In collection case, if names are defined, they are used in priority.
- * Names are pointers (instead of char[64]) to save some space, NULL when unset.
- * Indices are -1 when unset. */
- char *subitem_reference_name;
- char *subitem_local_name;
- int subitem_reference_index;
- int subitem_local_index;
+ struct IDOverrideStaticPropertyOperation *next, *prev;
+
+ /* Type of override. */
+ short operation;
+ short flag;
+ char _pad0[4];
+
+ /* Sub-item references, if needed (for arrays or collections only).
+ * We need both reference and local values to allow e.g. insertion into collections (constraints, modifiers...).
+ * In collection case, if names are defined, they are used in priority.
+ * Names are pointers (instead of char[64]) to save some space, NULL when unset.
+ * Indices are -1 when unset. */
+ char *subitem_reference_name;
+ char *subitem_local_name;
+ int subitem_reference_index;
+ int subitem_local_index;
} IDOverrideStaticPropertyOperation;
/* IDOverridePropertyOperation->operation. */
enum {
- /* Basic operations. */
- IDOVERRIDESTATIC_OP_NOOP = 0, /* Special value, forbids any overriding. */
-
- IDOVERRIDESTATIC_OP_REPLACE = 1, /* Fully replace local value by reference one. */
-
- /* Numeric-only operations. */
- IDOVERRIDESTATIC_OP_ADD = 101, /* Add local value to reference one. */
- /* Subtract local value from reference one (needed due to unsigned values etc.). */
- IDOVERRIDESTATIC_OP_SUBTRACT = 102,
- /* Multiply reference value by local one (more useful than diff for scales and the like). */
- IDOVERRIDESTATIC_OP_MULTIPLY = 103,
-
- /* Collection-only operations. */
- IDOVERRIDESTATIC_OP_INSERT_AFTER = 201, /* Insert after given reference's subitem. */
- IDOVERRIDESTATIC_OP_INSERT_BEFORE = 202, /* Insert before given reference's subitem. */
- /* We can add more if needed (move, delete, ...). */
+ /* Basic operations. */
+ IDOVERRIDESTATIC_OP_NOOP = 0, /* Special value, forbids any overriding. */
+
+ IDOVERRIDESTATIC_OP_REPLACE = 1, /* Fully replace local value by reference one. */
+
+ /* Numeric-only operations. */
+ IDOVERRIDESTATIC_OP_ADD = 101, /* Add local value to reference one. */
+ /* Subtract local value from reference one (needed due to unsigned values etc.). */
+ IDOVERRIDESTATIC_OP_SUBTRACT = 102,
+ /* Multiply reference value by local one (more useful than diff for scales and the like). */
+ IDOVERRIDESTATIC_OP_MULTIPLY = 103,
+
+ /* Collection-only operations. */
+ IDOVERRIDESTATIC_OP_INSERT_AFTER = 201, /* Insert after given reference's subitem. */
+ IDOVERRIDESTATIC_OP_INSERT_BEFORE = 202, /* Insert before given reference's subitem. */
+ /* We can add more if needed (move, delete, ...). */
};
/* IDOverridePropertyOperation->flag. */
enum {
- /** User cannot remove that override operation. */
- IDOVERRIDESTATIC_FLAG_MANDATORY = 1 << 0,
- /** User cannot change that override operation. */
- IDOVERRIDESTATIC_FLAG_LOCKED = 1 << 1,
+ /** User cannot remove that override operation. */
+ IDOVERRIDESTATIC_FLAG_MANDATORY = 1 << 0,
+ /** User cannot change that override operation. */
+ IDOVERRIDESTATIC_FLAG_LOCKED = 1 << 1,
};
/** A single overridden property, contain all operations on this one. */
typedef struct IDOverrideStaticProperty {
- struct IDOverrideStaticProperty *next, *prev;
+ struct IDOverrideStaticProperty *next, *prev;
- /**
- * Path from ID to overridden property.
- * *Does not* include indices/names for final arrays/collections items.
- */
- char *rna_path;
+ /**
+ * Path from ID to overridden property.
+ * *Does not* include indices/names for final arrays/collections items.
+ */
+ char *rna_path;
- /** List of overriding operations (IDOverridePropertyOperation) applied to this property. */
- ListBase operations;
+ /** List of overriding operations (IDOverridePropertyOperation) applied to this property. */
+ ListBase operations;
} IDOverrideStaticProperty;
/* Main container for all overriding data info of a data-block. */
typedef struct IDOverrideStatic {
- /** Reference linked ID which this one overrides. */
- struct ID *reference;
- /** List of IDOverrideProperty structs. */
- ListBase properties;
-
- short flag;
- char _pad[6];
-
- /* Read/write data. */
- /* Temp ID storing extra override data (used for differential operations only currently).
- * Always NULL outside of read/write context. */
- struct ID *storage;
+ /** Reference linked ID which this one overrides. */
+ struct ID *reference;
+ /** List of IDOverrideProperty structs. */
+ ListBase properties;
+
+ short flag;
+ char _pad[6];
+
+ /* Read/write data. */
+ /* Temp ID storing extra override data (used for differential operations only currently).
+ * Always NULL outside of read/write context. */
+ struct ID *storage;
} IDOverrideStatic;
enum eStaticOverride_Flag {
- STATICOVERRIDE_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
+ STATICOVERRIDE_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
};
/* watch it: Sequence has identical beginning. */
@@ -227,41 +225,41 @@ enum eStaticOverride_Flag {
* */
/* 2 characters for ID code and 64 for actual name */
-#define MAX_ID_NAME 66
+#define MAX_ID_NAME 66
/* There's a nasty circular dependency here.... 'void *' to the rescue! I
* really wonder why this is needed. */
typedef struct ID {
- void *next, *prev;
- struct ID *newid;
- struct Library *lib;
- /** MAX_ID_NAME. */
- char name[66];
- /**
- * LIB_... flags report on status of the datablock this ID belongs to
- * (persistent, saved to and read from .blend).
- */
- short flag;
- /**
- * LIB_TAG_... tags (runtime only, cleared at read time).
- */
- int tag;
- int us;
- int icon_id;
- int recalc;
- char _pad[4];
- IDProperty *properties;
-
- /** Reference linked ID which this one overrides. */
- IDOverrideStatic *override_static;
-
- /**
- * Only set for datablocks which are coming from copy-on-write, points to
- * the original version of it.
- */
- struct ID *orig_id;
-
- void *py_instance;
+ void *next, *prev;
+ struct ID *newid;
+ struct Library *lib;
+ /** MAX_ID_NAME. */
+ char name[66];
+ /**
+ * LIB_... flags report on status of the datablock this ID belongs to
+ * (persistent, saved to and read from .blend).
+ */
+ short flag;
+ /**
+ * LIB_TAG_... tags (runtime only, cleared at read time).
+ */
+ int tag;
+ int us;
+ int icon_id;
+ int recalc;
+ char _pad[4];
+ IDProperty *properties;
+
+ /** Reference linked ID which this one overrides. */
+ IDOverrideStatic *override_static;
+
+ /**
+ * Only set for datablocks which are coming from copy-on-write, points to
+ * the original version of it.
+ */
+ struct ID *orig_id;
+
+ void *py_instance;
} ID;
/**
@@ -269,71 +267,73 @@ typedef struct ID {
* WARNING: readfile.c, expand_doit() reads this struct without DNA check!
*/
typedef struct Library {
- ID id;
- struct FileData *filedata;
- /** Path name used for reading, can be relative and edited in the outliner. */
- char name[1024];
-
- /**
- * Absolute filepath, this is only for convenience,
- * 'name' is the real path used on file read but in
- * some cases its useful to access the absolute one.
- * This is set on file read.
- * Use BKE_library_filepath_set() rather than setting 'name'
- * directly and it will be kept in sync - campbell */
- char filepath[1024];
-
- /** Set for indirectly linked libs, used in the outliner and while reading. */
- struct Library *parent;
-
- struct PackedFile *packedfile;
-
- /* Temp data needed by read/write code. */
- int temp_index;
- /** See BLENDER_VERSION, BLENDER_SUBVERSION, needed for do_versions. */
- short versionfile, subversionfile;
+ ID id;
+ struct FileData *filedata;
+ /** Path name used for reading, can be relative and edited in the outliner. */
+ char name[1024];
+
+ /**
+ * Absolute filepath, this is only for convenience,
+ * 'name' is the real path used on file read but in
+ * some cases its useful to access the absolute one.
+ * This is set on file read.
+ * Use BKE_library_filepath_set() rather than setting 'name'
+ * directly and it will be kept in sync - campbell */
+ char filepath[1024];
+
+ /** Set for indirectly linked libs, used in the outliner and while reading. */
+ struct Library *parent;
+
+ struct PackedFile *packedfile;
+
+ /* Temp data needed by read/write code. */
+ int temp_index;
+ /** See BLENDER_VERSION, BLENDER_SUBVERSION, needed for do_versions. */
+ short versionfile, subversionfile;
} Library;
enum eIconSizes {
- ICON_SIZE_ICON = 0,
- ICON_SIZE_PREVIEW = 1,
+ ICON_SIZE_ICON = 0,
+ ICON_SIZE_PREVIEW = 1,
- NUM_ICON_SIZES,
+ NUM_ICON_SIZES,
};
/* for PreviewImage->flag */
enum ePreviewImage_Flag {
- PRV_CHANGED = (1 << 0),
- PRV_USER_EDITED = (1 << 1), /* if user-edited, do not auto-update this anymore! */
+ PRV_CHANGED = (1 << 0),
+ PRV_USER_EDITED = (1 << 1), /* if user-edited, do not auto-update this anymore! */
};
/* for PreviewImage->tag */
-enum {
- PRV_TAG_DEFFERED = (1 << 0), /* Actual loading of preview is deferred. */
- PRV_TAG_DEFFERED_RENDERING = (1 << 1), /* Deferred preview is being loaded. */
- PRV_TAG_DEFFERED_DELETE = (1 << 2), /* Deferred preview should be deleted asap. */
+enum {
+ PRV_TAG_DEFFERED = (1 << 0), /* Actual loading of preview is deferred. */
+ PRV_TAG_DEFFERED_RENDERING = (1 << 1), /* Deferred preview is being loaded. */
+ PRV_TAG_DEFFERED_DELETE = (1 << 2), /* Deferred preview should be deleted asap. */
};
typedef struct PreviewImage {
- /* All values of 2 are really NUM_ICON_SIZES */
- unsigned int w[2];
- unsigned int h[2];
- short flag[2];
- short changed_timestamp[2];
- unsigned int *rect[2];
-
- /* Runtime-only data. */
- struct GPUTexture *gputexture[2];
- /** Used by previews outside of ID context. */
- int icon_id;
-
- /** Runtime data. */
- short tag;
- char _pad[2];
+ /* All values of 2 are really NUM_ICON_SIZES */
+ unsigned int w[2];
+ unsigned int h[2];
+ short flag[2];
+ short changed_timestamp[2];
+ unsigned int *rect[2];
+
+ /* Runtime-only data. */
+ struct GPUTexture *gputexture[2];
+ /** Used by previews outside of ID context. */
+ int icon_id;
+
+ /** Runtime data. */
+ short tag;
+ char _pad[2];
} PreviewImage;
#define PRV_DEFERRED_DATA(prv) \
- (CHECK_TYPE_INLINE(prv, PreviewImage *), BLI_assert((prv)->tag & PRV_TAG_DEFFERED), (void *)((prv) + 1))
+ (CHECK_TYPE_INLINE(prv, PreviewImage *), \
+ BLI_assert((prv)->tag & PRV_TAG_DEFFERED), \
+ (void *)((prv) + 1))
/**
* Defines for working with IDs.
@@ -343,11 +343,11 @@ typedef struct PreviewImage {
*/
#ifdef __BIG_ENDIAN__
- /* big endian */
-# define MAKE_ID2(c, d) ((c) << 8 | (d))
+/* big endian */
+# define MAKE_ID2(c, d) ((c) << 8 | (d))
#else
- /* little endian */
-# define MAKE_ID2(c, d) ((d) << 8 | (c))
+/* little endian */
+# define MAKE_ID2(c, d) ((d) << 8 | (c))
#endif
/**
@@ -357,101 +357,109 @@ typedef struct PreviewImage {
* and the first 2 bytes of #ID.name (for runtime checks, see #GS macro).
*/
typedef 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 = MAKE_ID2('C', 'U'), /* Curve */
- 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_IP = MAKE_ID2('I', 'P'), /* Ipo (depreciated, replaced by FCurves) */
- ID_KE = MAKE_ID2('K', 'E'), /* Key (shape key) */
- ID_WO = MAKE_ID2('W', 'O'), /* World */
- ID_SCR = MAKE_ID2('S', 'R'), /* Screen */
- 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'), /* Group */
- 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 = MAKE_ID2('G', 'D'), /* bGPdata, (Grease Pencil) */
- ID_WM = MAKE_ID2('W', 'M'), /* WindowManager */
- 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_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 = MAKE_ID2('C', 'U'), /* Curve */
+ 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_IP = MAKE_ID2('I', 'P'), /* Ipo (depreciated, replaced by FCurves) */
+ ID_KE = MAKE_ID2('K', 'E'), /* Key (shape key) */
+ ID_WO = MAKE_ID2('W', 'O'), /* World */
+ ID_SCR = MAKE_ID2('S', 'R'), /* Screen */
+ 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'), /* Group */
+ 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 = MAKE_ID2('G', 'D'), /* bGPdata, (Grease Pencil) */
+ ID_WM = MAKE_ID2('W', 'M'), /* WindowManager */
+ 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_Type;
/* Only used as 'placeholder' in .blend files for directly linked datablocks. */
-#define ID_LINK_PLACEHOLDER MAKE_ID2('I', 'D') /* (internal use only) */
+#define ID_LINK_PLACEHOLDER MAKE_ID2('I', 'D') /* (internal use only) */
/* Deprecated. */
-#define ID_SCRN MAKE_ID2('S', 'N')
+#define ID_SCRN MAKE_ID2('S', 'N')
/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
-#define ID_SEQ MAKE_ID2('S', 'Q')
+#define ID_SEQ MAKE_ID2('S', 'Q')
/* constraint */
-#define ID_CO MAKE_ID2('C', 'O')
+#define ID_CO MAKE_ID2('C', 'O')
/* pose (action channel, used to be ID_AC in code, so we keep code for backwards compat) */
-#define ID_PO MAKE_ID2('A', 'C')
+#define ID_PO MAKE_ID2('A', 'C')
/* used in outliner... */
-#define ID_NLA MAKE_ID2('N', 'L')
+#define ID_NLA MAKE_ID2('N', 'L')
/* fluidsim Ipo */
-#define ID_FLUIDSIM MAKE_ID2('F', 'S')
+#define ID_FLUIDSIM MAKE_ID2('F', 'S')
#define ID_FAKE_USERS(id) ((((ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0)
#define ID_REAL_USERS(id) (((ID *)id)->us - ID_FAKE_USERS(id))
#define ID_EXTRA_USERS(id) (((ID *)id)->tag & LIB_TAG_EXTRAUSER ? 1 : 0)
-#define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM) && (GS((id)->name) != ID_WS))
+#define ID_CHECK_UNDO(id) \
+ ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM) && (GS((id)->name) != ID_WS))
-#define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path((_bmain)))
-#define ID_BLEND_PATH_FROM_GLOBAL(_id) ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path_from_global())
+#define ID_BLEND_PATH(_bmain, _id) \
+ ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path((_bmain)))
+#define ID_BLEND_PATH_FROM_GLOBAL(_id) \
+ ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path_from_global())
#define ID_MISSING(_id) (((_id)->tag & LIB_TAG_MISSING) != 0)
#define ID_IS_LINKED(_id) (((ID *)(_id))->lib != NULL)
-#define ID_IS_STATIC_OVERRIDE(_id) (((ID *)(_id))->override_static != NULL && \
- ((ID *)(_id))->override_static->reference != NULL)
+#define ID_IS_STATIC_OVERRIDE(_id) \
+ (((ID *)(_id))->override_static != NULL && ((ID *)(_id))->override_static->reference != NULL)
-#define ID_IS_STATIC_OVERRIDE_TEMPLATE(_id) (((ID *)(_id))->override_static != NULL && \
- ((ID *)(_id))->override_static->reference == NULL)
+#define ID_IS_STATIC_OVERRIDE_TEMPLATE(_id) \
+ (((ID *)(_id))->override_static != NULL && ((ID *)(_id))->override_static->reference == NULL)
-#define ID_IS_STATIC_OVERRIDE_AUTO(_id) (!ID_IS_LINKED((_id)) && \
- ID_IS_STATIC_OVERRIDE((_id)) && \
- (((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
+#define ID_IS_STATIC_OVERRIDE_AUTO(_id) \
+ (!ID_IS_LINKED((_id)) && ID_IS_STATIC_OVERRIDE((_id)) && \
+ (((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
/* No copy-on-write for these types.
* Keep in sync with check_datablocks_copy_on_writable and deg_copy_on_write_is_needed */
-#define ID_TYPE_IS_COW(_id_type) \
- (!ELEM(_id_type, ID_BR, ID_LS, ID_PAL, ID_IM))
+#define ID_TYPE_IS_COW(_id_type) (!ELEM(_id_type, ID_BR, ID_LS, ID_PAL, ID_IM))
#ifdef GS
# undef GS
#endif
-#define GS(a) (CHECK_TYPE_ANY(a, char *, const char *, char [66], const char[66]), (ID_Type)(*((const short *)(a))))
+#define GS(a) \
+ (CHECK_TYPE_ANY(a, char *, const char *, char[66], const char[66]), \
+ (ID_Type)(*((const short *)(a))))
#define ID_NEW_SET(_id, _idn) \
- (((ID *)(_id))->newid = (ID *)(_idn), ((ID *)(_id))->newid->tag |= LIB_TAG_NEW, (void *)((ID *)(_id))->newid)
-#define ID_NEW_REMAP(a) if ((a) && (a)->id.newid) (a) = (void *)(a)->id.newid
+ (((ID *)(_id))->newid = (ID *)(_idn), \
+ ((ID *)(_id))->newid->tag |= LIB_TAG_NEW, \
+ (void *)((ID *)(_id))->newid)
+#define ID_NEW_REMAP(a) \
+ if ((a) && (a)->id.newid) \
+ (a) = (void *)(a)->id.newid
/* id->flag (persitent). */
enum {
- LIB_FAKEUSER = 1 << 9,
+ LIB_FAKEUSER = 1 << 9,
};
/**
@@ -469,141 +477,139 @@ enum {
* (except on initialization during .blend file reading).
*/
enum {
- /* RESET_NEVER Datablock is from current .blend file. */
- LIB_TAG_LOCAL = 0,
- /* RESET_NEVER Datablock is from a library,
- * but is used (linked) directly by current .blend file. */
- LIB_TAG_EXTERN = 1 << 0,
- /* RESET_NEVER Datablock is from a library,
- * and is only used (linked) inderectly through other libraries. */
- LIB_TAG_INDIRECT = 1 << 1,
-
- /* RESET_AFTER_USE Flag used internally in readfile.c,
- * to mark IDs needing to be expanded (only done once). */
- LIB_TAG_NEED_EXPAND = 1 << 3,
- /* RESET_AFTER_USE Flag used internally in readfile.c to mark ID
- * placeholders for linked datablocks needing to be read. */
- LIB_TAG_ID_LINK_PLACEHOLDER = 1 << 4,
- /* RESET_AFTER_USE */
- LIB_TAG_NEED_LINK = 1 << 5,
-
- /* RESET_NEVER tag datablock as a place-holder
- * (because the real one could not be linked from its library e.g.). */
- LIB_TAG_MISSING = 1 << 6,
-
- /* RESET_NEVER tag datablock as being up-to-date regarding its reference. */
- LIB_TAG_OVERRIDESTATIC_REFOK = 1 << 9,
- /* RESET_NEVER tag datablock as needing an auto-override execution, if enabled. */
- LIB_TAG_OVERRIDESTATIC_AUTOREFRESH = 1 << 17,
-
- /* tag datablock has having an extra user. */
- LIB_TAG_EXTRAUSER = 1 << 2,
- /* tag datablock has having actually increased usercount for the extra virtual user. */
- LIB_TAG_EXTRAUSER_SET = 1 << 7,
-
- /* RESET_AFTER_USE tag newly duplicated/copied IDs.
- * Also used internally in readfile.c to mark datablocks needing do_versions. */
- LIB_TAG_NEW = 1 << 8,
- /* RESET_BEFORE_USE free test flag.
- * TODO make it a RESET_AFTER_USE too. */
- LIB_TAG_DOIT = 1 << 10,
- /* RESET_AFTER_USE tag existing data before linking so we know what is new. */
- LIB_TAG_PRE_EXISTING = 1 << 11,
-
- /* The datablock is a copy-on-write/localized version. */
- LIB_TAG_COPIED_ON_WRITE = 1 << 12,
- LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT = 1 << 13,
- LIB_TAG_LOCALIZED = 1 << 14,
-
- /* RESET_NEVER tag datablock for freeing etc. behavior
- * (usually set when copying real one into temp/runtime one). */
- LIB_TAG_NO_MAIN = 1 << 15, /* Datablock is not listed in Main database. */
- LIB_TAG_NO_USER_REFCOUNT = 1 << 16, /* Datablock does not refcount usages of other IDs. */
- /* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory
- * (usual type-specific freeing is called though). */
- LIB_TAG_NOT_ALLOCATED = 1 << 18,
+ /* RESET_NEVER Datablock is from current .blend file. */
+ LIB_TAG_LOCAL = 0,
+ /* RESET_NEVER Datablock is from a library,
+ * but is used (linked) directly by current .blend file. */
+ LIB_TAG_EXTERN = 1 << 0,
+ /* RESET_NEVER Datablock is from a library,
+ * and is only used (linked) inderectly through other libraries. */
+ LIB_TAG_INDIRECT = 1 << 1,
+
+ /* RESET_AFTER_USE Flag used internally in readfile.c,
+ * to mark IDs needing to be expanded (only done once). */
+ LIB_TAG_NEED_EXPAND = 1 << 3,
+ /* RESET_AFTER_USE Flag used internally in readfile.c to mark ID
+ * placeholders for linked datablocks needing to be read. */
+ LIB_TAG_ID_LINK_PLACEHOLDER = 1 << 4,
+ /* RESET_AFTER_USE */
+ LIB_TAG_NEED_LINK = 1 << 5,
+
+ /* RESET_NEVER tag datablock as a place-holder
+ * (because the real one could not be linked from its library e.g.). */
+ LIB_TAG_MISSING = 1 << 6,
+
+ /* RESET_NEVER tag datablock as being up-to-date regarding its reference. */
+ LIB_TAG_OVERRIDESTATIC_REFOK = 1 << 9,
+ /* RESET_NEVER tag datablock as needing an auto-override execution, if enabled. */
+ LIB_TAG_OVERRIDESTATIC_AUTOREFRESH = 1 << 17,
+
+ /* tag datablock has having an extra user. */
+ LIB_TAG_EXTRAUSER = 1 << 2,
+ /* tag datablock has having actually increased usercount for the extra virtual user. */
+ LIB_TAG_EXTRAUSER_SET = 1 << 7,
+
+ /* RESET_AFTER_USE tag newly duplicated/copied IDs.
+ * Also used internally in readfile.c to mark datablocks needing do_versions. */
+ LIB_TAG_NEW = 1 << 8,
+ /* RESET_BEFORE_USE free test flag.
+ * TODO make it a RESET_AFTER_USE too. */
+ LIB_TAG_DOIT = 1 << 10,
+ /* RESET_AFTER_USE tag existing data before linking so we know what is new. */
+ LIB_TAG_PRE_EXISTING = 1 << 11,
+
+ /* The datablock is a copy-on-write/localized version. */
+ LIB_TAG_COPIED_ON_WRITE = 1 << 12,
+ LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT = 1 << 13,
+ LIB_TAG_LOCALIZED = 1 << 14,
+
+ /* RESET_NEVER tag datablock for freeing etc. behavior
+ * (usually set when copying real one into temp/runtime one). */
+ LIB_TAG_NO_MAIN = 1 << 15, /* Datablock is not listed in Main database. */
+ LIB_TAG_NO_USER_REFCOUNT = 1 << 16, /* Datablock does not refcount usages of other IDs. */
+ /* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory
+ * (usual type-specific freeing is called though). */
+ LIB_TAG_NOT_ALLOCATED = 1 << 18,
};
/* Tag given ID for an update in all the dependency graphs. */
typedef enum IDRecalcFlag {
- /***************************************************************************
- * Individual update tags, this is what ID gets tagged for update with. */
-
- /* ** Object transformation changed. ** */
- ID_RECALC_TRANSFORM = (1 << 0),
-
- /* ** Object geometry changed. **
- *
- * When object of armature type gets tagged with this flag, it's pose is
- * re-evaluated.
- * When object of other type is tagged with this flag it makes the modifier
- * stack to be re-evaluated.
- * When object data type (mesh, curve, ...) gets tagged with this flag it
- * makes all objects which shares this datablock to be updated. */
- ID_RECALC_GEOMETRY = (1 << 1),
-
- /* ** Animation or time changed and animation is to be re-evaluated. ** */
- ID_RECALC_ANIMATION = (1 << 2),
-
- /* ** Particle system changed. ** */
- /* Only do pathcache etc. */
- ID_RECALC_PSYS_REDO = (1 << 3),
- /* Reset everything including pointcache. */
- ID_RECALC_PSYS_RESET = (1 << 4),
- /* Only child settings changed. */
- ID_RECALC_PSYS_CHILD = (1 << 5),
- /* Physics type changed. */
- ID_RECALC_PSYS_PHYS = (1 << 6),
-
- /* ** Material and shading ** */
-
- /* For materials and node trees this means that topology of the shader tree
- * changed, and the shader is to be recompiled.
- * For objects it means that the draw batch cache is to be redone. */
- ID_RECALC_SHADING = (1 << 7),
- /* TODO(sergey): Consider adding an explicit ID_RECALC_SHADING_PARAMATERS
- * which can be used for cases when only socket value changed, to speed up
- * redraw update in that case. */
-
- /* Selection of the ID itself or its components (for example, vertices) did
- * change, and all the drawing data is to eb updated. */
- ID_RECALC_SELECT = (1 << 9),
- /* Flags on the base did change, and is to be compied onto all the copies of
- * corresponding objects. */
- ID_RECALC_BASE_FLAGS = (1 << 10),
- ID_RECALC_POINT_CACHE = (1 << 11),
- /* Only inform editors about the change. Is used to force update of editors
- * when datablock which is not a part of dependency graph did change.
- *
- * For example, brush texture did change and the preview is to be
- * re-rendered. */
- ID_RECALC_EDITORS = (1 << 12),
-
- /* ** Update copy on write component. **
- * This is most generic tag which should only be used when nothing else
- * matches.
- */
- ID_RECALC_COPY_ON_WRITE = (1 << 13),
-
- /***************************************************************************
- * Pseudonyms, to have more semantic meaning in the actual code without
- * using too much low-level and implementation specific tags. */
-
- /* Update animation datablock itself, without doing full re-evaluation of
- * all dependent objects. */
- ID_RECALC_ANIMATION_NO_FLUSH = ID_RECALC_COPY_ON_WRITE,
-
- /***************************************************************************
- * Aggregate flags, use only for checks on runtime.
- * Do NOT use those for tagging. */
-
- /* Identifies that SOMETHING has been changed in this ID. */
- ID_RECALC_ALL = ~(0),
- /* Identifies that something in particle system did change. */
- ID_RECALC_PSYS_ALL = (ID_RECALC_PSYS_REDO |
- ID_RECALC_PSYS_RESET |
- ID_RECALC_PSYS_CHILD |
- ID_RECALC_PSYS_PHYS),
+ /***************************************************************************
+ * Individual update tags, this is what ID gets tagged for update with. */
+
+ /* ** Object transformation changed. ** */
+ ID_RECALC_TRANSFORM = (1 << 0),
+
+ /* ** Object geometry changed. **
+ *
+ * When object of armature type gets tagged with this flag, it's pose is
+ * re-evaluated.
+ * When object of other type is tagged with this flag it makes the modifier
+ * stack to be re-evaluated.
+ * When object data type (mesh, curve, ...) gets tagged with this flag it
+ * makes all objects which shares this datablock to be updated. */
+ ID_RECALC_GEOMETRY = (1 << 1),
+
+ /* ** Animation or time changed and animation is to be re-evaluated. ** */
+ ID_RECALC_ANIMATION = (1 << 2),
+
+ /* ** Particle system changed. ** */
+ /* Only do pathcache etc. */
+ ID_RECALC_PSYS_REDO = (1 << 3),
+ /* Reset everything including pointcache. */
+ ID_RECALC_PSYS_RESET = (1 << 4),
+ /* Only child settings changed. */
+ ID_RECALC_PSYS_CHILD = (1 << 5),
+ /* Physics type changed. */
+ ID_RECALC_PSYS_PHYS = (1 << 6),
+
+ /* ** Material and shading ** */
+
+ /* For materials and node trees this means that topology of the shader tree
+ * changed, and the shader is to be recompiled.
+ * For objects it means that the draw batch cache is to be redone. */
+ ID_RECALC_SHADING = (1 << 7),
+ /* TODO(sergey): Consider adding an explicit ID_RECALC_SHADING_PARAMATERS
+ * which can be used for cases when only socket value changed, to speed up
+ * redraw update in that case. */
+
+ /* Selection of the ID itself or its components (for example, vertices) did
+ * change, and all the drawing data is to eb updated. */
+ ID_RECALC_SELECT = (1 << 9),
+ /* Flags on the base did change, and is to be compied onto all the copies of
+ * corresponding objects. */
+ ID_RECALC_BASE_FLAGS = (1 << 10),
+ ID_RECALC_POINT_CACHE = (1 << 11),
+ /* Only inform editors about the change. Is used to force update of editors
+ * when datablock which is not a part of dependency graph did change.
+ *
+ * For example, brush texture did change and the preview is to be
+ * re-rendered. */
+ ID_RECALC_EDITORS = (1 << 12),
+
+ /* ** Update copy on write component. **
+ * This is most generic tag which should only be used when nothing else
+ * matches.
+ */
+ ID_RECALC_COPY_ON_WRITE = (1 << 13),
+
+ /***************************************************************************
+ * Pseudonyms, to have more semantic meaning in the actual code without
+ * using too much low-level and implementation specific tags. */
+
+ /* Update animation datablock itself, without doing full re-evaluation of
+ * all dependent objects. */
+ ID_RECALC_ANIMATION_NO_FLUSH = ID_RECALC_COPY_ON_WRITE,
+
+ /***************************************************************************
+ * Aggregate flags, use only for checks on runtime.
+ * Do NOT use those for tagging. */
+
+ /* Identifies that SOMETHING has been changed in this ID. */
+ ID_RECALC_ALL = ~(0),
+ /* Identifies that something in particle system did change. */
+ ID_RECALC_PSYS_ALL = (ID_RECALC_PSYS_REDO | ID_RECALC_PSYS_RESET | ID_RECALC_PSYS_CHILD |
+ ID_RECALC_PSYS_PHYS),
} IDRecalcFlag;
@@ -613,80 +619,80 @@ typedef enum IDRecalcFlag {
* or if we need to fallback to longlong defines :/
*/
enum {
- FILTER_ID_AC = (1 << 0),
- FILTER_ID_AR = (1 << 1),
- FILTER_ID_BR = (1 << 2),
- FILTER_ID_CA = (1 << 3),
- FILTER_ID_CU = (1 << 4),
- FILTER_ID_GD = (1 << 5),
- FILTER_ID_GR = (1 << 6),
- FILTER_ID_IM = (1 << 7),
- FILTER_ID_LA = (1 << 8),
- FILTER_ID_LS = (1 << 9),
- FILTER_ID_LT = (1 << 10),
- FILTER_ID_MA = (1 << 11),
- FILTER_ID_MB = (1 << 12),
- FILTER_ID_MC = (1 << 13),
- FILTER_ID_ME = (1 << 14),
- FILTER_ID_MSK = (1 << 15),
- FILTER_ID_NT = (1 << 16),
- FILTER_ID_OB = (1 << 17),
- FILTER_ID_PAL = (1 << 18),
- FILTER_ID_PC = (1 << 19),
- FILTER_ID_SCE = (1 << 20),
- FILTER_ID_SPK = (1 << 21),
- FILTER_ID_SO = (1 << 22),
- FILTER_ID_TE = (1 << 23),
- FILTER_ID_TXT = (1 << 24),
- FILTER_ID_VF = (1 << 25),
- FILTER_ID_WO = (1 << 26),
- FILTER_ID_PA = (1 << 27),
- FILTER_ID_CF = (1 << 28),
- FILTER_ID_WS = (1 << 29),
- FILTER_ID_LP = (1u << 31),
+ FILTER_ID_AC = (1 << 0),
+ FILTER_ID_AR = (1 << 1),
+ FILTER_ID_BR = (1 << 2),
+ FILTER_ID_CA = (1 << 3),
+ FILTER_ID_CU = (1 << 4),
+ FILTER_ID_GD = (1 << 5),
+ FILTER_ID_GR = (1 << 6),
+ FILTER_ID_IM = (1 << 7),
+ FILTER_ID_LA = (1 << 8),
+ FILTER_ID_LS = (1 << 9),
+ FILTER_ID_LT = (1 << 10),
+ FILTER_ID_MA = (1 << 11),
+ FILTER_ID_MB = (1 << 12),
+ FILTER_ID_MC = (1 << 13),
+ FILTER_ID_ME = (1 << 14),
+ FILTER_ID_MSK = (1 << 15),
+ FILTER_ID_NT = (1 << 16),
+ FILTER_ID_OB = (1 << 17),
+ FILTER_ID_PAL = (1 << 18),
+ FILTER_ID_PC = (1 << 19),
+ FILTER_ID_SCE = (1 << 20),
+ FILTER_ID_SPK = (1 << 21),
+ FILTER_ID_SO = (1 << 22),
+ FILTER_ID_TE = (1 << 23),
+ FILTER_ID_TXT = (1 << 24),
+ FILTER_ID_VF = (1 << 25),
+ FILTER_ID_WO = (1 << 26),
+ FILTER_ID_PA = (1 << 27),
+ FILTER_ID_CF = (1 << 28),
+ FILTER_ID_WS = (1 << 29),
+ FILTER_ID_LP = (1u << 31),
};
/* IMPORTANT: this enum matches the order currently use in set_listbasepointers,
* keep them in sync! */
enum {
- INDEX_ID_LI = 0,
- INDEX_ID_IP,
- INDEX_ID_AC,
- INDEX_ID_KE,
- INDEX_ID_PAL,
- INDEX_ID_GD,
- INDEX_ID_NT,
- INDEX_ID_IM,
- INDEX_ID_TE,
- INDEX_ID_MA,
- INDEX_ID_VF,
- INDEX_ID_AR,
- INDEX_ID_CF,
- INDEX_ID_ME,
- INDEX_ID_CU,
- INDEX_ID_MB,
- INDEX_ID_LT,
- INDEX_ID_LA,
- INDEX_ID_CA,
- INDEX_ID_TXT,
- INDEX_ID_SO,
- INDEX_ID_GR,
- INDEX_ID_PC,
- INDEX_ID_BR,
- INDEX_ID_PA,
- INDEX_ID_SPK,
- INDEX_ID_LP,
- INDEX_ID_WO,
- INDEX_ID_MC,
- INDEX_ID_SCR,
- INDEX_ID_OB,
- INDEX_ID_LS,
- INDEX_ID_SCE,
- INDEX_ID_WS,
- INDEX_ID_WM,
- INDEX_ID_MSK,
- INDEX_ID_NULL,
- INDEX_ID_MAX,
+ INDEX_ID_LI = 0,
+ INDEX_ID_IP,
+ INDEX_ID_AC,
+ INDEX_ID_KE,
+ INDEX_ID_PAL,
+ INDEX_ID_GD,
+ INDEX_ID_NT,
+ INDEX_ID_IM,
+ INDEX_ID_TE,
+ INDEX_ID_MA,
+ INDEX_ID_VF,
+ INDEX_ID_AR,
+ INDEX_ID_CF,
+ INDEX_ID_ME,
+ INDEX_ID_CU,
+ INDEX_ID_MB,
+ INDEX_ID_LT,
+ INDEX_ID_LA,
+ INDEX_ID_CA,
+ INDEX_ID_TXT,
+ INDEX_ID_SO,
+ INDEX_ID_GR,
+ INDEX_ID_PC,
+ INDEX_ID_BR,
+ INDEX_ID_PA,
+ INDEX_ID_SPK,
+ INDEX_ID_LP,
+ INDEX_ID_WO,
+ INDEX_ID_MC,
+ INDEX_ID_SCR,
+ INDEX_ID_OB,
+ INDEX_ID_LS,
+ INDEX_ID_SCE,
+ INDEX_ID_WS,
+ INDEX_ID_WM,
+ INDEX_ID_MSK,
+ INDEX_ID_NULL,
+ INDEX_ID_MAX,
};
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index b17a746f11c..3341272c10f 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -46,17 +46,17 @@ struct SpaceLink;
/* Data point for motion path (mpv) */
typedef struct bMotionPathVert {
- /** Coordinates of point in 3D-space. */
- float co[3];
- /** Quick settings. */
- int flag;
+ /** Coordinates of point in 3D-space. */
+ float co[3];
+ /** Quick settings. */
+ int flag;
} bMotionPathVert;
/* bMotionPathVert->flag */
typedef enum eMotionPathVert_Flag {
- /* vert is selected */
- MOTIONPATH_VERT_SEL = (1 << 0),
- MOTIONPATH_VERT_KEY = (1 << 1),
+ /* vert is selected */
+ MOTIONPATH_VERT_SEL = (1 << 0),
+ MOTIONPATH_VERT_KEY = (1 << 1),
} eMotionPathVert_Flag;
/* ........ */
@@ -65,40 +65,40 @@ typedef enum eMotionPathVert_Flag {
* - for elements providing transforms (i.e. Objects or PoseChannels)
*/
typedef struct bMotionPath {
- /** Path samples. */
- bMotionPathVert *points;
- /** The number of cached verts. */
- int length;
-
- /** For drawing paths, the start frame number. */
- int start_frame;
- /** For drawing paths, the end frame number. */
- int end_frame;
-
- /** Optional custom color. */
- float color[3];
- /** Line thickness. */
- int line_thickness;
- /** Baking settings - eMotionPath_Flag. */
- int flag;
-
- /* Used for drawing. */
- struct GPUVertBuf *points_vbo;
- struct GPUBatch *batch_line;
- struct GPUBatch *batch_points;
- void *_pad;
+ /** Path samples. */
+ bMotionPathVert *points;
+ /** The number of cached verts. */
+ int length;
+
+ /** For drawing paths, the start frame number. */
+ int start_frame;
+ /** For drawing paths, the end frame number. */
+ int end_frame;
+
+ /** Optional custom color. */
+ float color[3];
+ /** Line thickness. */
+ int line_thickness;
+ /** Baking settings - eMotionPath_Flag. */
+ int flag;
+
+ /* Used for drawing. */
+ struct GPUVertBuf *points_vbo;
+ struct GPUBatch *batch_line;
+ struct GPUBatch *batch_points;
+ void *_pad;
} bMotionPath;
/* bMotionPath->flag */
typedef enum eMotionPath_Flag {
- /* (for bones) path represents the head of the bone */
- MOTIONPATH_FLAG_BHEAD = (1 << 0),
- /* motion path is being edited */
- MOTIONPATH_FLAG_EDIT = (1 << 1),
- /* Custom colors */
- MOTIONPATH_FLAG_CUSTOM = (1 << 2),
- /* Draw lines or only points */
- MOTIONPATH_FLAG_LINES = (1 << 3),
+ /* (for bones) path represents the head of the bone */
+ MOTIONPATH_FLAG_BHEAD = (1 << 0),
+ /* motion path is being edited */
+ MOTIONPATH_FLAG_EDIT = (1 << 1),
+ /* Custom colors */
+ MOTIONPATH_FLAG_CUSTOM = (1 << 2),
+ /* Draw lines or only points */
+ MOTIONPATH_FLAG_LINES = (1 << 3),
} eMotionPath_Flag;
/* Visualization General --------------------------- */
@@ -106,94 +106,93 @@ typedef enum eMotionPath_Flag {
/* Animation Visualization Settings (avs) */
typedef struct bAnimVizSettings {
- /* General Settings ------------------------ */
- /** #eAnimViz_RecalcFlags. */
- short recalc;
-
- /* Motion Path Settings ------------------- */
- /** #eMotionPath_Types. */
- short path_type;
- /** Number of frames between points indicated on the paths. */
- short path_step;
-
- /** #eMotionPaths_ViewFlag. */
- short path_viewflag;
- /** #eMotionPaths_BakeFlag. */
- short path_bakeflag;
- char _pad[6];
-
- /** Start and end frames of path-calculation range. */
- int path_sf, path_ef;
- /** Number of frames before/after current frame to show. */
- int path_bc, path_ac;
+ /* General Settings ------------------------ */
+ /** #eAnimViz_RecalcFlags. */
+ short recalc;
+
+ /* Motion Path Settings ------------------- */
+ /** #eMotionPath_Types. */
+ short path_type;
+ /** Number of frames between points indicated on the paths. */
+ short path_step;
+
+ /** #eMotionPaths_ViewFlag. */
+ short path_viewflag;
+ /** #eMotionPaths_BakeFlag. */
+ short path_bakeflag;
+ char _pad[6];
+
+ /** Start and end frames of path-calculation range. */
+ int path_sf, path_ef;
+ /** Number of frames before/after current frame to show. */
+ int path_bc, path_ac;
} bAnimVizSettings;
-
/* bAnimVizSettings->recalc */
typedef enum eAnimViz_RecalcFlags {
- /* motionpaths need recalculating */
- ANIMVIZ_RECALC_PATHS = (1 << 0),
+ /* motionpaths need recalculating */
+ ANIMVIZ_RECALC_PATHS = (1 << 0),
} eAnimViz_RecalcFlags;
/* bAnimVizSettings->path_type */
typedef enum eMotionPaths_Types {
- /* show the paths along their entire ranges */
- MOTIONPATH_TYPE_RANGE = 0,
- /* only show the parts of the paths around the current frame */
- MOTIONPATH_TYPE_ACFRA = 1,
+ /* show the paths along their entire ranges */
+ MOTIONPATH_TYPE_RANGE = 0,
+ /* only show the parts of the paths around the current frame */
+ MOTIONPATH_TYPE_ACFRA = 1,
} eMotionPath_Types;
/* bAnimVizSettings->path_viewflag */
typedef enum eMotionPaths_ViewFlag {
- /* show frames on path */
- MOTIONPATH_VIEW_FNUMS = (1 << 0),
- /* show keyframes on path */
- MOTIONPATH_VIEW_KFRAS = (1 << 1),
- /* show keyframe/frame numbers */
- MOTIONPATH_VIEW_KFNOS = (1 << 2),
- /* find keyframes in whole action (instead of just in matching group name) */
- MOTIONPATH_VIEW_KFACT = (1 << 3),
- /* draw lines on path */
- MOTIONPATH_VIEW_LINES = (1 << 4),
+ /* show frames on path */
+ MOTIONPATH_VIEW_FNUMS = (1 << 0),
+ /* show keyframes on path */
+ MOTIONPATH_VIEW_KFRAS = (1 << 1),
+ /* show keyframe/frame numbers */
+ MOTIONPATH_VIEW_KFNOS = (1 << 2),
+ /* find keyframes in whole action (instead of just in matching group name) */
+ MOTIONPATH_VIEW_KFACT = (1 << 3),
+ /* draw lines on path */
+ MOTIONPATH_VIEW_LINES = (1 << 4),
} eMotionPath_ViewFlag;
/* bAnimVizSettings->path_bakeflag */
typedef enum eMotionPaths_BakeFlag {
- /** motion paths directly associated with this block of settings needs updating */
- MOTIONPATH_BAKE_NEEDS_RECALC = (1 << 0),
- /** for bones - calculate head-points for curves instead of tips */
- MOTIONPATH_BAKE_HEADS = (1 << 1),
- /** motion paths exist for AnimVizSettings instance - set when calc for first time,
- * and unset when clearing */
- MOTIONPATH_BAKE_HAS_PATHS = (1 << 2),
+ /** motion paths directly associated with this block of settings needs updating */
+ MOTIONPATH_BAKE_NEEDS_RECALC = (1 << 0),
+ /** for bones - calculate head-points for curves instead of tips */
+ MOTIONPATH_BAKE_HEADS = (1 << 1),
+ /** motion paths exist for AnimVizSettings instance - set when calc for first time,
+ * and unset when clearing */
+ MOTIONPATH_BAKE_HAS_PATHS = (1 << 2),
} eMotionPath_BakeFlag;
/* runtime */
#
#
typedef struct bPoseChannelDrawData {
- float solid_color[4];
- float wire_color[4];
+ float solid_color[4];
+ float wire_color[4];
- int bbone_matrix_len;
- /* keep last */
- float bbone_matrix[0][4][4];
+ int bbone_matrix_len;
+ /* keep last */
+ float bbone_matrix[0][4][4];
} bPoseChannelDrawData;
struct DualQuat;
struct Mat4;
typedef struct bPoseChannel_Runtime {
- int bbone_segments;
- char _pad[4];
+ int bbone_segments;
+ char _pad[4];
- /* Rest and posed matrices for segments. */
- struct Mat4 *bbone_rest_mats;
- struct Mat4 *bbone_pose_mats;
+ /* Rest and posed matrices for segments. */
+ struct Mat4 *bbone_rest_mats;
+ struct Mat4 *bbone_pose_mats;
- /* Delta from rest to pose in matrix and DualQuat form. */
- struct Mat4 *bbone_deform_mats;
- struct DualQuat *bbone_dual_quats;
+ /* Delta from rest to pose in matrix and DualQuat form. */
+ struct Mat4 *bbone_deform_mats;
+ struct DualQuat *bbone_dual_quats;
} bPoseChannel_Runtime;
/* ************************************************ */
@@ -207,239 +206,239 @@ typedef struct bPoseChannel_Runtime {
* with respect to the restposition of Armature bones
*/
typedef struct bPoseChannel {
- struct bPoseChannel *next, *prev;
-
- /** User-Defined Properties on this PoseChannel. */
- IDProperty *prop;
-
- /** Constraints that act on this PoseChannel. */
- ListBase constraints;
- /** Need to match bone name length: MAXBONENAME. */
- char name[64];
-
- /** Dynamic, for detecting transform changes. */
- short flag;
- /** Settings for IK bones. */
- short ikflag;
- /** Protect channels from being transformed. */
- short protectflag;
- /** Index of action-group this bone belongs to (0 = default/no group). */
- short agrp_index;
- /** For quick detecting which constraints affect this channel. */
- char constflag;
- /** Copy of bone flag, so you can work with library armatures, not for runtime use. */
- char selectflag;
- char drawflag;
- char bboneflag DNA_DEPRECATED;
- char _pad0[4];
-
- /** Set on read file or rebuild pose. */
- struct Bone *bone;
- /** Set on read file or rebuild pose. */
- struct bPoseChannel *parent;
- /** Set on read file or rebuild pose, the 'ik' child, for b-bones. */
- struct bPoseChannel *child;
-
- /** "IK trees" - only while evaluating pose. */
- struct ListBase iktree;
- /** Spline-IK "trees" - only while evaluating pose. */
- struct ListBase siktree;
-
- /** Motion path cache for this bone. */
- bMotionPath *mpath;
- /** Draws custom object instead of default bone shape. */
- struct Object *custom;
- /**
- * Odd feature, display with another bones transform.
- * needed in rare cases for advanced rigs,
- * since the alternative is highly complicated - campbell
- */
- struct bPoseChannel *custom_tx;
- float custom_scale;
-
- char _pad1[4];
-
- /** Transforms - written in by actions or transform. */
- float loc[3];
- float size[3];
-
- /**
- * Rotations - written in by actions or transform
- * (but only one representation gets used at any time)
- */
- /** Euler rotation. */
- float eul[3];
- /** Quaternion rotation. */
- float quat[4];
- /** Axis-angle rotation. */
- float rotAxis[3], rotAngle;
- /** #eRotationModes - rotation representation to use. */
- short rotmode;
- char _pad[2];
-
- /** Matrix result of loc/quat/size, and where we put deform in, see next line */
- float chan_mat[4][4];
- /**
- * Constraints accumulate here. in the end, pose_mat = bone->arm_mat * chan_mat
- * this matrix is object space.
- */
- float pose_mat[4][4];
- /** For display, pose_mat with bone length applied. */
- float disp_mat[4][4];
- /** For display, pose_mat with bone length applied and translated to tai.l*/
- float disp_tail_mat[4][4];
- /**
- * Inverse result of constraints.
- * doesn't include effect of restposition, parent, and local transform.
- */
- float constinv[4][4];
-
- /** Actually pose_mat[3]. */
- float pose_head[3];
- /** Also used for drawing help lines. */
- float pose_tail[3];
-
- /** DOF constraint, note! - these are stored in degrees, not radians. */
- float limitmin[3], limitmax[3];
- /** DOF stiffness. */
- float stiffness[3];
- float ikstretch;
- /** Weight of joint rotation constraint. */
- float ikrotweight;
- /** Weight of joint stretch constraint. */
- float iklinweight;
-
- /**
- * Curved bones settings - these are for animating,
- * and are applied on top of the copies in pchan->bone
- */
- float roll1, roll2;
- float curveInX, curveInY;
- float curveOutX, curveOutY;
- float ease1, ease2;
- float scaleIn, scaleOut;
-
- /** B-Bone custom handles; set on read file or rebuild pose based on pchan->bone data. */
- struct bPoseChannel *bbone_prev;
- struct bPoseChannel *bbone_next;
-
- /** Use for outliner. */
- void *temp;
- /** Runtime data for color and bbone segment matrix. */
- bPoseChannelDrawData *draw_data;
-
- /** Points to an original pose channel. */
- struct bPoseChannel *orig_pchan;
-
- /** Runtime data (keep last). */
- struct bPoseChannel_Runtime runtime;
+ struct bPoseChannel *next, *prev;
+
+ /** User-Defined Properties on this PoseChannel. */
+ IDProperty *prop;
+
+ /** Constraints that act on this PoseChannel. */
+ ListBase constraints;
+ /** Need to match bone name length: MAXBONENAME. */
+ char name[64];
+
+ /** Dynamic, for detecting transform changes. */
+ short flag;
+ /** Settings for IK bones. */
+ short ikflag;
+ /** Protect channels from being transformed. */
+ short protectflag;
+ /** Index of action-group this bone belongs to (0 = default/no group). */
+ short agrp_index;
+ /** For quick detecting which constraints affect this channel. */
+ char constflag;
+ /** Copy of bone flag, so you can work with library armatures, not for runtime use. */
+ char selectflag;
+ char drawflag;
+ char bboneflag DNA_DEPRECATED;
+ char _pad0[4];
+
+ /** Set on read file or rebuild pose. */
+ struct Bone *bone;
+ /** Set on read file or rebuild pose. */
+ struct bPoseChannel *parent;
+ /** Set on read file or rebuild pose, the 'ik' child, for b-bones. */
+ struct bPoseChannel *child;
+
+ /** "IK trees" - only while evaluating pose. */
+ struct ListBase iktree;
+ /** Spline-IK "trees" - only while evaluating pose. */
+ struct ListBase siktree;
+
+ /** Motion path cache for this bone. */
+ bMotionPath *mpath;
+ /** Draws custom object instead of default bone shape. */
+ struct Object *custom;
+ /**
+ * Odd feature, display with another bones transform.
+ * needed in rare cases for advanced rigs,
+ * since the alternative is highly complicated - campbell
+ */
+ struct bPoseChannel *custom_tx;
+ float custom_scale;
+
+ char _pad1[4];
+
+ /** Transforms - written in by actions or transform. */
+ float loc[3];
+ float size[3];
+
+ /**
+ * Rotations - written in by actions or transform
+ * (but only one representation gets used at any time)
+ */
+ /** Euler rotation. */
+ float eul[3];
+ /** Quaternion rotation. */
+ float quat[4];
+ /** Axis-angle rotation. */
+ float rotAxis[3], rotAngle;
+ /** #eRotationModes - rotation representation to use. */
+ short rotmode;
+ char _pad[2];
+
+ /** Matrix result of loc/quat/size, and where we put deform in, see next line */
+ float chan_mat[4][4];
+ /**
+ * Constraints accumulate here. in the end, pose_mat = bone->arm_mat * chan_mat
+ * this matrix is object space.
+ */
+ float pose_mat[4][4];
+ /** For display, pose_mat with bone length applied. */
+ float disp_mat[4][4];
+ /** For display, pose_mat with bone length applied and translated to tai.l*/
+ float disp_tail_mat[4][4];
+ /**
+ * Inverse result of constraints.
+ * doesn't include effect of restposition, parent, and local transform.
+ */
+ float constinv[4][4];
+
+ /** Actually pose_mat[3]. */
+ float pose_head[3];
+ /** Also used for drawing help lines. */
+ float pose_tail[3];
+
+ /** DOF constraint, note! - these are stored in degrees, not radians. */
+ float limitmin[3], limitmax[3];
+ /** DOF stiffness. */
+ float stiffness[3];
+ float ikstretch;
+ /** Weight of joint rotation constraint. */
+ float ikrotweight;
+ /** Weight of joint stretch constraint. */
+ float iklinweight;
+
+ /**
+ * Curved bones settings - these are for animating,
+ * and are applied on top of the copies in pchan->bone
+ */
+ float roll1, roll2;
+ float curveInX, curveInY;
+ float curveOutX, curveOutY;
+ float ease1, ease2;
+ float scaleIn, scaleOut;
+
+ /** B-Bone custom handles; set on read file or rebuild pose based on pchan->bone data. */
+ struct bPoseChannel *bbone_prev;
+ struct bPoseChannel *bbone_next;
+
+ /** Use for outliner. */
+ void *temp;
+ /** Runtime data for color and bbone segment matrix. */
+ bPoseChannelDrawData *draw_data;
+
+ /** Points to an original pose channel. */
+ struct bPoseChannel *orig_pchan;
+
+ /** Runtime data (keep last). */
+ struct bPoseChannel_Runtime runtime;
} bPoseChannel;
-
/* PoseChannel (transform) flags */
typedef enum ePchan_Flag {
- /* has transforms */
- POSE_LOC = (1 << 0),
- POSE_ROT = (1 << 1),
- POSE_SIZE = (1 << 2),
-
- /* old IK/cache stuff
- * - used to be here from (1 << 3) to (1 << 8)
- * but has been repurposed since 2.77.2
- * as they haven't been used in over 10 years
- */
-
- /* has BBone deforms */
- POSE_BBONE_SHAPE = (1 << 3),
-
- /* IK/Pose solving */
- POSE_CHAIN = (1 << 9),
- POSE_DONE = (1 << 10),
- /* visualization */
- POSE_KEY = (1 << 11),
- POSE_STRIDE = (1 << 12),
- /* standard IK solving */
- POSE_IKTREE = (1 << 13),
+ /* has transforms */
+ POSE_LOC = (1 << 0),
+ POSE_ROT = (1 << 1),
+ POSE_SIZE = (1 << 2),
+
+ /* old IK/cache stuff
+ * - used to be here from (1 << 3) to (1 << 8)
+ * but has been repurposed since 2.77.2
+ * as they haven't been used in over 10 years
+ */
+
+ /* has BBone deforms */
+ POSE_BBONE_SHAPE = (1 << 3),
+
+ /* IK/Pose solving */
+ POSE_CHAIN = (1 << 9),
+ POSE_DONE = (1 << 10),
+ /* visualization */
+ POSE_KEY = (1 << 11),
+ POSE_STRIDE = (1 << 12),
+ /* standard IK solving */
+ POSE_IKTREE = (1 << 13),
#if 0
- /* has Spline IK */
- POSE_HAS_IKS = (1 << 14),
+ /* has Spline IK */
+ POSE_HAS_IKS = (1 << 14),
#endif
- /* spline IK solving */
- POSE_IKSPLINE = (1 << 15),
+ /* spline IK solving */
+ POSE_IKSPLINE = (1 << 15),
} ePchan_Flag;
/* PoseChannel constflag (constraint detection) */
typedef enum ePchan_ConstFlag {
- PCHAN_HAS_IK = (1 << 0),
- PCHAN_HAS_CONST = (1 << 1),
- /* only used for drawing Posemode, not stored in channel */
- PCHAN_HAS_ACTION = (1 << 2),
- PCHAN_HAS_TARGET = (1 << 3),
- /* only for drawing Posemode too */
- PCHAN_HAS_STRIDE = (1 << 4),
- /* spline IK */
- PCHAN_HAS_SPLINEIK = (1 << 5),
+ PCHAN_HAS_IK = (1 << 0),
+ PCHAN_HAS_CONST = (1 << 1),
+ /* only used for drawing Posemode, not stored in channel */
+ PCHAN_HAS_ACTION = (1 << 2),
+ PCHAN_HAS_TARGET = (1 << 3),
+ /* only for drawing Posemode too */
+ PCHAN_HAS_STRIDE = (1 << 4),
+ /* spline IK */
+ PCHAN_HAS_SPLINEIK = (1 << 5),
} ePchan_ConstFlag;
/* PoseChannel->ikflag */
typedef enum ePchan_IkFlag {
- BONE_IK_NO_XDOF = (1 << 0),
- BONE_IK_NO_YDOF = (1 << 1),
- BONE_IK_NO_ZDOF = (1 << 2),
+ BONE_IK_NO_XDOF = (1 << 0),
+ BONE_IK_NO_YDOF = (1 << 1),
+ BONE_IK_NO_ZDOF = (1 << 2),
- BONE_IK_XLIMIT = (1 << 3),
- BONE_IK_YLIMIT = (1 << 4),
- BONE_IK_ZLIMIT = (1 << 5),
+ BONE_IK_XLIMIT = (1 << 3),
+ BONE_IK_YLIMIT = (1 << 4),
+ BONE_IK_ZLIMIT = (1 << 5),
- BONE_IK_ROTCTL = (1 << 6),
- BONE_IK_LINCTL = (1 << 7),
+ BONE_IK_ROTCTL = (1 << 6),
+ BONE_IK_LINCTL = (1 << 7),
- BONE_IK_NO_XDOF_TEMP = (1 << 10),
- BONE_IK_NO_YDOF_TEMP = (1 << 11),
- BONE_IK_NO_ZDOF_TEMP = (1 << 12),
+ BONE_IK_NO_XDOF_TEMP = (1 << 10),
+ BONE_IK_NO_YDOF_TEMP = (1 << 11),
+ BONE_IK_NO_ZDOF_TEMP = (1 << 12),
} ePchan_IkFlag;
/* PoseChannel->drawflag */
typedef enum ePchan_DrawFlag {
- PCHAN_DRAW_NO_CUSTOM_BONE_SIZE = (1 << 0),
+ PCHAN_DRAW_NO_CUSTOM_BONE_SIZE = (1 << 0),
} ePchan_DrawFlag;
#define PCHAN_CUSTOM_DRAW_SIZE(pchan) \
- (pchan)->custom_scale * (((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length)
+ (pchan)->custom_scale *( \
+ ((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length)
#ifdef DNA_DEPRECATED_ALLOW
/* PoseChannel->bboneflag */
typedef enum ePchan_BBoneFlag {
- /* Use custom reference bones (for roll and handle alignment), instead of immediate neighbors */
- PCHAN_BBONE_CUSTOM_HANDLES = (1 << 1),
- /* Evaluate start handle as being "relative" */
- PCHAN_BBONE_CUSTOM_START_REL = (1 << 2),
- /* Evaluate end handle as being "relative" */
- PCHAN_BBONE_CUSTOM_END_REL = (1 << 3),
+ /* Use custom reference bones (for roll and handle alignment), instead of immediate neighbors */
+ PCHAN_BBONE_CUSTOM_HANDLES = (1 << 1),
+ /* Evaluate start handle as being "relative" */
+ PCHAN_BBONE_CUSTOM_START_REL = (1 << 2),
+ /* Evaluate end handle as being "relative" */
+ PCHAN_BBONE_CUSTOM_END_REL = (1 << 3),
} ePchan_BBoneFlag;
#endif
/* PoseChannel->rotmode and Object->rotmode */
typedef enum eRotationModes {
- /* quaternion rotations (default, and for older Blender versions) */
- ROT_MODE_QUAT = 0,
- /* euler rotations - keep in sync with enum in BLI_math.h */
- /** Blender 'default' (classic) - must be as 1 to sync with BLI_math_rotation.h defines */
- ROT_MODE_EUL = 1,
- ROT_MODE_XYZ = 1,
- ROT_MODE_XZY = 2,
- ROT_MODE_YXZ = 3,
- ROT_MODE_YZX = 4,
- ROT_MODE_ZXY = 5,
- ROT_MODE_ZYX = 6,
- /* NOTE: space is reserved here for 18 other possible
- * euler rotation orders not implemented
- */
- /* axis angle rotations */
- ROT_MODE_AXISANGLE = -1,
-
- ROT_MODE_MIN = ROT_MODE_AXISANGLE, /* sentinel for Py API */
- ROT_MODE_MAX = ROT_MODE_ZYX,
+ /* quaternion rotations (default, and for older Blender versions) */
+ ROT_MODE_QUAT = 0,
+ /* euler rotations - keep in sync with enum in BLI_math.h */
+ /** Blender 'default' (classic) - must be as 1 to sync with BLI_math_rotation.h defines */
+ ROT_MODE_EUL = 1,
+ ROT_MODE_XYZ = 1,
+ ROT_MODE_XZY = 2,
+ ROT_MODE_YXZ = 3,
+ ROT_MODE_YZX = 4,
+ ROT_MODE_ZXY = 5,
+ ROT_MODE_ZYX = 6,
+ /* NOTE: space is reserved here for 18 other possible
+ * euler rotation orders not implemented
+ */
+ /* axis angle rotations */
+ ROT_MODE_AXISANGLE = -1,
+
+ ROT_MODE_MIN = ROT_MODE_AXISANGLE, /* sentinel for Py API */
+ ROT_MODE_MAX = ROT_MODE_ZYX,
} eRotationModes;
/* Pose ------------------------------------ */
@@ -450,112 +449,110 @@ typedef enum eRotationModes {
* though there is a define for it (hack for the outliner).
*/
typedef struct bPose {
- /** List of pose channels, PoseBones in RNA. */
- ListBase chanbase;
- /** Ghash for quicker string lookups. */
- struct GHash *chanhash;
-
- /* Flat array of pose channels. It references pointers from
- * chanbase. Used for quick pose channel lookup from an index.
- */
- bPoseChannel **chan_array;
-
- short flag;
- char _pad[2];
- /** Proxy layer: copy from armature, gets synced. */
- unsigned int proxy_layer;
- char _pad1[4];
-
- /** Local action time of this pose. */
- float ctime;
- /** Applied to object. */
- float stride_offset[3];
- /** Result of match and cycles, applied in BKE_pose_where_is(). */
- float cyclic_offset[3];
-
-
- /** List of bActionGroups. */
- ListBase agroups;
-
- /** Index of active group (starts from 1). */
- int active_group;
- /** Ik solver to use, see ePose_IKSolverType. */
- int iksolver;
- /** Temporary IK data, depends on the IK solver. Not saved in file. */
- void *ikdata;
- /** IK solver parameters, structure depends on iksolver. */
- void *ikparam;
-
- /** Settings for visualization of bone animation. */
- bAnimVizSettings avs;
- /** Proxy active bone name, MAXBONENAME. */
- char proxy_act_bone[64];
+ /** List of pose channels, PoseBones in RNA. */
+ ListBase chanbase;
+ /** Ghash for quicker string lookups. */
+ struct GHash *chanhash;
+
+ /* Flat array of pose channels. It references pointers from
+ * chanbase. Used for quick pose channel lookup from an index.
+ */
+ bPoseChannel **chan_array;
+
+ short flag;
+ char _pad[2];
+ /** Proxy layer: copy from armature, gets synced. */
+ unsigned int proxy_layer;
+ char _pad1[4];
+
+ /** Local action time of this pose. */
+ float ctime;
+ /** Applied to object. */
+ float stride_offset[3];
+ /** Result of match and cycles, applied in BKE_pose_where_is(). */
+ float cyclic_offset[3];
+
+ /** List of bActionGroups. */
+ ListBase agroups;
+
+ /** Index of active group (starts from 1). */
+ int active_group;
+ /** Ik solver to use, see ePose_IKSolverType. */
+ int iksolver;
+ /** Temporary IK data, depends on the IK solver. Not saved in file. */
+ void *ikdata;
+ /** IK solver parameters, structure depends on iksolver. */
+ void *ikparam;
+
+ /** Settings for visualization of bone animation. */
+ bAnimVizSettings avs;
+ /** Proxy active bone name, MAXBONENAME. */
+ char proxy_act_bone[64];
} bPose;
-
/* Pose->flag */
typedef enum ePose_Flags {
- /* results in BKE_pose_rebuild being called */
- POSE_RECALC = (1 << 0),
- /* prevents any channel from getting overridden by anim from IPO */
- POSE_LOCKED = (1 << 1),
- /* clears the POSE_LOCKED flag for the next time the pose is evaluated */
- POSE_DO_UNLOCK = (1 << 2),
- /* pose has constraints which depend on time (used when depsgraph updates for a new frame) */
- POSE_CONSTRAINTS_TIMEDEPEND = (1 << 3),
- /* recalculate bone paths */
- POSE_RECALCPATHS = (1 << 4),
- /* set by BKE_pose_rebuild to give a chance to the IK solver to rebuild IK tree */
- POSE_WAS_REBUILT = (1 << 5),
- POSE_FLAG_DEPRECATED = (1 << 6), /* deprecated. */
- /* pose constraint flags needs to be updated */
- POSE_CONSTRAINTS_NEED_UPDATE_FLAGS = (1 << 7),
+ /* results in BKE_pose_rebuild being called */
+ POSE_RECALC = (1 << 0),
+ /* prevents any channel from getting overridden by anim from IPO */
+ POSE_LOCKED = (1 << 1),
+ /* clears the POSE_LOCKED flag for the next time the pose is evaluated */
+ POSE_DO_UNLOCK = (1 << 2),
+ /* pose has constraints which depend on time (used when depsgraph updates for a new frame) */
+ POSE_CONSTRAINTS_TIMEDEPEND = (1 << 3),
+ /* recalculate bone paths */
+ POSE_RECALCPATHS = (1 << 4),
+ /* set by BKE_pose_rebuild to give a chance to the IK solver to rebuild IK tree */
+ POSE_WAS_REBUILT = (1 << 5),
+ POSE_FLAG_DEPRECATED = (1 << 6), /* deprecated. */
+ /* pose constraint flags needs to be updated */
+ POSE_CONSTRAINTS_NEED_UPDATE_FLAGS = (1 << 7),
} ePose_Flags;
/* IK Solvers ------------------------------------ */
/* bPose->iksolver and bPose->ikparam->iksolver */
typedef enum ePose_IKSolverType {
- IKSOLVER_STANDARD = 0,
- IKSOLVER_ITASC = 1,
+ IKSOLVER_STANDARD = 0,
+ IKSOLVER_ITASC = 1,
} ePose_IKSolverType;
/* header for all bPose->ikparam structures */
typedef struct bIKParam {
- int iksolver;
+ int iksolver;
} bIKParam;
/* bPose->ikparam when bPose->iksolver=1 */
typedef struct bItasc {
- int iksolver;
- float precision;
- short numiter;
- short numstep;
- float minstep;
- float maxstep;
- short solver;
- short flag;
- float feedback;
- /** Max velocity to SDLS solver. */
- float maxvel;
- /** Maximum damping for DLS solver. */
- float dampmax;
- /** Threshold of singular value from which the damping start progressively. */
- float dampeps;
+ int iksolver;
+ float precision;
+ short numiter;
+ short numstep;
+ float minstep;
+ float maxstep;
+ short solver;
+ short flag;
+ float feedback;
+ /** Max velocity to SDLS solver. */
+ float maxvel;
+ /** Maximum damping for DLS solver. */
+ float dampmax;
+ /** Threshold of singular value from which the damping start progressively. */
+ float dampeps;
} bItasc;
/* bItasc->flag */
typedef enum eItasc_Flags {
- ITASC_AUTO_STEP = (1 << 0),
- ITASC_INITIAL_REITERATION = (1 << 1),
- ITASC_REITERATION = (1 << 2),
- ITASC_SIMULATION = (1 << 3),
+ ITASC_AUTO_STEP = (1 << 0),
+ ITASC_INITIAL_REITERATION = (1 << 1),
+ ITASC_REITERATION = (1 << 2),
+ ITASC_SIMULATION = (1 << 3),
} eItasc_Flags;
/* bItasc->solver */
typedef enum eItasc_Solver {
- ITASC_SOLVER_SDLS = 0, /* selective damped least square, suitable for CopyPose constraint */
- ITASC_SOLVER_DLS = 1, /* damped least square with numerical filtering of damping */
+ ITASC_SOLVER_SDLS = 0, /* selective damped least square, suitable for CopyPose constraint */
+ ITASC_SOLVER_DLS = 1, /* damped least square with numerical filtering of damping */
} eItasc_Solver;
/* ************************************************ */
@@ -579,53 +576,52 @@ typedef enum eItasc_Solver {
* Note that these two uses each have their own RNA 'ActionGroup' and 'BoneGroup'.
*/
typedef struct bActionGroup {
- struct bActionGroup *next, *prev;
-
- /**
- * Note: this must not be touched by standard listbase functions
- * which would clear links to other channels.
- */
- ListBase channels;
-
- /** Settings for this action-group. */
- int flag;
- /**
- * Index of custom color set to use when used for bones
- * (0=default - used for all old files, -1=custom set).
- */
- int customCol;
- /** Name of the group. */
- char name[64];
-
- /** Color set to use when customCol == -1. */
- ThemeWireColor cs;
+ struct bActionGroup *next, *prev;
+
+ /**
+ * Note: this must not be touched by standard listbase functions
+ * which would clear links to other channels.
+ */
+ ListBase channels;
+
+ /** Settings for this action-group. */
+ int flag;
+ /**
+ * Index of custom color set to use when used for bones
+ * (0=default - used for all old files, -1=custom set).
+ */
+ int customCol;
+ /** Name of the group. */
+ char name[64];
+
+ /** Color set to use when customCol == -1. */
+ ThemeWireColor cs;
} bActionGroup;
/* Action Group flags */
typedef enum eActionGroup_Flag {
- /* group is selected */
- AGRP_SELECTED = (1 << 0),
- /* group is 'active' / last selected one */
- AGRP_ACTIVE = (1 << 1),
- /* keyframes/channels belonging to it cannot be edited */
- AGRP_PROTECTED = (1 << 2),
- /* for UI (DopeSheet), sub-channels are shown */
- AGRP_EXPANDED = (1 << 3),
- /* sub-channels are not evaluated */
- AGRP_MUTED = (1 << 4),
- /* sub-channels are not visible in Graph Editor */
- AGRP_NOTVISIBLE = (1 << 5),
- /* for UI (Graph Editor), sub-channels are shown */
- AGRP_EXPANDED_G = (1 << 6),
-
- /* sub channel modifiers off */
- AGRP_MODIFIERS_OFF = (1 << 7),
-
- AGRP_TEMP = (1 << 30),
- AGRP_MOVED = (1u << 31),
+ /* group is selected */
+ AGRP_SELECTED = (1 << 0),
+ /* group is 'active' / last selected one */
+ AGRP_ACTIVE = (1 << 1),
+ /* keyframes/channels belonging to it cannot be edited */
+ AGRP_PROTECTED = (1 << 2),
+ /* for UI (DopeSheet), sub-channels are shown */
+ AGRP_EXPANDED = (1 << 3),
+ /* sub-channels are not evaluated */
+ AGRP_MUTED = (1 << 4),
+ /* sub-channels are not visible in Graph Editor */
+ AGRP_NOTVISIBLE = (1 << 5),
+ /* for UI (Graph Editor), sub-channels are shown */
+ AGRP_EXPANDED_G = (1 << 6),
+
+ /* sub channel modifiers off */
+ AGRP_MODIFIERS_OFF = (1 << 7),
+
+ AGRP_TEMP = (1 << 30),
+ AGRP_MOVED = (1u << 31),
} eActionGroup_Flag;
-
/* Actions -------------------------------------- */
/* Action - reusable F-Curve 'bag' (act)
@@ -639,276 +635,271 @@ typedef enum eActionGroup_Flag {
* affects a group of related settings (as defined by the user).
*/
typedef struct bAction {
- /** ID-serialisation for relinking. */
- ID id;
-
- /** Function-curves (FCurve). */
- ListBase curves;
- /** Legacy data - Action Channels (bActionChannel) in pre-2.5 animation system. */
- ListBase chanbase DNA_DEPRECATED;
- /** Groups of function-curves (bActionGroup). */
- ListBase groups;
- /** Markers local to the Action (used to provide Pose-Libraries). */
- ListBase markers;
-
- /** Settings for this action. */
- int flag;
- /** Index of the active marker. */
- int active_marker;
-
- /**
- * Type of ID-blocks that action can be assigned to
- * (if 0, will be set to whatever ID first evaluates it).
- */
- int idroot;
- char _pad[4];
+ /** ID-serialisation for relinking. */
+ ID id;
+
+ /** Function-curves (FCurve). */
+ ListBase curves;
+ /** Legacy data - Action Channels (bActionChannel) in pre-2.5 animation system. */
+ ListBase chanbase DNA_DEPRECATED;
+ /** Groups of function-curves (bActionGroup). */
+ ListBase groups;
+ /** Markers local to the Action (used to provide Pose-Libraries). */
+ ListBase markers;
+
+ /** Settings for this action. */
+ int flag;
+ /** Index of the active marker. */
+ int active_marker;
+
+ /**
+ * Type of ID-blocks that action can be assigned to
+ * (if 0, will be set to whatever ID first evaluates it).
+ */
+ int idroot;
+ char _pad[4];
} bAction;
-
/* Flags for the action */
typedef enum eAction_Flags {
- /* flags for displaying in UI */
- ACT_COLLAPSED = (1 << 0),
- ACT_SELECTED = (1 << 1),
-
- /* flags for evaluation/editing */
- ACT_MUTED = (1 << 9),
- ACT_PROTECTED = (1 << 10),
- ACT_DISABLED = (1 << 11),
+ /* flags for displaying in UI */
+ ACT_COLLAPSED = (1 << 0),
+ ACT_SELECTED = (1 << 1),
+
+ /* flags for evaluation/editing */
+ ACT_MUTED = (1 << 9),
+ ACT_PROTECTED = (1 << 10),
+ ACT_DISABLED = (1 << 11),
} eAction_Flags;
-
/* ************************************************ */
/* Action/Dopesheet Editor */
/* Storage for Dopesheet/Grease-Pencil Editor data */
typedef struct bDopeSheet {
- /** Currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil). */
- ID *source;
- /** Cache for channels (only initialized when pinned). */ // XXX not used!
- ListBase chanbase;
-
- /** Object group for option to only include objects that belong to this Collection. */
- struct Collection *filter_grp;
- /** String to search for in displayed names of F-Curves, or NlaTracks/GP Layers/etc. */
- char searchstr[64];
-
- /** Flags to use for filtering data. */
- int filterflag;
- int filterflag2;
- /** Standard flags. */
- int flag;
-
- /** `index + 1` of channel to rename - only gets set by renaming operator. */
- int renameIndex;
+ /** Currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil). */
+ ID *source;
+ /** Cache for channels (only initialized when pinned). */ // XXX not used!
+ ListBase chanbase;
+
+ /** Object group for option to only include objects that belong to this Collection. */
+ struct Collection *filter_grp;
+ /** String to search for in displayed names of F-Curves, or NlaTracks/GP Layers/etc. */
+ char searchstr[64];
+
+ /** Flags to use for filtering data. */
+ int filterflag;
+ int filterflag2;
+ /** Standard flags. */
+ int flag;
+
+ /** `index + 1` of channel to rename - only gets set by renaming operator. */
+ int renameIndex;
} bDopeSheet;
-
/* DopeSheet filter-flag */
typedef enum eDopeSheet_FilterFlag {
- /* general filtering */
- /** only include channels relating to selected data */
- ADS_FILTER_ONLYSEL = (1 << 0),
-
- /* temporary filters */
- /** for 'Drivers' editor - only include Driver data from AnimData */
- ADS_FILTER_ONLYDRIVERS = (1 << 1),
- /** for 'NLA' editor - only include NLA data from AnimData */
- ADS_FILTER_ONLYNLA = (1 << 2),
- /** for Graph Editor - used to indicate whether to include a filtering flag or not */
- ADS_FILTER_SELEDIT = (1 << 3),
-
- /* general filtering */
- /** for 'DopeSheet' Editors - include 'summary' line */
- ADS_FILTER_SUMMARY = (1 << 4),
-
- /* datatype-based filtering */
- ADS_FILTER_NOSHAPEKEYS = (1 << 6),
- ADS_FILTER_NOMESH = (1 << 7),
- /** for animdata on object level, if we only want to concentrate on materials/etc. */
- ADS_FILTER_NOOBJ = (1 << 8),
- ADS_FILTER_NOLAT = (1 << 9),
- ADS_FILTER_NOCAM = (1 << 10),
- ADS_FILTER_NOMAT = (1 << 11),
- ADS_FILTER_NOLAM = (1 << 12),
- ADS_FILTER_NOCUR = (1 << 13),
- ADS_FILTER_NOWOR = (1 << 14),
- ADS_FILTER_NOSCE = (1 << 15),
- ADS_FILTER_NOPART = (1 << 16),
- ADS_FILTER_NOMBA = (1 << 17),
- ADS_FILTER_NOARM = (1 << 18),
- ADS_FILTER_NONTREE = (1 << 19),
- ADS_FILTER_NOTEX = (1 << 20),
- ADS_FILTER_NOSPK = (1 << 21),
- ADS_FILTER_NOLINESTYLE = (1 << 22),
- ADS_FILTER_NOMODIFIERS = (1 << 23),
- ADS_FILTER_NOGPENCIL = (1 << 24),
- /* NOTE: all new datablock filters will have to go in filterflag2 (see below) */
-
- /* NLA-specific filters */
- /** if the AnimData block has no NLA data, don't include to just show Action-line */
- ADS_FILTER_NLA_NOACT = (1 << 25),
-
- /* general filtering 3 */
- /** include 'hidden' channels too (i.e. those from hidden Objects/Bones) */
- ADS_FILTER_INCL_HIDDEN = (1 << 26),
- /** show only F-Curves which are disabled/have errors - for debugging drivers */
- ADS_FILTER_ONLY_ERRORS = (1 << 28),
-
- /* GPencil Mode */
- /** GP Mode - Only show datablocks used in the scene */
- ADS_FILTER_GP_3DONLY = (1 << 29),
-
- /** combination filters (some only used at runtime) */
- ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM | ADS_FILTER_NOMAT | ADS_FILTER_NOLAM | ADS_FILTER_NOCUR | ADS_FILTER_NOPART | ADS_FILTER_NOARM | ADS_FILTER_NOSPK | ADS_FILTER_NOMODIFIERS),
+ /* general filtering */
+ /** only include channels relating to selected data */
+ ADS_FILTER_ONLYSEL = (1 << 0),
+
+ /* temporary filters */
+ /** for 'Drivers' editor - only include Driver data from AnimData */
+ ADS_FILTER_ONLYDRIVERS = (1 << 1),
+ /** for 'NLA' editor - only include NLA data from AnimData */
+ ADS_FILTER_ONLYNLA = (1 << 2),
+ /** for Graph Editor - used to indicate whether to include a filtering flag or not */
+ ADS_FILTER_SELEDIT = (1 << 3),
+
+ /* general filtering */
+ /** for 'DopeSheet' Editors - include 'summary' line */
+ ADS_FILTER_SUMMARY = (1 << 4),
+
+ /* datatype-based filtering */
+ ADS_FILTER_NOSHAPEKEYS = (1 << 6),
+ ADS_FILTER_NOMESH = (1 << 7),
+ /** for animdata on object level, if we only want to concentrate on materials/etc. */
+ ADS_FILTER_NOOBJ = (1 << 8),
+ ADS_FILTER_NOLAT = (1 << 9),
+ ADS_FILTER_NOCAM = (1 << 10),
+ ADS_FILTER_NOMAT = (1 << 11),
+ ADS_FILTER_NOLAM = (1 << 12),
+ ADS_FILTER_NOCUR = (1 << 13),
+ ADS_FILTER_NOWOR = (1 << 14),
+ ADS_FILTER_NOSCE = (1 << 15),
+ ADS_FILTER_NOPART = (1 << 16),
+ ADS_FILTER_NOMBA = (1 << 17),
+ ADS_FILTER_NOARM = (1 << 18),
+ ADS_FILTER_NONTREE = (1 << 19),
+ ADS_FILTER_NOTEX = (1 << 20),
+ ADS_FILTER_NOSPK = (1 << 21),
+ ADS_FILTER_NOLINESTYLE = (1 << 22),
+ ADS_FILTER_NOMODIFIERS = (1 << 23),
+ ADS_FILTER_NOGPENCIL = (1 << 24),
+ /* NOTE: all new datablock filters will have to go in filterflag2 (see below) */
+
+ /* NLA-specific filters */
+ /** if the AnimData block has no NLA data, don't include to just show Action-line */
+ ADS_FILTER_NLA_NOACT = (1 << 25),
+
+ /* general filtering 3 */
+ /** include 'hidden' channels too (i.e. those from hidden Objects/Bones) */
+ ADS_FILTER_INCL_HIDDEN = (1 << 26),
+ /** show only F-Curves which are disabled/have errors - for debugging drivers */
+ ADS_FILTER_ONLY_ERRORS = (1 << 28),
+
+ /* GPencil Mode */
+ /** GP Mode - Only show datablocks used in the scene */
+ ADS_FILTER_GP_3DONLY = (1 << 29),
+
+ /** combination filters (some only used at runtime) */
+ ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM | ADS_FILTER_NOMAT | ADS_FILTER_NOLAM |
+ ADS_FILTER_NOCUR | ADS_FILTER_NOPART | ADS_FILTER_NOARM |
+ ADS_FILTER_NOSPK | ADS_FILTER_NOMODIFIERS),
} eDopeSheet_FilterFlag;
/* DopeSheet filter-flags - Overflow (filterflag2) */
typedef enum eDopeSheet_FilterFlag2 {
- ADS_FILTER_NOCACHEFILES = (1 << 1),
+ ADS_FILTER_NOCACHEFILES = (1 << 1),
} eDopeSheet_FilterFlag2;
/* DopeSheet general flags */
typedef enum eDopeSheet_Flag {
- /** when summary is shown, it is collapsed, so all other channels get hidden */
- ADS_FLAG_SUMMARY_COLLAPSED = (1 << 0),
- /** show filters for datablocks */
- ADS_FLAG_SHOW_DBFILTERS = (1 << 1),
-
- /** use fuzzy/partial string matches when ADS_FILTER_BY_FCU_NAME is enabled
- * (WARNING: expensive operation) */
- ADS_FLAG_FUZZY_NAMES = (1 << 2),
- /** do not sort datablocks (mostly objects) by name (NOTE: potentially expensive operation) */
- ADS_FLAG_NO_DB_SORT = (1 << 3),
+ /** when summary is shown, it is collapsed, so all other channels get hidden */
+ ADS_FLAG_SUMMARY_COLLAPSED = (1 << 0),
+ /** show filters for datablocks */
+ ADS_FLAG_SHOW_DBFILTERS = (1 << 1),
+
+ /** use fuzzy/partial string matches when ADS_FILTER_BY_FCU_NAME is enabled
+ * (WARNING: expensive operation) */
+ ADS_FLAG_FUZZY_NAMES = (1 << 2),
+ /** do not sort datablocks (mostly objects) by name (NOTE: potentially expensive operation) */
+ ADS_FLAG_NO_DB_SORT = (1 << 3),
} eDopeSheet_Flag;
-
-
typedef struct SpaceAction_Runtime {
- char flag;
- char _pad0[7];
+ char flag;
+ char _pad0[7];
} SpaceAction_Runtime;
/* Action Editor Space. This is defined here instead of in DNA_space_types.h */
typedef struct SpaceAction {
- struct SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** Copied to region. */
- View2D v2d DNA_DEPRECATED;
-
- /** The currently active action. */
- bAction *action;
- /** The currently active context (when not showing action). */
- bDopeSheet ads;
-
- /** For Time-Slide transform mode drawing - current frame?. */
- float timeslide;
-
- short flag;
- /* Editing context */
- char mode;
- /* Storage for sub-space types. */
- char mode_prev;
- /** Automatic keyframe snapping mode . */
- char autosnap;
- /** (eTimeline_Cache_Flag). */
- char cache_display;
- char _pad1[6];
-
- SpaceAction_Runtime runtime;
+ struct SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** Copied to region. */
+ View2D v2d DNA_DEPRECATED;
+
+ /** The currently active action. */
+ bAction *action;
+ /** The currently active context (when not showing action). */
+ bDopeSheet ads;
+
+ /** For Time-Slide transform mode drawing - current frame?. */
+ float timeslide;
+
+ short flag;
+ /* Editing context */
+ char mode;
+ /* Storage for sub-space types. */
+ char mode_prev;
+ /** Automatic keyframe snapping mode . */
+ char autosnap;
+ /** (eTimeline_Cache_Flag). */
+ char cache_display;
+ char _pad1[6];
+
+ SpaceAction_Runtime runtime;
} SpaceAction;
/* SpaceAction flag */
typedef enum eSAction_Flag {
- /* during transform (only set for TimeSlide) */
- SACTION_MOVING = (1 << 0),
- /* show sliders */
- SACTION_SLIDERS = (1 << 1),
- /* draw time in seconds instead of time in frames */
- SACTION_DRAWTIME = (1 << 2),
- /* don't filter action channels according to visibility */
- //SACTION_NOHIDE = (1 << 3), // XXX deprecated... old animation system
- /* don't kill overlapping keyframes after transform */
- SACTION_NOTRANSKEYCULL = (1 << 4),
- /* don't include keyframes that are out of view */
- //SACTION_HORIZOPTIMISEON = (1 << 5), // XXX deprecated... old irrelevant trick
- /* show pose-markers (local to action) in Action Editor mode */
- SACTION_POSEMARKERS_SHOW = (1 << 6),
- /* don't draw action channels using group colors (where applicable) */
- SACTION_NODRAWGCOLORS = (1 << 7),
- /* don't draw current frame number beside frame indicator */
- SACTION_NODRAWCFRANUM = (1 << 8),
- /* don't perform realtime updates */
- SACTION_NOREALTIMEUPDATES = (1 << 10),
- /* move markers as well as keyframes */
- SACTION_MARKERS_MOVE = (1 << 11),
- /* show interpolation type */
- SACTION_SHOW_INTERPOLATION = (1 << 12),
- /* show extremes */
- SACTION_SHOW_EXTREMES = (1 << 13),
- /* show vertical line markers */
- SACTION_SHOW_MARKER_LINES = (1 << 14),
+ /* during transform (only set for TimeSlide) */
+ SACTION_MOVING = (1 << 0),
+ /* show sliders */
+ SACTION_SLIDERS = (1 << 1),
+ /* draw time in seconds instead of time in frames */
+ SACTION_DRAWTIME = (1 << 2),
+ /* don't filter action channels according to visibility */
+ //SACTION_NOHIDE = (1 << 3), // XXX deprecated... old animation system
+ /* don't kill overlapping keyframes after transform */
+ SACTION_NOTRANSKEYCULL = (1 << 4),
+ /* don't include keyframes that are out of view */
+ //SACTION_HORIZOPTIMISEON = (1 << 5), // XXX deprecated... old irrelevant trick
+ /* show pose-markers (local to action) in Action Editor mode */
+ SACTION_POSEMARKERS_SHOW = (1 << 6),
+ /* don't draw action channels using group colors (where applicable) */
+ SACTION_NODRAWGCOLORS = (1 << 7),
+ /* don't draw current frame number beside frame indicator */
+ SACTION_NODRAWCFRANUM = (1 << 8),
+ /* don't perform realtime updates */
+ SACTION_NOREALTIMEUPDATES = (1 << 10),
+ /* move markers as well as keyframes */
+ SACTION_MARKERS_MOVE = (1 << 11),
+ /* show interpolation type */
+ SACTION_SHOW_INTERPOLATION = (1 << 12),
+ /* show extremes */
+ SACTION_SHOW_EXTREMES = (1 << 13),
+ /* show vertical line markers */
+ SACTION_SHOW_MARKER_LINES = (1 << 14),
} eSAction_Flag;
-
/* SpaceAction_Runtime.flag */
typedef enum eSAction_Runtime_Flag {
- /** Temporary flag to force channel selections to be synced with main */
- SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC = (1 << 0),
+ /** Temporary flag to force channel selections to be synced with main */
+ SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC = (1 << 0),
} eSAction_Runtime_Flag;
/* SpaceAction Mode Settings */
typedef enum eAnimEdit_Context {
- /* action on the active object */
- SACTCONT_ACTION = 0,
- /* list of all shapekeys on the active object, linked with their F-Curves */
- SACTCONT_SHAPEKEY = 1,
- /* editing of gpencil data */
- SACTCONT_GPENCIL = 2,
- /* dopesheet (default) */
- SACTCONT_DOPESHEET = 3,
- /* mask */
- SACTCONT_MASK = 4,
- /* cache file */
- SACTCONT_CACHEFILE = 5,
- /* timeline - replacement for the standalone "timeline editor" */
- SACTCONT_TIMELINE = 6,
+ /* action on the active object */
+ SACTCONT_ACTION = 0,
+ /* list of all shapekeys on the active object, linked with their F-Curves */
+ SACTCONT_SHAPEKEY = 1,
+ /* editing of gpencil data */
+ SACTCONT_GPENCIL = 2,
+ /* dopesheet (default) */
+ SACTCONT_DOPESHEET = 3,
+ /* mask */
+ SACTCONT_MASK = 4,
+ /* cache file */
+ SACTCONT_CACHEFILE = 5,
+ /* timeline - replacement for the standalone "timeline editor" */
+ SACTCONT_TIMELINE = 6,
} eAnimEdit_Context;
/* SpaceAction AutoSnap Settings (also used by other Animation Editors) */
typedef enum eAnimEdit_AutoSnap {
- /* no auto-snap */
- SACTSNAP_OFF = 0,
- /* snap to 1.0 frame/second intervals */
- SACTSNAP_STEP = 1,
- /* snap to actual frames/seconds (nla-action time) */
- SACTSNAP_FRAME = 2,
- /* snap to nearest marker */
- SACTSNAP_MARKER = 3,
- /* snap to actual seconds (nla-action time) */
- SACTSNAP_SECOND = 4,
- /* snap to 1.0 second increments */
- SACTSNAP_TSTEP = 5,
+ /* no auto-snap */
+ SACTSNAP_OFF = 0,
+ /* snap to 1.0 frame/second intervals */
+ SACTSNAP_STEP = 1,
+ /* snap to actual frames/seconds (nla-action time) */
+ SACTSNAP_FRAME = 2,
+ /* snap to nearest marker */
+ SACTSNAP_MARKER = 3,
+ /* snap to actual seconds (nla-action time) */
+ SACTSNAP_SECOND = 4,
+ /* snap to 1.0 second increments */
+ SACTSNAP_TSTEP = 5,
} eAnimEdit_AutoSnap;
/* SAction->cache_display */
typedef enum eTimeline_Cache_Flag {
- TIME_CACHE_DISPLAY = (1 << 0),
- TIME_CACHE_SOFTBODY = (1 << 1),
- TIME_CACHE_PARTICLES = (1 << 2),
- TIME_CACHE_CLOTH = (1 << 3),
- TIME_CACHE_SMOKE = (1 << 4),
- TIME_CACHE_DYNAMICPAINT = (1 << 5),
- TIME_CACHE_RIGIDBODY = (1 << 6),
+ TIME_CACHE_DISPLAY = (1 << 0),
+ TIME_CACHE_SOFTBODY = (1 << 1),
+ TIME_CACHE_PARTICLES = (1 << 2),
+ TIME_CACHE_CLOTH = (1 << 3),
+ TIME_CACHE_SMOKE = (1 << 4),
+ TIME_CACHE_DYNAMICPAINT = (1 << 5),
+ TIME_CACHE_RIGIDBODY = (1 << 6),
} eTimeline_Cache_Flag;
-
/* ************************************************ */
/* Legacy Data */
@@ -924,33 +915,33 @@ typedef enum eTimeline_Cache_Flag {
* to the position of the group in the list, and their position within the group.
*/
typedef struct bActionChannel {
- struct bActionChannel *next, *prev;
- /** Action Group this Action Channel belongs to. */
- bActionGroup *grp;
-
- /** IPO block this action channel references. */
- struct Ipo *ipo;
- /** Constraint Channels (when Action Channel represents an Object or Bone). */
- ListBase constraintChannels;
-
- /** Settings accessed via bitmapping. */
- int flag;
- /** Channel name, MAX_NAME. */
- char name[64];
- /** Temporary setting - may be used to indicate group that channel belongs to during syncing. */
- int temp;
+ struct bActionChannel *next, *prev;
+ /** Action Group this Action Channel belongs to. */
+ bActionGroup *grp;
+
+ /** IPO block this action channel references. */
+ struct Ipo *ipo;
+ /** Constraint Channels (when Action Channel represents an Object or Bone). */
+ ListBase constraintChannels;
+
+ /** Settings accessed via bitmapping. */
+ int flag;
+ /** Channel name, MAX_NAME. */
+ char name[64];
+ /** Temporary setting - may be used to indicate group that channel belongs to during syncing. */
+ int temp;
} bActionChannel;
/* Action Channel flags (ONLY USED FOR DO_VERSIONS...) */
typedef enum eActionChannelFlag {
- ACHAN_SELECTED = (1 << 0),
- ACHAN_HIGHLIGHTED = (1 << 1),
- ACHAN_HIDDEN = (1 << 2),
- ACHAN_PROTECTED = (1 << 3),
- ACHAN_EXPANDED = (1 << 4),
- ACHAN_SHOWIPO = (1 << 5),
- ACHAN_SHOWCONS = (1 << 6),
- ACHAN_MOVED = (1u << 31),
+ ACHAN_SELECTED = (1 << 0),
+ ACHAN_HIGHLIGHTED = (1 << 1),
+ ACHAN_HIDDEN = (1 << 2),
+ ACHAN_PROTECTED = (1 << 3),
+ ACHAN_EXPANDED = (1 << 4),
+ ACHAN_SHOWIPO = (1 << 5),
+ ACHAN_SHOWCONS = (1 << 6),
+ ACHAN_MOVED = (1u << 31),
} eActionChannelFlag;
-#endif /* __DNA_ACTION_TYPES_H__ */
+#endif /* __DNA_ACTION_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 9125d8e6b60..48771410fcc 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -45,31 +45,31 @@ extern "C" {
* when evaluating the curve's data at some time (t).
*/
typedef struct FModifier {
- struct FModifier *next, *prev;
-
- /** Containing curve, only used for updates to CYCLES. */
- struct FCurve *curve;
- /** Pointer to modifier data. */
- void *data;
-
- /** User-defined description for the modifier - MAX_ID_NAME-2. */
- char name[64];
- /** Type of f-curve modifier. */
- short type;
- /** Settings for the modifier. */
- short flag;
-
- /** The amount that the modifier should influence the value. */
- float influence;
-
- /** Start frame of restricted frame-range. */
- float sfra;
- /** End frame of restricted frame-range. */
- float efra;
- /** Number of frames from sfra before modifier takes full influence. */
- float blendin;
- /** Number of frames from efra before modifier fades out. */
- float blendout;
+ struct FModifier *next, *prev;
+
+ /** Containing curve, only used for updates to CYCLES. */
+ struct FCurve *curve;
+ /** Pointer to modifier data. */
+ void *data;
+
+ /** User-defined description for the modifier - MAX_ID_NAME-2. */
+ char name[64];
+ /** Type of f-curve modifier. */
+ short type;
+ /** Settings for the modifier. */
+ short flag;
+
+ /** The amount that the modifier should influence the value. */
+ float influence;
+
+ /** Start frame of restricted frame-range. */
+ float sfra;
+ /** End frame of restricted frame-range. */
+ float efra;
+ /** Number of frames from sfra before modifier takes full influence. */
+ float blendin;
+ /** Number of frames from efra before modifier fades out. */
+ float blendout;
} FModifier;
/**
@@ -77,73 +77,71 @@ typedef struct FModifier {
* WARNING: order here is important!
*/
typedef enum eFModifier_Types {
- 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,
- /** Unimplemented - for applying: fft, high/low pass filters, etc. */
- FMODIFIER_TYPE_FILTER = 6,
- FMODIFIER_TYPE_PYTHON = 7,
- FMODIFIER_TYPE_LIMITS = 8,
- FMODIFIER_TYPE_STEPPED = 9,
-
- /* NOTE: all new modifiers must be added above this line */
- FMODIFIER_NUM_TYPES,
+ 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,
+ /** Unimplemented - for applying: fft, high/low pass filters, etc. */
+ FMODIFIER_TYPE_FILTER = 6,
+ FMODIFIER_TYPE_PYTHON = 7,
+ FMODIFIER_TYPE_LIMITS = 8,
+ FMODIFIER_TYPE_STEPPED = 9,
+
+ /* NOTE: all new modifiers must be added above this line */
+ FMODIFIER_NUM_TYPES,
} eFModifier_Types;
/** F-Curve Modifier Settings. */
typedef enum eFModifier_Flags {
- /** Modifier is not able to be evaluated for some reason, and should be skipped (internal). */
- FMODIFIER_FLAG_DISABLED = (1 << 0),
- /** Modifier's data is expanded (in UI). */
- FMODIFIER_FLAG_EXPANDED = (1 << 1),
- /** 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),
+ /** Modifier is not able to be evaluated for some reason, and should be skipped (internal). */
+ FMODIFIER_FLAG_DISABLED = (1 << 0),
+ /** Modifier's data is expanded (in UI). */
+ FMODIFIER_FLAG_EXPANDED = (1 << 1),
+ /** 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),
} eFModifier_Flags;
/* --- */
/* Generator modifier data */
typedef struct FMod_Generator {
- /* general generator information */
- /** Coefficients array. */
- float *coefficients;
- /** Size of the coefficients array. */
- unsigned int arraysize;
-
- /** Order of polynomial generated (i.e. 1 for linear, 2 for quadratic). */
- int poly_order;
- /** Which 'generator' to use eFMod_Generator_Modes. */
- int mode;
-
- /** Settings. */
- int flag;
+ /* general generator information */
+ /** Coefficients array. */
+ float *coefficients;
+ /** Size of the coefficients array. */
+ unsigned int arraysize;
+
+ /** Order of polynomial generated (i.e. 1 for linear, 2 for quadratic). */
+ int poly_order;
+ /** Which 'generator' to use eFMod_Generator_Modes. */
+ int mode;
+
+ /** Settings. */
+ int flag;
} FMod_Generator;
/* generator modes */
typedef enum eFMod_Generator_Modes {
- FCM_GENERATOR_POLYNOMIAL = 0,
- FCM_GENERATOR_POLYNOMIAL_FACTORISED = 1,
+ FCM_GENERATOR_POLYNOMIAL = 0,
+ FCM_GENERATOR_POLYNOMIAL_FACTORISED = 1,
} eFMod_Generator_Modes;
-
/* generator flags
* - shared by Generator and Function Generator
*/
typedef enum eFMod_Generator_Flags {
- /* generator works in conjunction with other modifiers (i.e. doesn't replace those before it) */
- FCM_GENERATOR_ADDITIVE = (1 << 0),
+ /* generator works in conjunction with other modifiers (i.e. doesn't replace those before it) */
+ FCM_GENERATOR_ADDITIVE = (1 << 0),
} eFMod_Generator_Flags;
-
/**
* 'Built-In Function' Generator modifier data
*
@@ -154,156 +152,150 @@ typedef enum eFMod_Generator_Flags {
* x is the evaluation 'time', and 'y' is the resultant value
*/
typedef struct FMod_FunctionGenerator {
- /** Coefficients for general equation (as above). */
- float amplitude;
- float phase_multiplier;
- float phase_offset;
- float value_offset;
-
- /* flags */
- /** #eFMod_Generator_Functions. */
- int type;
- /** #eFMod_Generator_flags. */
- int flag;
+ /** Coefficients for general equation (as above). */
+ float amplitude;
+ float phase_multiplier;
+ float phase_offset;
+ float value_offset;
+
+ /* flags */
+ /** #eFMod_Generator_Functions. */
+ int type;
+ /** #eFMod_Generator_flags. */
+ int flag;
} FMod_FunctionGenerator;
/* 'function' generator types */
typedef enum eFMod_Generator_Functions {
- 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,
+ 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,
} eFMod_Generator_Functions;
-
/* envelope modifier - envelope data */
typedef struct FCM_EnvelopeData {
- /** Min/max values for envelope at this point (absolute values) . */
- float min, max;
- /** Time for that this sample-point occurs. */
- float time;
-
- /** Settings for 'min' control point. */
- short f1;
- /** Settings for 'max' control point. */
- short f2;
+ /** Min/max values for envelope at this point (absolute values) . */
+ float min, max;
+ /** Time for that this sample-point occurs. */
+ float time;
+
+ /** Settings for 'min' control point. */
+ short f1;
+ /** Settings for 'max' control point. */
+ short f2;
} FCM_EnvelopeData;
/* envelope-like adjustment to values (for fade in/out) */
typedef struct FMod_Envelope {
- /** Data-points defining envelope to apply (array) . */
- FCM_EnvelopeData *data;
- /** Number of envelope points. */
- int totvert;
-
- /** Value that envelope's influence is centered around / based on. */
- float midval;
- /** Distances from 'middle-value' for 1:1 envelope influence. */
- float min, max;
+ /** Data-points defining envelope to apply (array) . */
+ FCM_EnvelopeData *data;
+ /** Number of envelope points. */
+ int totvert;
+
+ /** Value that envelope's influence is centered around / based on. */
+ float midval;
+ /** Distances from 'middle-value' for 1:1 envelope influence. */
+ float min, max;
} FMod_Envelope;
-
/* cycling/repetition modifier data */
// TODO: we can only do complete cycles...
typedef struct FMod_Cycles {
- /** Extrapolation mode to use before first keyframe. */
- short before_mode;
- /** Extrapolation mode to use after last keyframe. */
- short after_mode;
- /** Number of 'cycles' before first keyframe to do. */
- short before_cycles;
- /** Number of 'cycles' after last keyframe to do. */
- short after_cycles;
+ /** Extrapolation mode to use before first keyframe. */
+ short before_mode;
+ /** Extrapolation mode to use after last keyframe. */
+ short after_mode;
+ /** Number of 'cycles' before first keyframe to do. */
+ short before_cycles;
+ /** Number of 'cycles' after last keyframe to do. */
+ short after_cycles;
} FMod_Cycles;
/* cycling modes */
typedef enum eFMod_Cycling_Modes {
- /** 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,
+ /** 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,
} eFMod_Cycling_Modes;
-
/* Python-script modifier data */
typedef struct FMod_Python {
- /** Text buffer containing script to execute. */
- struct Text *script;
- /** ID-properties to provide 'custom' settings. */
- IDProperty *prop;
+ /** Text buffer containing script to execute. */
+ struct Text *script;
+ /** ID-properties to provide 'custom' settings. */
+ IDProperty *prop;
} FMod_Python;
-
/* limits modifier data */
typedef struct FMod_Limits {
- /** Rect defining the min/max values. */
- rctf rect;
- /** Settings for limiting. */
- int flag;
- char _pad[4];
+ /** Rect defining the min/max values. */
+ rctf rect;
+ /** Settings for limiting. */
+ int flag;
+ char _pad[4];
} FMod_Limits;
/* limiting flags */
typedef enum eFMod_Limit_Flags {
- FCM_LIMIT_XMIN = (1 << 0),
- FCM_LIMIT_XMAX = (1 << 1),
- FCM_LIMIT_YMIN = (1 << 2),
- FCM_LIMIT_YMAX = (1 << 3),
+ FCM_LIMIT_XMIN = (1 << 0),
+ FCM_LIMIT_XMAX = (1 << 1),
+ FCM_LIMIT_YMIN = (1 << 2),
+ FCM_LIMIT_YMAX = (1 << 3),
} eFMod_Limit_Flags;
-
/* noise modifier data */
typedef struct FMod_Noise {
- float size;
- float strength;
- float phase;
- float offset;
+ float size;
+ float strength;
+ float phase;
+ float offset;
- short depth;
- short modification;
+ short depth;
+ short modification;
} FMod_Noise;
/* modification modes */
typedef enum eFMod_Noise_Modifications {
- /** Modify existing curve, matching it's 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,
+ /** Modify existing curve, matching it's 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,
} eFMod_Noise_Modifications;
-
/* stepped modifier data */
typedef struct FMod_Stepped {
- /** Number of frames each interpolated value should be held. */
- float step_size;
- /** Reference frame number that stepping starts from. */
- float offset;
-
- /** Start frame of the frame range that modifier works in. */
- float start_frame;
- /** End frame of the frame range that modifier works in. */
- float end_frame;
-
- /** Various settings. */
- int flag;
+ /** Number of frames each interpolated value should be held. */
+ float step_size;
+ /** Reference frame number that stepping starts from. */
+ float offset;
+
+ /** Start frame of the frame range that modifier works in. */
+ float start_frame;
+ /** End frame of the frame range that modifier works in. */
+ float end_frame;
+
+ /** Various settings. */
+ int flag;
} FMod_Stepped;
/* stepped modifier range flags */
typedef enum eFMod_Stepped_Flags {
- /** 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),
+ /** 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),
} eFMod_Stepped_Flags;
/* Drivers -------------------------------------- */
@@ -313,67 +305,66 @@ typedef enum eFMod_Stepped_Flags {
* Defines how to access a dependency needed for a driver variable.
*/
typedef struct DriverTarget {
- /** ID-block which owns the target, no user count. */
- ID *id;
-
- /** RNA path defining the setting to use (for DVAR_TYPE_SINGLE_PROP). */
- char *rna_path;
-
- /**
- * Name of the posebone to use
- * (for vars where DTAR_FLAG_STRUCT_REF is used) - MAX_ID_NAME-2.
- */
- char pchan_name[64];
- /** Transform channel index (for DVAR_TYPE_TRANSFORM_CHAN.)*/
- short transChan;
-
- /**
- * Flags for the validity of the target
- * (NOTE: these get reset every time the types change).
- */
- short flag;
- /** Type of ID-block that this target can use. */
- int idtype;
+ /** ID-block which owns the target, no user count. */
+ ID *id;
+
+ /** RNA path defining the setting to use (for DVAR_TYPE_SINGLE_PROP). */
+ char *rna_path;
+
+ /**
+ * Name of the posebone to use
+ * (for vars where DTAR_FLAG_STRUCT_REF is used) - MAX_ID_NAME-2.
+ */
+ char pchan_name[64];
+ /** Transform channel index (for DVAR_TYPE_TRANSFORM_CHAN.)*/
+ short transChan;
+
+ /**
+ * Flags for the validity of the target
+ * (NOTE: these get reset every time the types change).
+ */
+ short flag;
+ /** Type of ID-block that this target can use. */
+ int idtype;
} DriverTarget;
/** Driver Target flags. */
typedef enum eDriverTarget_Flag {
- /** used for targets that use the pchan_name instead of RNA path
- * (i.e. rotation difference) */
- DTAR_FLAG_STRUCT_REF = (1 << 0),
- /** idtype can only be 'Object' */
- DTAR_FLAG_ID_OB_ONLY = (1 << 1),
-
- /* "localspace" 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),
+ /** used for targets that use the pchan_name instead of RNA path
+ * (i.e. rotation difference) */
+ DTAR_FLAG_STRUCT_REF = (1 << 0),
+ /** idtype can only be 'Object' */
+ DTAR_FLAG_ID_OB_ONLY = (1 << 1),
+
+ /* "localspace" 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),
} eDriverTarget_Flag;
/* Transform Channels for Driver Targets */
typedef enum eDriverTarget_TransformChannels {
- 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,
-
- MAX_DTAR_TRANSCHAN_TYPES,
+ 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,
+
+ MAX_DTAR_TRANSCHAN_TYPES,
} eDriverTarget_TransformChannels;
/* --- */
/* maximum number of driver targets per variable */
-#define MAX_DRIVER_TARGETS 8
-
+#define MAX_DRIVER_TARGETS 8
/**
* Driver Variable (dvar)
@@ -384,81 +375,75 @@ typedef enum eDriverTarget_TransformChannels {
* expressions and also Depsgraph building.
*/
typedef struct DriverVar {
- struct DriverVar *next, *prev;
-
- /**
- * Name of the variable to use in py-expression
- * (must be valid python identifier) - MAX_ID_NAME-2.
- */
- char name[64];
-
- /** MAX_DRIVER_TARGETS, target slots. */
- DriverTarget targets[8];
-
- /** Number of targets actually used by this variable. */
- char num_targets;
- /** Type of driver variable (eDriverVar_Types). */
- char type;
-
- /** Validation tags, etc. (eDriverVar_Flags). */
- short flag;
- /** Result of previous evaluation. */
- float curval;
+ struct DriverVar *next, *prev;
+
+ /**
+ * Name of the variable to use in py-expression
+ * (must be valid python identifier) - MAX_ID_NAME-2.
+ */
+ char name[64];
+
+ /** MAX_DRIVER_TARGETS, target slots. */
+ DriverTarget targets[8];
+
+ /** Number of targets actually used by this variable. */
+ char num_targets;
+ /** Type of driver variable (eDriverVar_Types). */
+ char type;
+
+ /** Validation tags, etc. (eDriverVar_Flags). */
+ short flag;
+ /** Result of previous evaluation. */
+ float curval;
} DriverVar;
/** Driver Variable Types.* */
typedef enum eDriverVar_Types {
- /** 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,
-
- /** Maximum number of variable types.
- *
- * \note This must always be th last item in this list,
- * so add new types above this line.
- */
- MAX_DVAR_TYPES,
+ /** 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,
+
+ /** Maximum number of variable types.
+ *
+ * \note This must always be th last item in this list,
+ * so add new types above this line.
+ */
+ MAX_DVAR_TYPES,
} eDriverVar_Types;
/* Driver Variable Flags */
typedef enum eDriverVar_Flags {
- /* 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),
+ /* 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),
} 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 \
-)
+#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)
/* --- */
@@ -475,62 +460,62 @@ typedef enum eDriverVar_Flags {
* evaluated in. This order is set by the Depsgraph's sorting stuff.
*/
typedef struct ChannelDriver {
- /** Targets for this driver (i.e. list of DriverVar). */
- ListBase variables;
-
- /* 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;
-
- /** Compiled simple arithmetic expression. */
- struct ExprPyLike_Parsed *expr_simple;
-
- /** Result of previous evaluation. */
- float curval;
- // XXX to be implemented... this is like the constraint influence setting
- /** Influence of driver on result. */
- float influence;
-
- /* general settings */
- /** Type of driver. */
- int type;
- /** Settings of driver. */
- int flag;
+ /** Targets for this driver (i.e. list of DriverVar). */
+ ListBase variables;
+
+ /* 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;
+
+ /** Compiled simple arithmetic expression. */
+ struct ExprPyLike_Parsed *expr_simple;
+
+ /** Result of previous evaluation. */
+ float curval;
+ // XXX to be implemented... this is like the constraint influence setting
+ /** Influence of driver on result. */
+ float influence;
+
+ /* general settings */
+ /** Type of driver. */
+ int type;
+ /** Settings of driver. */
+ int flag;
} ChannelDriver;
/** Driver type. */
typedef enum eDriver_Types {
- /** 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,
+ /** 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,
} eDriver_Types;
/** Driver flags. */
typedef enum eDriver_Flags {
- /** 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),
- // DRIVER_FLAG_UNUSED_5 = (1 << 5),
- /** Include 'self' in the drivers namespace. */
- DRIVER_FLAG_USE_SELF = (1 << 6),
+ /** 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),
+ // DRIVER_FLAG_UNUSED_5 = (1 << 5),
+ /** Include 'self' in the drivers namespace. */
+ DRIVER_FLAG_USE_SELF = (1 << 6),
} eDriver_Flags;
/* F-Curves -------------------------------------- */
@@ -542,121 +527,120 @@ typedef enum eDriver_Flags {
* than using BPoints, which contain a lot of other unnecessary data...
*/
typedef struct FPoint {
- /** Time + value. */
- float vec[2];
- /** Selection info. */
- int flag;
- char _pad[4];
+ /** Time + value. */
+ float vec[2];
+ /** Selection info. */
+ int flag;
+ char _pad[4];
} FPoint;
/* 'Function-Curve' - defines values over time for a given setting (fcu) */
typedef struct FCurve {
- struct FCurve *next, *prev;
-
- /* group */
- /** Group that F-Curve belongs to. */
- bActionGroup *grp;
-
- /* driver settings */
- /** Only valid for drivers (i.e. stored in AnimData not Actions). */
- ChannelDriver *driver;
- /* evaluation settings */
- /** FCurve Modifiers. */
- ListBase modifiers;
-
- /* motion data */
- /** User-editable keyframes (array). */
- BezTriple *bezt;
- /** 'baked/imported' motion samples (array). */
- FPoint *fpt;
- /** Total number of points which define the curve (i.e. size of arrays in FPoints). */
- unsigned int totvert;
-
- /* value cache + settings */
- /** Value stored from last time curve was evaluated (not threadsafe, debug display only!). */
- float curval;
- char _pad2[4];
- /** User-editable settings for this curve. */
- short flag;
- /** Value-extending mode for this curve (does not cover). */
- short extend;
- /** Auto-handle smoothing mode. */
- char auto_smoothing;
-
- char _pad[3];
-
- /* RNA - data link */
- /** If applicable, the index of the RNA-array item to get. */
- int array_index;
- /** RNA-path to resolve data-access. */
- char *rna_path;
-
- /* curve coloring (for editor) */
- /** Coloring method to use (eFCurve_Coloring). */
- int color_mode;
- /** The last-color this curve took. */
- float color[3];
-
- float prev_norm_factor, prev_offset;
+ struct FCurve *next, *prev;
+
+ /* group */
+ /** Group that F-Curve belongs to. */
+ bActionGroup *grp;
+
+ /* driver settings */
+ /** Only valid for drivers (i.e. stored in AnimData not Actions). */
+ ChannelDriver *driver;
+ /* evaluation settings */
+ /** FCurve Modifiers. */
+ ListBase modifiers;
+
+ /* motion data */
+ /** User-editable keyframes (array). */
+ BezTriple *bezt;
+ /** 'baked/imported' motion samples (array). */
+ FPoint *fpt;
+ /** Total number of points which define the curve (i.e. size of arrays in FPoints). */
+ unsigned int totvert;
+
+ /* value cache + settings */
+ /** Value stored from last time curve was evaluated (not threadsafe, debug display only!). */
+ float curval;
+ char _pad2[4];
+ /** User-editable settings for this curve. */
+ short flag;
+ /** Value-extending mode for this curve (does not cover). */
+ short extend;
+ /** Auto-handle smoothing mode. */
+ char auto_smoothing;
+
+ char _pad[3];
+
+ /* RNA - data link */
+ /** If applicable, the index of the RNA-array item to get. */
+ int array_index;
+ /** RNA-path to resolve data-access. */
+ char *rna_path;
+
+ /* curve coloring (for editor) */
+ /** Coloring method to use (eFCurve_Coloring). */
+ int color_mode;
+ /** The last-color this curve took. */
+ float color[3];
+
+ float prev_norm_factor, prev_offset;
} FCurve;
-
/* user-editable flags/settings */
typedef enum eFCurve_Flags {
- /** 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),
-
- /** fcurve uses 'auto-handles', which stay horizontal... */
- // DEPRECATED
- FCURVE_AUTO_HANDLES = (1 << 5),
- 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 = (1 << 15),
+ /** 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),
+
+ /** fcurve uses 'auto-handles', which stay horizontal... */
+ // DEPRECATED
+ FCURVE_AUTO_HANDLES = (1 << 5),
+ 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 = (1 << 15),
} eFCurve_Flags;
/* extrapolation modes (only simple value 'extending') */
typedef enum eFCurve_Extend {
- /** just extend min/max keyframe value */
- FCURVE_EXTRAPOLATE_CONSTANT = 0,
- /** just extend gradient of segment between first segment keyframes */
- FCURVE_EXTRAPOLATE_LINEAR,
+ /** just extend min/max keyframe value */
+ FCURVE_EXTRAPOLATE_CONSTANT = 0,
+ /** just extend gradient of segment between first segment keyframes */
+ FCURVE_EXTRAPOLATE_LINEAR,
} eFCurve_Extend;
/* curve coloring modes */
typedef enum eFCurve_Coloring {
- /** automatically determine color using rainbow (calculated at drawtime) */
- 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,
+ /** automatically determine color using rainbow (calculated at drawtime) */
+ 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,
} eFCurve_Coloring;
/* curve smoothing modes */
typedef enum eFCurve_Smoothing {
- /** legacy mode: auto handles only consider adjacent points */
- FCURVE_SMOOTH_NONE = 0,
- /** maintain continuity of the acceleration */
- FCURVE_SMOOTH_CONT_ACCEL = 1,
+ /** legacy mode: auto handles only consider adjacent points */
+ FCURVE_SMOOTH_NONE = 0,
+ /** maintain continuity of the acceleration */
+ FCURVE_SMOOTH_CONT_ACCEL = 1,
} eFCurve_Smoothing;
/* ************************************************ */
@@ -666,7 +650,6 @@ typedef enum eFCurve_Smoothing {
* they are not stored here... see DNA_action_types.h instead
*/
-
/* ************************************************ */
/* NLA - Non-Linear Animation */
@@ -679,128 +662,128 @@ typedef enum eFCurve_Smoothing {
* to control the remapping of the Action data to some destination.
*/
typedef struct NlaStrip {
- struct NlaStrip *next, *prev;
-
- /** 'Child' strips (used for 'meta' strips). */
- ListBase strips;
- /** Action that is referenced by this strip (strip is 'user' of the action). */
- bAction *act;
-
- /** F-Curves for controlling this strip's influence and timing */ // TODO: move o.ut?
- ListBase fcurves;
- /** F-Curve modifiers to be applied to the entire strip's referenced F-Curves. */
- ListBase modifiers;
-
- /** User-Visible Identifier for Strip - MAX_ID_NAME-2. */
- char name[64];
-
- /** Influence of strip. */
- float influence;
- /** Current 'time' within action being used (automatically evaluated, but can be overridden). */
- float strip_time;
-
- /** Extents of the strip. */
- float start, end;
- /** Range of the action to use. */
- float actstart, actend;
-
- /** The number of times to repeat the action range (only when no F-Curves). */
- float repeat;
- /** The amount the action range is scaled by (only when no F-Curves). */
- float scale;
-
- /** Strip blending length (only used when there are no F-Curves). */
- float blendin, blendout;
- /** Strip blending mode (layer-based mixing). */
- short blendmode;
-
- /** Strip extrapolation mode (time-based mixing). */
- short extendmode;
- char _pad1[2];
-
- /** Type of NLA strip. */
- short type;
-
- /** Handle for speaker objects. */
- void *speaker_handle;
-
- /** Settings. */
- int flag;
- char _pad2[4];
+ struct NlaStrip *next, *prev;
+
+ /** 'Child' strips (used for 'meta' strips). */
+ ListBase strips;
+ /** Action that is referenced by this strip (strip is 'user' of the action). */
+ bAction *act;
+
+ /** F-Curves for controlling this strip's influence and timing */ // TODO: move o.ut?
+ ListBase fcurves;
+ /** F-Curve modifiers to be applied to the entire strip's referenced F-Curves. */
+ ListBase modifiers;
+
+ /** User-Visible Identifier for Strip - MAX_ID_NAME-2. */
+ char name[64];
+
+ /** Influence of strip. */
+ float influence;
+ /** Current 'time' within action being used (automatically evaluated, but can be overridden). */
+ float strip_time;
+
+ /** Extents of the strip. */
+ float start, end;
+ /** Range of the action to use. */
+ float actstart, actend;
+
+ /** The number of times to repeat the action range (only when no F-Curves). */
+ float repeat;
+ /** The amount the action range is scaled by (only when no F-Curves). */
+ float scale;
+
+ /** Strip blending length (only used when there are no F-Curves). */
+ float blendin, blendout;
+ /** Strip blending mode (layer-based mixing). */
+ short blendmode;
+
+ /** Strip extrapolation mode (time-based mixing). */
+ short extendmode;
+ char _pad1[2];
+
+ /** Type of NLA strip. */
+ short type;
+
+ /** Handle for speaker objects. */
+ void *speaker_handle;
+
+ /** Settings. */
+ int flag;
+ char _pad2[4];
} NlaStrip;
/* NLA Strip Blending Mode */
typedef enum eNlaStrip_Blend_Mode {
- NLASTRIP_MODE_REPLACE = 0,
- NLASTRIP_MODE_ADD,
- NLASTRIP_MODE_SUBTRACT,
- NLASTRIP_MODE_MULTIPLY,
- NLASTRIP_MODE_COMBINE,
+ NLASTRIP_MODE_REPLACE = 0,
+ NLASTRIP_MODE_ADD,
+ NLASTRIP_MODE_SUBTRACT,
+ NLASTRIP_MODE_MULTIPLY,
+ NLASTRIP_MODE_COMBINE,
} eNlaStrip_Blend_Mode;
/** NLA Strip Extrpolation Mode. */
typedef enum eNlaStrip_Extrapolate_Mode {
- /* 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,
+ /* 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,
} eNlaStrip_Extrapolate_Mode;
/** NLA Strip Settings. */
typedef enum eNlaStrip_Flag {
- /* 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 blendin/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),
-
- /* temporary editing flags */
- /** 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),
+ /* 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 blendin/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),
+
+ /* temporary editing flags */
+ /** 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),
} eNlaStrip_Flag;
/* NLA Strip Type */
typedef enum eNlaStrip_Type {
- /* '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,
+ /* '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,
} eNlaStrip_Type;
/* NLA Tracks ------------------------------------- */
@@ -814,41 +797,40 @@ typedef enum eNlaStrip_Type {
* 'rough' blocks of their work.
*/
typedef struct NlaTrack {
- struct NlaTrack *next, *prev;
+ struct NlaTrack *next, *prev;
- /** BActionStrips in this track. */
- ListBase strips;
+ /** BActionStrips in this track. */
+ ListBase strips;
- /** Settings for this track. */
- int flag;
- /** Index of the track in the stack
- * \note not really useful, but we need a '_pad' var anyways! */
- int index;
+ /** Settings for this track. */
+ int flag;
+ /** Index of the track in the stack
+ * \note not really useful, but we need a '_pad' var anyways! */
+ int index;
- /** Short user-description of this track - MAX_ID_NAME-2. */
- char name[64];
+ /** Short user-description of this track - MAX_ID_NAME-2. */
+ char name[64];
} NlaTrack;
/* settings for track */
typedef enum eNlaTrack_Flag {
- /** 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),
+ /** 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),
} eNlaTrack_Flag;
-
/* ************************************ */
/* KeyingSet Datatypes */
@@ -862,49 +844,49 @@ typedef enum eNlaTrack_Flag {
* replaced with appropriate information from the context).
*/
typedef struct KS_Path {
- struct KS_Path *next, *prev;
-
- /** ID block that keyframes are for. */
- ID *id;
- /** Name of the group to add to - MAX_ID_NAME-2. */
- char group[64];
-
- /** ID-type that path can be used on. */
- int idtype;
-
- /** Group naming (eKSP_Grouping). */
- short groupmode;
- /** Various settings, etc. */
- short flag;
-
- /** Dynamically (or statically in the case of predefined sets) path. */
- char *rna_path;
- /** Index that path affects. */
- int array_index;
-
- /** (eInsertKeyFlags) settings to supply insertkey() with. */
- short keyingflag;
- /** (eInsertKeyFlags) for each flag set, the relevant keyingflag bit overrides the default. */
- short keyingoverride;
+ struct KS_Path *next, *prev;
+
+ /** ID block that keyframes are for. */
+ ID *id;
+ /** Name of the group to add to - MAX_ID_NAME-2. */
+ char group[64];
+
+ /** ID-type that path can be used on. */
+ int idtype;
+
+ /** Group naming (eKSP_Grouping). */
+ short groupmode;
+ /** Various settings, etc. */
+ short flag;
+
+ /** Dynamically (or statically in the case of predefined sets) path. */
+ char *rna_path;
+ /** Index that path affects. */
+ int array_index;
+
+ /** (eInsertKeyFlags) settings to supply insertkey() with. */
+ short keyingflag;
+ /** (eInsertKeyFlags) for each flag set, the relevant keyingflag bit overrides the default. */
+ short keyingoverride;
} KS_Path;
/* KS_Path->flag */
typedef enum eKSP_Settings {
- /* entire array (not just the specified index) gets keyframed */
- KSP_FLAG_WHOLE_ARRAY = (1 << 0),
+ /* entire array (not just the specified index) gets keyframed */
+ KSP_FLAG_WHOLE_ARRAY = (1 << 0),
} eKSP_Settings;
/* KS_Path->groupmode */
typedef enum eKSP_Grouping {
- /** 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,
+ /** 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,
} eKSP_Grouping;
/* ---------------- */
@@ -921,67 +903,67 @@ typedef enum eKSP_Grouping {
* animator without the need to add extra steps to the rigging process.
*/
typedef struct KeyingSet {
- struct KeyingSet *next, *prev;
+ struct KeyingSet *next, *prev;
- /** (KS_Path) paths to keyframe to. */
- ListBase paths;
+ /** (KS_Path) paths to keyframe to. */
+ ListBase paths;
- /** Unique name (for search, etc.) - MAX_ID_NAME-2 . */
- char idname[64];
- /** User-viewable name for KeyingSet (for menus, etc.) - MAX_ID_NAME-2. */
- char name[64];
- /** (RNA_DYN_DESCR_MAX) short help text. */
- char description[240];
- /** Name of the typeinfo data used for the relative paths - MAX_ID_NAME-2. */
- char typeinfo[64];
+ /** Unique name (for search, etc.) - MAX_ID_NAME-2 . */
+ char idname[64];
+ /** User-viewable name for KeyingSet (for menus, etc.) - MAX_ID_NAME-2. */
+ char name[64];
+ /** (RNA_DYN_DESCR_MAX) short help text. */
+ char description[240];
+ /** Name of the typeinfo data used for the relative paths - MAX_ID_NAME-2. */
+ char typeinfo[64];
- /** Index of the active path. */
- int active_path;
+ /** Index of the active path. */
+ int active_path;
- /** Settings for KeyingSet. */
- short flag;
+ /** Settings for KeyingSet. */
+ short flag;
- /** (eInsertKeyFlags) settings to supply insertkey() with. */
- short keyingflag;
- /** (eInsertKeyFlags) for each flag set, the relevant keyingflag bit overrides the default. */
- short keyingoverride;
+ /** (eInsertKeyFlags) settings to supply insertkey() with. */
+ short keyingflag;
+ /** (eInsertKeyFlags) for each flag set, the relevant keyingflag bit overrides the default. */
+ short keyingoverride;
- char _pad[6];
+ char _pad[6];
} KeyingSet;
/* KeyingSet settings */
typedef enum eKS_Settings {
- /** Keyingset cannot be removed (and doesn't need to be freed). */
- KEYINGSET_BUILTIN = (1 << 0),
- /** Keyingset does not depend on context info (i.e. paths are absolute). */
- KEYINGSET_ABSOLUTE = (1 << 1),
+ /** Keyingset cannot be removed (and doesn't need to be freed). */
+ KEYINGSET_BUILTIN = (1 << 0),
+ /** Keyingset does not depend on context info (i.e. paths are absolute). */
+ KEYINGSET_ABSOLUTE = (1 << 1),
} eKS_Settings;
/* Flags for use by keyframe creation/deletion calls */
typedef enum eInsertKeyFlags {
- 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 realloc mem (or increase count, as array has already been set out) */
- INSERTKEY_FASTR = (1 << 3),
- /** only replace an existing keyframe (this overrides INSERTKEY_NEEDED) */
- INSERTKEY_REPLACE = (1 << 4),
- /** transform F-Curves should have XYZ->RGB color mode */
- INSERTKEY_XYZ2RGB = (1 << 5),
- /** ignore user-prefs (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 driver FCurves, use driver's "input" value - for easier corrective driver setup */
- INSERTKEY_DRIVER = (1 << 8),
- /** for cyclic FCurves, adjust key timing to preserve the cycle period and flow */
- INSERTKEY_CYCLE_AWARE = (1 << 9),
+ 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 realloc mem (or increase count, as array has already been set out) */
+ INSERTKEY_FASTR = (1 << 3),
+ /** only replace an existing keyframe (this overrides INSERTKEY_NEEDED) */
+ INSERTKEY_REPLACE = (1 << 4),
+ /** transform F-Curves should have XYZ->RGB color mode */
+ INSERTKEY_XYZ2RGB = (1 << 5),
+ /** ignore user-prefs (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 driver FCurves, use driver's "input" value - for easier corrective driver setup */
+ INSERTKEY_DRIVER = (1 << 8),
+ /** for cyclic FCurves, adjust key timing to preserve the cycle period and flow */
+ INSERTKEY_CYCLE_AWARE = (1 << 9),
} eInsertKeyFlags;
/* ************************************************ */
@@ -1000,15 +982,15 @@ typedef enum eInsertKeyFlags {
* evaluated on frame-change now. That situation may change in future.
*/
typedef struct AnimOverride {
- struct AnimOverride *next, *prev;
+ struct AnimOverride *next, *prev;
- /** RNA-path to use to resolve data-access. */
- char *rna_path;
- /** If applicable, the index of the RNA-array item to get. */
- int array_index;
+ /** RNA-path to use to resolve data-access. */
+ char *rna_path;
+ /** If applicable, the index of the RNA-array item to get. */
+ int array_index;
- /** Value to override setting with. */
- float value;
+ /** Value to override setting with. */
+ float value;
} AnimOverride;
/* AnimData ------------------------------------- */
@@ -1028,80 +1010,80 @@ typedef struct AnimOverride {
* See blenkernel/intern/anim_sys.c for details.
*/
typedef struct AnimData {
- /** active action - acts as the 'tweaking track' for the NLA */
- bAction *action;
- /** temp-storage for the 'real' active action (i.e. the one used before the tweaking-action
- * took over to be edited in the Animation Editors)
- */
- bAction *tmpact;
-
- /* nla-tracks */
- ListBase nla_tracks;
- /**
- * Active NLA-track
- * (only set/used during tweaking, so no need to worry about dangling pointers).
- */
- NlaTrack *act_track;
- /**
- * Active NLA-strip
- * (only set/used during tweaking, so no need to worry about dangling pointers).
- */
- NlaStrip *actstrip;
-
- /* '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). */
- ListBase drivers;
- /** Temp storage (AnimOverride) of values for settings that are animated
- * (but the value hasn't been keyframed). */
- ListBase overrides;
-
- /** Runtime data, for depsgraph evaluation. */
- FCurve **driver_array;
-
- /* settings for animation evaluation */
- /** User-defined settings. */
- int flag;
- char _pad[4];
-
- /* settings for active action evaluation (based on NLA strip settings) */
- /** Accumulation mode for active action. */
- short act_blendmode;
- /** Extrapolation mode for active action. */
- short act_extendmode;
- /** Influence for active action. */
- float act_influence;
+ /** active action - acts as the 'tweaking track' for the NLA */
+ bAction *action;
+ /** temp-storage for the 'real' active action (i.e. the one used before the tweaking-action
+ * took over to be edited in the Animation Editors)
+ */
+ bAction *tmpact;
+
+ /* nla-tracks */
+ ListBase nla_tracks;
+ /**
+ * Active NLA-track
+ * (only set/used during tweaking, so no need to worry about dangling pointers).
+ */
+ NlaTrack *act_track;
+ /**
+ * Active NLA-strip
+ * (only set/used during tweaking, so no need to worry about dangling pointers).
+ */
+ NlaStrip *actstrip;
+
+ /* '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). */
+ ListBase drivers;
+ /** Temp storage (AnimOverride) of values for settings that are animated
+ * (but the value hasn't been keyframed). */
+ ListBase overrides;
+
+ /** Runtime data, for depsgraph evaluation. */
+ FCurve **driver_array;
+
+ /* settings for animation evaluation */
+ /** User-defined settings. */
+ int flag;
+ char _pad[4];
+
+ /* settings for active action evaluation (based on NLA strip settings) */
+ /** Accumulation mode for active action. */
+ short act_blendmode;
+ /** Extrapolation mode for active action. */
+ short act_extendmode;
+ /** Influence for active action. */
+ float act_influence;
} AnimData;
/* Animation Data settings (mostly for NLA) */
typedef enum eAnimData_Flag {
- /** 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),
-
- /** Drivers expanded in UI. */
- ADT_DRIVERS_COLLAPSED = (1 << 10),
- /** Don't execute drivers. */
- ADT_DRIVERS_DISABLED = (1 << 11),
-
- /** 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),
+ /** 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),
+
+ /** Drivers expanded in UI. */
+ ADT_DRIVERS_COLLAPSED = (1 << 10),
+ /** Don't execute drivers. */
+ ADT_DRIVERS_DISABLED = (1 << 11),
+
+ /** 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),
} eAnimData_Flag;
/* Base Struct for Anim ------------------------------------- */
@@ -1112,8 +1094,8 @@ typedef enum eAnimData_Flag {
* should have the same arrangement in their structs.
*/
typedef struct IdAdtTemplate {
- ID id;
- AnimData *adt;
+ ID id;
+ AnimData *adt;
} IdAdtTemplate;
/* ************************************************ */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 3e725d131f2..0b1bd23bd9c 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -39,220 +39,220 @@ struct AnimData;
*/
typedef struct Bone {
- /** Next/prev elements within this list. */
- struct Bone *next, *prev;
- /** User-Defined Properties on this Bone. */
- IDProperty *prop;
- /** Parent (ik parent if appropriate flag is set. */
- struct Bone *parent;
- /** Children . */
- ListBase childbase;
- /** Name of the bone - must be unique within the armature, MAXBONENAME. */
- char name[64];
+ /** Next/prev elements within this list. */
+ struct Bone *next, *prev;
+ /** User-Defined Properties on this Bone. */
+ IDProperty *prop;
+ /** Parent (ik parent if appropriate flag is set. */
+ struct Bone *parent;
+ /** Children . */
+ ListBase childbase;
+ /** Name of the bone - must be unique within the armature, MAXBONENAME. */
+ char name[64];
- /** roll is input for editmode, length calculated. */
- float roll;
- float head[3];
- /** head/tail and roll in Bone Space . */
- float tail[3];
- /** rotation derived from head/tail/roll. */
- float bone_mat[3][3];
+ /** roll is input for editmode, length calculated. */
+ float roll;
+ float head[3];
+ /** head/tail and roll in Bone Space . */
+ float tail[3];
+ /** rotation derived from head/tail/roll. */
+ float bone_mat[3][3];
- int flag;
+ int flag;
- float arm_head[3];
- /** head/tail in Armature Space (rest pos). */
- float arm_tail[3];
- /** matrix: (bonemat(b)+head(b))*arm_mat(b-1), rest po.s*/
- float arm_mat[4][4];
- /** Roll in Armature Space (rest pos). */
- float arm_roll;
+ float arm_head[3];
+ /** head/tail in Armature Space (rest pos). */
+ float arm_tail[3];
+ /** matrix: (bonemat(b)+head(b))*arm_mat(b-1), rest po.s*/
+ float arm_mat[4][4];
+ /** Roll in Armature Space (rest pos). */
+ float arm_roll;
- /** dist, weight: for non-deformgroup deforms. */
- float dist, weight;
- /** width: for block bones. keep in this order, transform!. */
- float xwidth, length, zwidth;
- /** Radius for head/tail sphere, defining deform as well, parent->rad_tip overrides rad_head. */
- float rad_head, rad_tail;
+ /** dist, weight: for non-deformgroup deforms. */
+ float dist, weight;
+ /** width: for block bones. keep in this order, transform!. */
+ float xwidth, length, zwidth;
+ /** Radius for head/tail sphere, defining deform as well, parent->rad_tip overrides rad_head. */
+ float rad_head, rad_tail;
- /** Curved bones settings - these define the "restpose" for a curved bone. */
- float roll1, roll2;
- float curveInX, curveInY;
- float curveOutX, curveOutY;
- /** Length of bezier handles. */
- float ease1, ease2;
- float scaleIn, scaleOut;
+ /** Curved bones settings - these define the "restpose" for a curved bone. */
+ float roll1, roll2;
+ float curveInX, curveInY;
+ float curveOutX, curveOutY;
+ /** Length of bezier handles. */
+ float ease1, ease2;
+ float scaleIn, scaleOut;
- /** patch for upward compat, UNUSED!. */
- float size[3];
- /** Layers that bone appears on. */
- int layer;
- /** for B-bones. */
- short segments;
+ /** patch for upward compat, UNUSED!. */
+ float size[3];
+ /** Layers that bone appears on. */
+ int layer;
+ /** for B-bones. */
+ short segments;
- /** Type of next/prev bone handles. */
- char bbone_prev_type;
- char bbone_next_type;
- /** Next/prev bones to use as handle references when calculating bbones (optional). */
- struct Bone *bbone_prev;
- struct Bone *bbone_next;
+ /** Type of next/prev bone handles. */
+ char bbone_prev_type;
+ char bbone_next_type;
+ /** Next/prev bones to use as handle references when calculating bbones (optional). */
+ struct Bone *bbone_prev;
+ struct Bone *bbone_next;
} Bone;
typedef struct bArmature {
- ID id;
- struct AnimData *adt;
+ ID id;
+ struct AnimData *adt;
- ListBase bonebase;
- ListBase chainbase;
- /** Editbone listbase, we use pointer so we can check state. */
- ListBase *edbo;
+ ListBase bonebase;
+ ListBase chainbase;
+ /** Editbone listbase, we use pointer so we can check state. */
+ ListBase *edbo;
- /* 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 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;
- /** Active editbone (in editmode). */
- struct EditBone *act_edbone;
+ /** Active bone. */
+ Bone *act_bone;
+ /** Active editbone (in editmode). */
+ struct EditBone *act_edbone;
- int flag;
- int drawtype;
- /** How vertex deformation is handled in the ge. */
- int gevertdeformer;
- char _pad[4];
- short deformflag;
- short pathflag;
+ int flag;
+ int drawtype;
+ /** How vertex deformation is handled in the ge. */
+ int gevertdeformer;
+ char _pad[4];
+ short deformflag;
+ short pathflag;
- /** For UI, to show which layers are there. */
- unsigned int layer_used;
- /** For buttons to work, both variables in this order together. */
- unsigned int layer, layer_protected;
+ /** For UI, to show which layers are there. */
+ unsigned int layer_used;
+ /** For buttons to work, both variables in this order together. */
+ unsigned int layer, layer_protected;
} bArmature;
/* armature->flag */
/* don't use bit 7, was saved in files to disable stuff */
typedef enum eArmature_Flag {
- 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),
- ARM_FLAG_UNUSED_5 = (1 << 5), /* cleared */
- ARM_DELAYDEFORM = (1 << 6),
- ARM_FLAG_UNUSED_7 = (1 << 7), /* cleared */
- ARM_MIRROR_EDIT = (1 << 8),
- ARM_AUTO_IK = (1 << 9),
- /** made option negative, for backwards compat */
- 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 */
- /** dopesheet 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),
+ 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),
+ ARM_FLAG_UNUSED_5 = (1 << 5), /* cleared */
+ ARM_DELAYDEFORM = (1 << 6),
+ ARM_FLAG_UNUSED_7 = (1 << 7), /* cleared */
+ ARM_MIRROR_EDIT = (1 << 8),
+ ARM_AUTO_IK = (1 << 9),
+ /** made option negative, for backwards compat */
+ 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 */
+ /** dopesheet 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),
} eArmature_Flag;
/* armature->drawtype */
typedef enum eArmature_Drawtype {
- ARM_OCTA = 0,
- ARM_LINE = 1,
- ARM_B_BONE = 2,
- ARM_ENVELOPE = 3,
- ARM_WIRE = 4,
+ ARM_OCTA = 0,
+ ARM_LINE = 1,
+ ARM_B_BONE = 2,
+ ARM_ENVELOPE = 3,
+ ARM_WIRE = 4,
} eArmature_Drawtype;
/* armature->gevertdeformer */
typedef enum eArmature_VertDeformer {
- ARM_VDEF_BLENDER = 0,
- ARM_VDEF_BGE_CPU = 1,
+ ARM_VDEF_BLENDER = 0,
+ ARM_VDEF_BGE_CPU = 1,
} eArmature_VertDeformer;
/* armature->deformflag */
typedef enum eArmature_DeformFlag {
- ARM_DEF_VGROUP = (1 << 0),
- ARM_DEF_ENVELOPE = (1 << 1),
- ARM_DEF_QUATERNION = (1 << 2),
+ ARM_DEF_VGROUP = (1 << 0),
+ ARM_DEF_ENVELOPE = (1 << 1),
+ ARM_DEF_QUATERNION = (1 << 2),
#ifdef DNA_DEPRECATED
- ARM_DEF_B_BONE_REST = (1 << 3), /* deprecated */
+ ARM_DEF_B_BONE_REST = (1 << 3), /* deprecated */
#endif
- ARM_DEF_INVERT_VGROUP = (1 << 4),
+ ARM_DEF_INVERT_VGROUP = (1 << 4),
} eArmature_DeformFlag;
/* armature->pathflag */
// XXX deprecated... old animation system (armature only viz)
#ifdef DNA_DEPRECATED
typedef enum eArmature_PathFlag {
- 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),
+ 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),
} eArmature_PathFlag;
#endif
/* bone->flag */
typedef enum eBone_Flag {
- 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 */
- 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 Editmode */
- 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),
- /** 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),
- /** hidden bone when drawing PoseChannels (for ghost drawing) */
- BONE_HIDDEN_PG = (1 << 16),
- /** 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),
- /** Indicates that a parent is also being transformed */
- BONE_TRANSFORM_CHILD = (1 << 20),
- /** 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),
- /** it will add the parent end roll to the inroll */
- BONE_ADD_PARENT_END_ROLL = (1 << 24),
+ 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 */
+ 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 Editmode */
+ 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),
+ /** 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),
+ /** hidden bone when drawing PoseChannels (for ghost drawing) */
+ BONE_HIDDEN_PG = (1 << 16),
+ /** 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),
+ /** Indicates that a parent is also being transformed */
+ BONE_TRANSFORM_CHILD = (1 << 20),
+ /** 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),
+ /** it will add the parent end roll to the inroll */
+ BONE_ADD_PARENT_END_ROLL = (1 << 24),
} eBone_Flag;
/* bone->bbone_prev_type, bbone_next_type */
typedef enum eBone_BBoneHandleType {
- BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
- BBONE_HANDLE_ABSOLUTE, /* Custom handle in absolute position mode. */
- BBONE_HANDLE_RELATIVE, /* Custom handle in relative position mode. */
- BBONE_HANDLE_TANGENT, /* Custom handle in tangent mode (use direction, not location). */
+ BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
+ BBONE_HANDLE_ABSOLUTE, /* Custom handle in absolute position mode. */
+ BBONE_HANDLE_RELATIVE, /* Custom handle in relative position mode. */
+ BBONE_HANDLE_TANGENT, /* Custom handle in tangent mode (use direction, not location). */
} eBone_BBoneHandleType;
#define MAXBONENAME 64
diff --git a/source/blender/makesdna/DNA_boid_types.h b/source/blender/makesdna/DNA_boid_types.h
index b9ea97ca27f..de1dac21ea0 100644
--- a/source/blender/makesdna/DNA_boid_types.h
+++ b/source/blender/makesdna/DNA_boid_types.h
@@ -27,198 +27,197 @@
#include "DNA_listBase.h"
typedef enum eBoidRuleType {
- 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,
- /** manoeuver 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,
+ 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,
+ /** manoeuver 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,
#if 0
- /** go to enemy closest to target and attack when in range */
- eBoidRuleType_Protect = 9,
- /** find a deflector move to it's other side from closest enemy */
- eBoidRuleType_Hide = 10,
- /** move along a assigned curve or closest curve in a group */
- eBoidRuleType_FollowPath = 11,
- /** move next to a deflector object's in direction of it's tangent */
- eBoidRuleType_FollowWall = 12,
+ /** go to enemy closest to target and attack when in range */
+ eBoidRuleType_Protect = 9,
+ /** find a deflector move to it's other side from closest enemy */
+ eBoidRuleType_Hide = 10,
+ /** move along a assigned curve or closest curve in a group */
+ eBoidRuleType_FollowPath = 11,
+ /** move next to a deflector object's in direction of it's tangent */
+ eBoidRuleType_FollowWall = 12,
#endif
- NUM_BOID_RULE_TYPES,
+ NUM_BOID_RULE_TYPES,
} eBoidRuleType;
/* boidrule->flag */
-#define BOIDRULE_CURRENT (1 << 0)
-#define BOIDRULE_IN_AIR (1 << 2)
-#define BOIDRULE_ON_LAND (1 << 3)
+#define BOIDRULE_CURRENT (1 << 0)
+#define BOIDRULE_IN_AIR (1 << 2)
+#define BOIDRULE_ON_LAND (1 << 3)
typedef struct BoidRule {
- struct BoidRule *next, *prev;
- int type, flag;
- char name[32];
+ struct BoidRule *next, *prev;
+ int type, flag;
+ char name[32];
} BoidRule;
-#define BRULE_GOAL_AVOID_PREDICT (1 << 0)
-#define BRULE_GOAL_AVOID_ARRIVE (1 << 1)
-#define BRULE_GOAL_AVOID_SIGNAL (1 << 2)
+#define BRULE_GOAL_AVOID_PREDICT (1 << 0)
+#define BRULE_GOAL_AVOID_ARRIVE (1 << 1)
+#define BRULE_GOAL_AVOID_SIGNAL (1 << 2)
typedef struct BoidRuleGoalAvoid {
- BoidRule rule;
- struct Object *ob;
- int options;
- float fear_factor;
+ BoidRule rule;
+ struct Object *ob;
+ int options;
+ float fear_factor;
- /* signals */
- int signal_id, channels;
+ /* signals */
+ int signal_id, channels;
} BoidRuleGoalAvoid;
-#define BRULE_ACOLL_WITH_BOIDS (1 << 0)
+#define BRULE_ACOLL_WITH_BOIDS (1 << 0)
#define BRULE_ACOLL_WITH_DEFLECTORS (1 << 1)
typedef struct BoidRuleAvoidCollision {
- BoidRule rule;
- int options;
- float look_ahead;
+ BoidRule rule;
+ int options;
+ float look_ahead;
} BoidRuleAvoidCollision;
-#define BRULE_LEADER_IN_LINE (1 << 0)
+#define BRULE_LEADER_IN_LINE (1 << 0)
typedef struct BoidRuleFollowLeader {
- BoidRule rule;
- struct Object *ob;
- float loc[3], oloc[3];
- float cfra, distance;
- int options, queue_size;
+ BoidRule rule;
+ struct Object *ob;
+ float loc[3], oloc[3];
+ float cfra, distance;
+ int options, queue_size;
} BoidRuleFollowLeader;
typedef struct BoidRuleAverageSpeed {
- BoidRule rule;
- float wander, level, speed, rt;
+ BoidRule rule;
+ float wander, level, speed, rt;
} BoidRuleAverageSpeed;
typedef struct BoidRuleFight {
- BoidRule rule;
- float distance, flee_distance;
+ BoidRule rule;
+ float distance, flee_distance;
} BoidRuleFight;
typedef enum eBoidMode {
- eBoidMode_InAir = 0,
- eBoidMode_OnLand = 1,
- eBoidMode_Climbing = 2,
- eBoidMode_Falling = 3,
- eBoidMode_Liftoff = 4,
- NUM_BOID_MODES,
+ eBoidMode_InAir = 0,
+ eBoidMode_OnLand = 1,
+ eBoidMode_Climbing = 2,
+ eBoidMode_Falling = 3,
+ eBoidMode_Liftoff = 4,
+ NUM_BOID_MODES,
} eBoidMode;
-
typedef struct BoidData {
- float health, acc[3];
- short state_id, mode;
+ float health, acc[3];
+ short state_id, mode;
} BoidData;
// planned for near future
//typedef enum BoidConditionMode {
-// eBoidConditionType_Then = 0,
-// eBoidConditionType_And = 1,
-// eBoidConditionType_Or = 2,
-// NUM_BOID_CONDITION_MODES
+// eBoidConditionType_Then = 0,
+// eBoidConditionType_And = 1,
+// eBoidConditionType_Or = 2,
+// NUM_BOID_CONDITION_MODES
//} BoidConditionMode;
//typedef enum BoidConditionType {
-// eBoidConditionType_None = 0,
-// eBoidConditionType_Signal = 1,
-// eBoidConditionType_NoSignal = 2,
-// eBoidConditionType_HealthBelow = 3,
-// eBoidConditionType_HealthAbove = 4,
-// eBoidConditionType_See = 5,
-// eBoidConditionType_NotSee = 6,
-// eBoidConditionType_StateTime = 7,
-// eBoidConditionType_Touching = 8,
-// NUM_BOID_CONDITION_TYPES
+// eBoidConditionType_None = 0,
+// eBoidConditionType_Signal = 1,
+// eBoidConditionType_NoSignal = 2,
+// eBoidConditionType_HealthBelow = 3,
+// eBoidConditionType_HealthAbove = 4,
+// eBoidConditionType_See = 5,
+// eBoidConditionType_NotSee = 6,
+// eBoidConditionType_StateTime = 7,
+// eBoidConditionType_Touching = 8,
+// NUM_BOID_CONDITION_TYPES
//} BoidConditionType;
//typedef struct BoidCondition {
-// struct BoidCondition *next, *prev;
-// int state_id;
-// short type, mode;
-// float threshold, probability;
+// struct BoidCondition *next, *prev;
+// int state_id;
+// short type, mode;
+// float threshold, probability;
//
-// /* signals */
-// int signal_id, channels;
+// /* signals */
+// int signal_id, channels;
//} BoidCondition;
typedef enum eBoidRulesetType {
- eBoidRulesetType_Fuzzy = 0,
- eBoidRulesetType_Random = 1,
- eBoidRulesetType_Average = 2,
- NUM_BOID_RULESET_TYPES,
+ eBoidRulesetType_Fuzzy = 0,
+ eBoidRulesetType_Random = 1,
+ eBoidRulesetType_Average = 2,
+ NUM_BOID_RULESET_TYPES,
} eBoidRulesetType;
-#define BOIDSTATE_CURRENT 1
+#define BOIDSTATE_CURRENT 1
typedef struct BoidState {
- struct BoidState *next, *prev;
- ListBase rules;
- ListBase conditions;
- ListBase actions;
- char name[32];
- int id, flag;
-
- /* rules */
- int ruleset_type;
- float rule_fuzziness;
-
- /* signal */
- int signal_id, channels;
- float volume, falloff;
+ struct BoidState *next, *prev;
+ ListBase rules;
+ ListBase conditions;
+ ListBase actions;
+ char name[32];
+ int id, flag;
+
+ /* rules */
+ int ruleset_type;
+ float rule_fuzziness;
+
+ /* signal */
+ int signal_id, channels;
+ float volume, falloff;
} BoidState;
// planned for near future
//typedef struct BoidSignal {
-// struct BoidSignal *next, *prev;
-// float loc[3];
-// float volume, falloff;
-// int id;
+// struct BoidSignal *next, *prev;
+// float loc[3];
+// float volume, falloff;
+// int id;
//} BoidSignal;
//typedef struct BoidSignalDefine {
-// struct BoidSignalDefine *next, *prev;
-// int id, rt;
-// char name[32];
+// struct BoidSignalDefine *next, *prev;
+// int id, rt;
+// char name[32];
//} BoidSignalDefine;
//typedef struct BoidSimulationData {
-// ListBase signal_defines;/* list of defined signals */
-// ListBase signals[20]; /* gathers signals from all channels */
-// struct KDTree_3d *signaltrees[20];
-// char channel_names[20][32];
-// int last_signal_id; /* used for incrementing signal ids */
-// int flag; /* switches for drawing stuff */
+// ListBase signal_defines;/* list of defined signals */
+// ListBase signals[20]; /* gathers signals from all channels */
+// struct KDTree_3d *signaltrees[20];
+// char channel_names[20][32];
+// int last_signal_id; /* used for incrementing signal ids */
+// int flag; /* switches for drawing stuff */
//} BoidSimulationData;
typedef struct BoidSettings {
- int options, last_state_id;
+ int options, last_state_id;
- float landing_smoothness, height;
- float banking, pitch;
+ float landing_smoothness, height;
+ float banking, pitch;
- float health, aggression;
- float strength, accuracy, range;
+ float health, aggression;
+ float strength, accuracy, range;
- /* flying related */
- float air_min_speed, air_max_speed;
- float air_max_acc, air_max_ave;
- float air_personal_space;
+ /* flying related */
+ float air_min_speed, air_max_speed;
+ float air_max_acc, air_max_ave;
+ float air_personal_space;
- /* walk/run related */
- float land_jump_speed, land_max_speed;
- float land_max_acc, land_max_ave;
- float land_personal_space;
- float land_stick_force;
+ /* walk/run related */
+ float land_jump_speed, land_max_speed;
+ float land_max_acc, land_max_ave;
+ float land_personal_space;
+ float land_stick_force;
- struct ListBase states;
+ struct ListBase states;
} BoidSettings;
/* boidsettings->options */
-#define BOID_ALLOW_FLIGHT (1 << 0)
-#define BOID_ALLOW_LAND (1 << 1)
-#define BOID_ALLOW_CLIMB (1 << 2)
+#define BOID_ALLOW_FLIGHT (1 << 0)
+#define BOID_ALLOW_LAND (1 << 1)
+#define BOID_ALLOW_CLIMB (1 << 2)
/* boidrule->options */
//#define BOID_RULE_FOLLOW_LINE (1 << 0) /* follow leader */
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 63203b70f42..a261ebacc14 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -24,13 +24,12 @@
#ifndef __DNA_BRUSH_TYPES_H__
#define __DNA_BRUSH_TYPES_H__
-
#include "DNA_ID.h"
#include "DNA_texture_types.h" /* for MTex */
#include "DNA_curve_types.h"
//#ifndef MAX_MTEX // XXX Not used?
-//#define MAX_MTEX 18
+//#define MAX_MTEX 18
//#endif
struct CurveMapping;
@@ -39,508 +38,499 @@ struct MTex;
struct Material;
typedef struct BrushClone {
- /** Image for clone tool. */
- struct Image *image;
- /** Offset of clone image from canvas. */
- float offset[2];
- /** Transparency for drawing of clone image. */
- float alpha;
- char _pad[4];
+ /** Image for clone tool. */
+ struct Image *image;
+ /** Offset of clone image from canvas. */
+ float offset[2];
+ /** Transparency for drawing of clone image. */
+ float alpha;
+ char _pad[4];
} BrushClone;
-
typedef struct BrushGpencilSettings {
- /** Amount of smoothing to apply to newly created strokes. */
- float draw_smoothfac;
- /** Amount of sensitivity to apply to newly created strokes. */
- float draw_sensitivity;
- /** Amount of alpha strength to apply to newly created strokes. */
- float draw_strength;
- /** Amount of jitter to apply to newly created strokes. */
- float draw_jitter;
- /** Angle when the brush has full thickness. */
- float draw_angle;
- /** Factor to apply when angle change (only 90 degrees). */
- float draw_angle_factor;
- /** Factor of randomness for pressure. */
- float draw_random_press;
- /** Factor of strength for strength. */
- float draw_random_strength;
- /** Factor of randomness for subdivision. */
- float draw_random_sub;
- /** Number of times to apply smooth factor to new strokes. */
- short draw_smoothlvl;
- /** Number of times to subdivide new strokes. */
- short draw_subdivide;
- short _pad;
-
- /** Number of times to apply thickness smooth factor to new strokes. */
- short thick_smoothlvl;
- /** Amount of thickness smoothing to apply to newly created strokes. */
- float thick_smoothfac;
-
- /** Factor for transparency. */
- float fill_threshold;
- /** Number of pixel to consider the leak is too small (x 2). */
- short fill_leak;
- /** Fill zoom factor */
- short fill_factor;
- char _pad_1[4];
-
- /** Number of simplify steps. */
- int fill_simplylvl;
- /** Type of control lines drawing mode. */
- int fill_draw_mode;
- /** Icon identifier. */
- int icon_id;
-
- /** Maximum distance before generate new point for very fast mouse movements. */
- int input_samples;
- /** Random factor for UV rotation. */
- float uv_random;
- /** Moved to 'Brush.gpencil_tool'. */
- int brush_type DNA_DEPRECATED;
- /** Soft, hard or stroke. */
- int eraser_mode;
- /** Smooth while drawing factor. */
- float active_smooth;
- /** Factor to apply to strength for soft eraser. */
- float era_strength_f;
- /** Factor to apply to thickness for soft eraser. */
- float era_thickness_f;
- /** Internal grease pencil drawing flags. */
- int flag;
-
- /** gradient control along y for color */
- float gradient_f;
- /** factor xy of shape for dots gradients */
- float gradient_s[2];
- char _pad_2[4];
-
- struct CurveMapping *curve_sensitivity;
- struct CurveMapping *curve_strength;
- struct CurveMapping *curve_jitter;
-
- /* optional link of material to replace default in context */
- /** Material. */
- struct Material *material;
+ /** Amount of smoothing to apply to newly created strokes. */
+ float draw_smoothfac;
+ /** Amount of sensitivity to apply to newly created strokes. */
+ float draw_sensitivity;
+ /** Amount of alpha strength to apply to newly created strokes. */
+ float draw_strength;
+ /** Amount of jitter to apply to newly created strokes. */
+ float draw_jitter;
+ /** Angle when the brush has full thickness. */
+ float draw_angle;
+ /** Factor to apply when angle change (only 90 degrees). */
+ float draw_angle_factor;
+ /** Factor of randomness for pressure. */
+ float draw_random_press;
+ /** Factor of strength for strength. */
+ float draw_random_strength;
+ /** Factor of randomness for subdivision. */
+ float draw_random_sub;
+ /** Number of times to apply smooth factor to new strokes. */
+ short draw_smoothlvl;
+ /** Number of times to subdivide new strokes. */
+ short draw_subdivide;
+ short _pad;
+
+ /** Number of times to apply thickness smooth factor to new strokes. */
+ short thick_smoothlvl;
+ /** Amount of thickness smoothing to apply to newly created strokes. */
+ float thick_smoothfac;
+
+ /** Factor for transparency. */
+ float fill_threshold;
+ /** Number of pixel to consider the leak is too small (x 2). */
+ short fill_leak;
+ /** Fill zoom factor */
+ short fill_factor;
+ char _pad_1[4];
+
+ /** Number of simplify steps. */
+ int fill_simplylvl;
+ /** Type of control lines drawing mode. */
+ int fill_draw_mode;
+ /** Icon identifier. */
+ int icon_id;
+
+ /** Maximum distance before generate new point for very fast mouse movements. */
+ int input_samples;
+ /** Random factor for UV rotation. */
+ float uv_random;
+ /** Moved to 'Brush.gpencil_tool'. */
+ int brush_type DNA_DEPRECATED;
+ /** Soft, hard or stroke. */
+ int eraser_mode;
+ /** Smooth while drawing factor. */
+ float active_smooth;
+ /** Factor to apply to strength for soft eraser. */
+ float era_strength_f;
+ /** Factor to apply to thickness for soft eraser. */
+ float era_thickness_f;
+ /** Internal grease pencil drawing flags. */
+ int flag;
+
+ /** gradient control along y for color */
+ float gradient_f;
+ /** factor xy of shape for dots gradients */
+ float gradient_s[2];
+ char _pad_2[4];
+
+ struct CurveMapping *curve_sensitivity;
+ struct CurveMapping *curve_strength;
+ struct CurveMapping *curve_jitter;
+
+ /* optional link of material to replace default in context */
+ /** Material. */
+ struct Material *material;
} BrushGpencilSettings;
/* BrushGpencilSettings->gp_flag */
typedef enum eGPDbrush_Flag {
- /* brush use pressure */
- GP_BRUSH_USE_PRESSURE = (1 << 0),
- /* brush use pressure for alpha factor */
- GP_BRUSH_USE_STENGTH_PRESSURE = (1 << 1),
- /* brush use pressure for alpha factor */
- GP_BRUSH_USE_JITTER_PRESSURE = (1 << 2),
- /* enable screen cursor */
- GP_BRUSH_ENABLE_CURSOR = (1 << 5),
- /* 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),
- /* default eraser brush for quick switch */
- GP_BRUSH_DEFAULT_ERASER = (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 oLcluded */
- GP_BRUSH_OCCLUDE_ERASER = (1 << 15),
- /* Post process trim stroke */
- GP_BRUSH_TRIM_STROKE = (1 << 16),
+ /* brush use pressure */
+ GP_BRUSH_USE_PRESSURE = (1 << 0),
+ /* brush use pressure for alpha factor */
+ GP_BRUSH_USE_STENGTH_PRESSURE = (1 << 1),
+ /* brush use pressure for alpha factor */
+ GP_BRUSH_USE_JITTER_PRESSURE = (1 << 2),
+ /* enable screen cursor */
+ GP_BRUSH_ENABLE_CURSOR = (1 << 5),
+ /* 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),
+ /* default eraser brush for quick switch */
+ GP_BRUSH_DEFAULT_ERASER = (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 oLcluded */
+ GP_BRUSH_OCCLUDE_ERASER = (1 << 15),
+ /* Post process trim stroke */
+ GP_BRUSH_TRIM_STROKE = (1 << 16),
} eGPDbrush_Flag;
/* BrushGpencilSettings->gp_fill_draw_mode */
typedef enum eGP_FillDrawModes {
- GP_FILL_DMODE_BOTH = 0,
- GP_FILL_DMODE_STROKE = 1,
- GP_FILL_DMODE_CONTROL = 2,
+ GP_FILL_DMODE_BOTH = 0,
+ GP_FILL_DMODE_STROKE = 1,
+ GP_FILL_DMODE_CONTROL = 2,
} eGP_FillDrawModes;
/* BrushGpencilSettings->gp_eraser_mode */
typedef enum eGP_BrushEraserMode {
- GP_BRUSH_ERASER_SOFT = 0,
- GP_BRUSH_ERASER_HARD = 1,
- GP_BRUSH_ERASER_STROKE = 2,
+ GP_BRUSH_ERASER_SOFT = 0,
+ GP_BRUSH_ERASER_HARD = 1,
+ GP_BRUSH_ERASER_STROKE = 2,
} eGP_BrushEraserMode;
/* BrushGpencilSettings default brush icons */
typedef enum eGP_BrushIcons {
- GP_BRUSH_ICON_PENCIL = 1,
- GP_BRUSH_ICON_PEN = 2,
- GP_BRUSH_ICON_INK = 3,
- GP_BRUSH_ICON_INKNOISE = 4,
- GP_BRUSH_ICON_BLOCK = 5,
- GP_BRUSH_ICON_MARKER = 6,
- GP_BRUSH_ICON_FILL = 7,
- GP_BRUSH_ICON_ERASE_SOFT = 8,
- GP_BRUSH_ICON_ERASE_HARD = 9,
- GP_BRUSH_ICON_ERASE_STROKE = 10,
+ GP_BRUSH_ICON_PENCIL = 1,
+ GP_BRUSH_ICON_PEN = 2,
+ GP_BRUSH_ICON_INK = 3,
+ GP_BRUSH_ICON_INKNOISE = 4,
+ GP_BRUSH_ICON_BLOCK = 5,
+ GP_BRUSH_ICON_MARKER = 6,
+ GP_BRUSH_ICON_FILL = 7,
+ GP_BRUSH_ICON_ERASE_SOFT = 8,
+ GP_BRUSH_ICON_ERASE_HARD = 9,
+ GP_BRUSH_ICON_ERASE_STROKE = 10,
} eGP_BrushIcons;
typedef struct Brush {
- ID id;
-
- struct BrushClone clone;
- /** Falloff curve. */
- struct CurveMapping *curve;
- struct MTex mtex;
- struct MTex mask_mtex;
-
- struct Brush *toggle_brush;
-
- struct ImBuf *icon_imbuf;
- PreviewImage *preview;
- /** Color gradient. */
- struct ColorBand *gradient;
- struct PaintCurve *paint_curve;
-
- /** 1024 = FILE_MAX. */
- char icon_filepath[1024];
-
- float normal_weight;
- /** Rake actual data (not texture), used for sculpt. */
- float rake_factor;
-
- /** Blend mode. */
- short blend;
- /** #eObjectMode: to see if the brush is compatible, use for display only. */
- short ob_mode;
- /** Brush weight. */
- float weight;
- /** Brush diameter. */
- int size;
- /** General purpose flag. */
- int flag;
- /** Pressure influence for mask. */
- int mask_pressure;
- /** Jitter the position of the brush. */
- float jitter;
- /** Absolute jitter in pixels. */
- int jitter_absolute;
- int overlay_flags;
- /** Spacing of paint operations. */
- int spacing;
- /** Turning radius (in pixels) for smooth stroke. */
- int smooth_stroke_radius;
- /** Higher values limit fast changes in the stroke direction. */
- float smooth_stroke_factor;
- /** Paint operations / second (airbrush). */
- float rate;
-
- /** Color. */
- float rgb[3];
- /** Opacity. */
- float alpha;
-
- /** Background color. */
- float secondary_rgb[3];
-
- /** The direction of movement for sculpt vertices. */
- int sculpt_plane;
-
- /** Offset for plane brushes (clay, flatten, fill, scrape). */
- float plane_offset;
-
- int gradient_spacing;
- /** Source for stroke color gradient application. */
- char gradient_stroke_mode;
- /** Source for fill tool color gradient application. */
- char gradient_fill_mode;
-
- char _pad;
- /** Projection shape (sphere, circle). */
- char falloff_shape;
- float falloff_angle;
-
- /** Active sculpt tool. */
- char sculpt_tool;
- /** Active vertex paint. */
- char vertexpaint_tool;
- /** Active weight paint. */
- char weightpaint_tool;
- /** Active image paint tool. */
- char imagepaint_tool;
- /** Enum eBrushMaskTool, only used if sculpt_tool is SCULPT_TOOL_MASK. */
- char mask_tool;
- /** Active grease pencil tool. */
- char gpencil_tool;
- char _pad0[2];
-
- float autosmooth_factor;
-
- float topology_rake_factor;
-
- float crease_pinch_factor;
-
- float plane_trim;
- /** Affectable height of brush (layer height for layer tool, i.e.). */
- float height;
-
- float texture_sample_bias;
-
- /* overlay */
- int texture_overlay_alpha;
- int mask_overlay_alpha;
- int cursor_overlay_alpha;
-
- float unprojected_radius;
-
- /* soften/sharpen */
- float sharp_threshold;
- int blur_kernel_radius;
- int blur_mode;
-
- /* fill tool */
- float fill_threshold;
-
- float add_col[3];
- float sub_col[3];
-
- float stencil_pos[2];
- float stencil_dimension[2];
-
- float mask_stencil_pos[2];
- float mask_stencil_dimension[2];
-
- struct BrushGpencilSettings *gpencil_settings;
+ ID id;
+
+ struct BrushClone clone;
+ /** Falloff curve. */
+ struct CurveMapping *curve;
+ struct MTex mtex;
+ struct MTex mask_mtex;
+
+ struct Brush *toggle_brush;
+
+ struct ImBuf *icon_imbuf;
+ PreviewImage *preview;
+ /** Color gradient. */
+ struct ColorBand *gradient;
+ struct PaintCurve *paint_curve;
+
+ /** 1024 = FILE_MAX. */
+ char icon_filepath[1024];
+
+ float normal_weight;
+ /** Rake actual data (not texture), used for sculpt. */
+ float rake_factor;
+
+ /** Blend mode. */
+ short blend;
+ /** #eObjectMode: to see if the brush is compatible, use for display only. */
+ short ob_mode;
+ /** Brush weight. */
+ float weight;
+ /** Brush diameter. */
+ int size;
+ /** General purpose flag. */
+ int flag;
+ /** Pressure influence for mask. */
+ int mask_pressure;
+ /** Jitter the position of the brush. */
+ float jitter;
+ /** Absolute jitter in pixels. */
+ int jitter_absolute;
+ int overlay_flags;
+ /** Spacing of paint operations. */
+ int spacing;
+ /** Turning radius (in pixels) for smooth stroke. */
+ int smooth_stroke_radius;
+ /** Higher values limit fast changes in the stroke direction. */
+ float smooth_stroke_factor;
+ /** Paint operations / second (airbrush). */
+ float rate;
+
+ /** Color. */
+ float rgb[3];
+ /** Opacity. */
+ float alpha;
+
+ /** Background color. */
+ float secondary_rgb[3];
+
+ /** The direction of movement for sculpt vertices. */
+ int sculpt_plane;
+
+ /** Offset for plane brushes (clay, flatten, fill, scrape). */
+ float plane_offset;
+
+ int gradient_spacing;
+ /** Source for stroke color gradient application. */
+ char gradient_stroke_mode;
+ /** Source for fill tool color gradient application. */
+ char gradient_fill_mode;
+
+ char _pad;
+ /** Projection shape (sphere, circle). */
+ char falloff_shape;
+ float falloff_angle;
+
+ /** Active sculpt tool. */
+ char sculpt_tool;
+ /** Active vertex paint. */
+ char vertexpaint_tool;
+ /** Active weight paint. */
+ char weightpaint_tool;
+ /** Active image paint tool. */
+ char imagepaint_tool;
+ /** Enum eBrushMaskTool, only used if sculpt_tool is SCULPT_TOOL_MASK. */
+ char mask_tool;
+ /** Active grease pencil tool. */
+ char gpencil_tool;
+ char _pad0[2];
+
+ float autosmooth_factor;
+
+ float topology_rake_factor;
+
+ float crease_pinch_factor;
+
+ float plane_trim;
+ /** Affectable height of brush (layer height for layer tool, i.e.). */
+ float height;
+
+ float texture_sample_bias;
+
+ /* overlay */
+ int texture_overlay_alpha;
+ int mask_overlay_alpha;
+ int cursor_overlay_alpha;
+
+ float unprojected_radius;
+
+ /* soften/sharpen */
+ float sharp_threshold;
+ int blur_kernel_radius;
+ int blur_mode;
+
+ /* fill tool */
+ float fill_threshold;
+
+ float add_col[3];
+ float sub_col[3];
+
+ float stencil_pos[2];
+ float stencil_dimension[2];
+
+ float mask_stencil_pos[2];
+ float mask_stencil_dimension[2];
+
+ struct BrushGpencilSettings *gpencil_settings;
} Brush;
typedef struct PaletteColor {
- struct PaletteColor *next, *prev;
- /* two values, one to store rgb, other to store values for sculpt/weight */
- float rgb[3];
- float value;
+ struct PaletteColor *next, *prev;
+ /* two values, one to store rgb, other to store values for sculpt/weight */
+ float rgb[3];
+ float value;
} PaletteColor;
typedef struct Palette {
- ID id;
+ ID id;
- /* pointer to individual colours */
- ListBase colors;
+ /* pointer to individual colours */
+ ListBase colors;
- int active_color;
- char _pad[4];
+ int active_color;
+ char _pad[4];
} Palette;
typedef struct PaintCurvePoint {
- /** Bezier handle. */
- BezTriple bez;
- /** Pressure on that point. */
- float pressure;
+ /** Bezier handle. */
+ BezTriple bez;
+ /** Pressure on that point. */
+ float pressure;
} PaintCurvePoint;
typedef struct PaintCurve {
- ID id;
- /** Points of curve. */
- PaintCurvePoint *points;
- int tot_points;
- /** Index where next point will be added. */
- int add_index;
+ ID id;
+ /** Points of curve. */
+ PaintCurvePoint *points;
+ int tot_points;
+ /** Index where next point will be added. */
+ int add_index;
} PaintCurve;
/* Brush.gradient_source */
typedef enum eBrushGradientSourceStroke {
- BRUSH_GRADIENT_PRESSURE = 0, /* gradient from pressure */
- BRUSH_GRADIENT_SPACING_REPEAT = 1, /* gradient from spacing */
- BRUSH_GRADIENT_SPACING_CLAMP = 2, /* gradient from spacing */
+ BRUSH_GRADIENT_PRESSURE = 0, /* gradient from pressure */
+ BRUSH_GRADIENT_SPACING_REPEAT = 1, /* gradient from spacing */
+ BRUSH_GRADIENT_SPACING_CLAMP = 2, /* gradient from spacing */
} eBrushGradientSourceStroke;
typedef enum eBrushGradientSourceFill {
- BRUSH_GRADIENT_LINEAR = 0, /* gradient from pressure */
- BRUSH_GRADIENT_RADIAL = 1, /* gradient from spacing */
+ BRUSH_GRADIENT_LINEAR = 0, /* gradient from pressure */
+ BRUSH_GRADIENT_RADIAL = 1, /* gradient from spacing */
} eBrushGradientSourceFill;
/* Brush.flag */
typedef enum eBrushFlags {
- BRUSH_AIRBRUSH = (1 << 0),
- BRUSH_FLAG_UNUSED_1 = (1 << 1), /* cleared */
- BRUSH_ALPHA_PRESSURE = (1 << 2),
- BRUSH_SIZE_PRESSURE = (1 << 3),
- BRUSH_JITTER_PRESSURE = (1 << 4),
- BRUSH_SPACING_PRESSURE = (1 << 5),
- BRUSH_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- BRUSH_FLAG_UNUSED_7 = (1 << 7), /* cleared */
- BRUSH_ANCHORED = (1 << 8),
- BRUSH_DIR_IN = (1 << 9),
- BRUSH_SPACE = (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_FLAG_UNUSED_17 = (1 << 17), /* cleared */
- 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_DRAG_DOT = (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_LINE = (1 << 29),
- BRUSH_ABSOLUTE_JITTER = (1 << 30),
- BRUSH_CURVE = (1u << 31),
+ BRUSH_AIRBRUSH = (1 << 0),
+ BRUSH_FLAG_UNUSED_1 = (1 << 1), /* cleared */
+ BRUSH_ALPHA_PRESSURE = (1 << 2),
+ BRUSH_SIZE_PRESSURE = (1 << 3),
+ BRUSH_JITTER_PRESSURE = (1 << 4),
+ BRUSH_SPACING_PRESSURE = (1 << 5),
+ BRUSH_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ BRUSH_FLAG_UNUSED_7 = (1 << 7), /* cleared */
+ BRUSH_ANCHORED = (1 << 8),
+ BRUSH_DIR_IN = (1 << 9),
+ BRUSH_SPACE = (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_FLAG_UNUSED_17 = (1 << 17), /* cleared */
+ 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_DRAG_DOT = (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_LINE = (1 << 29),
+ BRUSH_ABSOLUTE_JITTER = (1 << 30),
+ BRUSH_CURVE = (1u << 31),
} eBrushFlags;
typedef enum {
- BRUSH_MASK_PRESSURE_RAMP = (1 << 1),
- BRUSH_MASK_PRESSURE_CUTOFF = (1 << 2),
+ BRUSH_MASK_PRESSURE_RAMP = (1 << 1),
+ BRUSH_MASK_PRESSURE_CUTOFF = (1 << 2),
} BrushMaskPressureFlags;
/* Brush.overlay_flags */
typedef enum eOverlayFlags {
- 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),
+ 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),
} eOverlayFlags;
-#define BRUSH_OVERLAY_OVERRIDE_MASK (BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE | \
- BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE | \
- BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE)
+#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_tool */
typedef enum eBrushSculptTool {
- SCULPT_TOOL_DRAW = 1,
- SCULPT_TOOL_SMOOTH = 2,
- SCULPT_TOOL_PINCH = 3,
- SCULPT_TOOL_INFLATE = 4,
- SCULPT_TOOL_GRAB = 5,
- SCULPT_TOOL_LAYER = 6,
- SCULPT_TOOL_FLATTEN = 7,
- SCULPT_TOOL_CLAY = 8,
- SCULPT_TOOL_FILL = 9,
- SCULPT_TOOL_SCRAPE = 10,
- SCULPT_TOOL_NUDGE = 11,
- SCULPT_TOOL_THUMB = 12,
- SCULPT_TOOL_SNAKE_HOOK = 13,
- SCULPT_TOOL_ROTATE = 14,
- SCULPT_TOOL_SIMPLIFY = 15,
- SCULPT_TOOL_CREASE = 16,
- SCULPT_TOOL_BLOB = 17,
- SCULPT_TOOL_CLAY_STRIPS = 18,
- SCULPT_TOOL_MASK = 19,
+ SCULPT_TOOL_DRAW = 1,
+ SCULPT_TOOL_SMOOTH = 2,
+ SCULPT_TOOL_PINCH = 3,
+ SCULPT_TOOL_INFLATE = 4,
+ SCULPT_TOOL_GRAB = 5,
+ SCULPT_TOOL_LAYER = 6,
+ SCULPT_TOOL_FLATTEN = 7,
+ SCULPT_TOOL_CLAY = 8,
+ SCULPT_TOOL_FILL = 9,
+ SCULPT_TOOL_SCRAPE = 10,
+ SCULPT_TOOL_NUDGE = 11,
+ SCULPT_TOOL_THUMB = 12,
+ SCULPT_TOOL_SNAKE_HOOK = 13,
+ SCULPT_TOOL_ROTATE = 14,
+ SCULPT_TOOL_SIMPLIFY = 15,
+ SCULPT_TOOL_CREASE = 16,
+ SCULPT_TOOL_BLOB = 17,
+ SCULPT_TOOL_CLAY_STRIPS = 18,
+ SCULPT_TOOL_MASK = 19,
} eBrushSculptTool;
/** When #BRUSH_ACCUMULATE is used */
-#define SCULPT_TOOL_HAS_ACCUMULATE(t) ELEM(t, \
- SCULPT_TOOL_DRAW, \
- SCULPT_TOOL_CREASE, \
- SCULPT_TOOL_BLOB, \
- SCULPT_TOOL_LAYER, \
- SCULPT_TOOL_INFLATE, \
- SCULPT_TOOL_CLAY, \
- SCULPT_TOOL_CLAY_STRIPS, \
- SCULPT_TOOL_ROTATE, \
- SCULPT_TOOL_FLATTEN \
- )
-
-#define SCULPT_TOOL_HAS_NORMAL_WEIGHT(t) ELEM(t, \
- SCULPT_TOOL_GRAB, \
- SCULPT_TOOL_SNAKE_HOOK \
- )
-
-#define SCULPT_TOOL_HAS_RAKE(t) ELEM(t, \
- SCULPT_TOOL_SNAKE_HOOK \
- )
-
-#define SCULPT_TOOL_HAS_DYNTOPO(t) (ELEM(t, \
- /* These brushes, as currently coded, cannot support dynamic topology */ \
- SCULPT_TOOL_GRAB, \
- SCULPT_TOOL_ROTATE, \
- SCULPT_TOOL_THUMB, \
- SCULPT_TOOL_LAYER, \
- \
- /* These brushes could handle dynamic topology, \
- * but user feedback indicates it's better not to */ \
- SCULPT_TOOL_SMOOTH, \
- SCULPT_TOOL_MASK \
- ) == 0)
-
-#define SCULPT_TOOL_HAS_TOPOLOGY_RAKE(t) (ELEM(t, \
- /* These brushes, as currently coded, cannot support topology rake. */ \
- SCULPT_TOOL_GRAB, \
- SCULPT_TOOL_ROTATE, \
- SCULPT_TOOL_THUMB, \
- SCULPT_TOOL_MASK \
- ) == 0)
+#define SCULPT_TOOL_HAS_ACCUMULATE(t) \
+ ELEM(t, \
+ SCULPT_TOOL_DRAW, \
+ SCULPT_TOOL_CREASE, \
+ SCULPT_TOOL_BLOB, \
+ SCULPT_TOOL_LAYER, \
+ SCULPT_TOOL_INFLATE, \
+ SCULPT_TOOL_CLAY, \
+ SCULPT_TOOL_CLAY_STRIPS, \
+ SCULPT_TOOL_ROTATE, \
+ SCULPT_TOOL_FLATTEN)
+
+#define SCULPT_TOOL_HAS_NORMAL_WEIGHT(t) ELEM(t, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK)
+
+#define SCULPT_TOOL_HAS_RAKE(t) ELEM(t, SCULPT_TOOL_SNAKE_HOOK)
+
+#define SCULPT_TOOL_HAS_DYNTOPO(t) \
+ (ELEM(t, /* These brushes, as currently coded, cannot support dynamic topology */ \
+ SCULPT_TOOL_GRAB, \
+ SCULPT_TOOL_ROTATE, \
+ SCULPT_TOOL_THUMB, \
+ SCULPT_TOOL_LAYER, \
+\
+ /* These brushes could handle dynamic topology, \
+ * but user feedback indicates it's better not to */ \
+ SCULPT_TOOL_SMOOTH, \
+ SCULPT_TOOL_MASK) == 0)
+
+#define SCULPT_TOOL_HAS_TOPOLOGY_RAKE(t) \
+ (ELEM(t, /* These brushes, as currently coded, cannot support topology rake. */ \
+ SCULPT_TOOL_GRAB, \
+ SCULPT_TOOL_ROTATE, \
+ SCULPT_TOOL_THUMB, \
+ SCULPT_TOOL_MASK) == 0)
/* ImagePaintSettings.tool */
typedef enum eBrushImagePaintTool {
- PAINT_TOOL_DRAW = 0,
- PAINT_TOOL_SOFTEN = 1,
- PAINT_TOOL_SMEAR = 2,
- PAINT_TOOL_CLONE = 3,
- PAINT_TOOL_FILL = 4,
- PAINT_TOOL_MASK = 5,
+ PAINT_TOOL_DRAW = 0,
+ PAINT_TOOL_SOFTEN = 1,
+ PAINT_TOOL_SMEAR = 2,
+ PAINT_TOOL_CLONE = 3,
+ PAINT_TOOL_FILL = 4,
+ PAINT_TOOL_MASK = 5,
} eBrushImagePaintTool;
typedef enum eBrushVertexPaintTool {
- VPAINT_TOOL_DRAW = 0,
- VPAINT_TOOL_BLUR = 1,
- VPAINT_TOOL_AVERAGE = 2,
- VPAINT_TOOL_SMEAR = 3,
+ VPAINT_TOOL_DRAW = 0,
+ VPAINT_TOOL_BLUR = 1,
+ VPAINT_TOOL_AVERAGE = 2,
+ VPAINT_TOOL_SMEAR = 3,
} eBrushVertexPaintTool;
typedef enum eBrushWeightPaintTool {
- WPAINT_TOOL_DRAW = 0,
- WPAINT_TOOL_BLUR = 1,
- WPAINT_TOOL_AVERAGE = 2,
- WPAINT_TOOL_SMEAR = 3,
+ WPAINT_TOOL_DRAW = 0,
+ WPAINT_TOOL_BLUR = 1,
+ WPAINT_TOOL_AVERAGE = 2,
+ WPAINT_TOOL_SMEAR = 3,
} eBrushWeightPaintTool;
/* BrushGpencilSettings->brush type */
typedef enum eBrushGPaintTool {
- GPAINT_TOOL_DRAW = 0,
- GPAINT_TOOL_FILL = 1,
- GPAINT_TOOL_ERASE = 2,
+ GPAINT_TOOL_DRAW = 0,
+ GPAINT_TOOL_FILL = 1,
+ GPAINT_TOOL_ERASE = 2,
} eBrushGPaintTool;
-
/* direction that the brush displaces along */
enum {
- 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,
+ 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,
};
typedef enum {
- BRUSH_MASK_DRAW = 0,
- BRUSH_MASK_SMOOTH = 1,
+ BRUSH_MASK_DRAW = 0,
+ BRUSH_MASK_SMOOTH = 1,
} BrushMaskTool;
/* blur kernel types, Brush.blur_mode */
typedef enum eBlurKernelType {
- KERNEL_GAUSSIAN,
- KERNEL_BOX,
+ KERNEL_GAUSSIAN,
+ KERNEL_BOX,
} eBlurKernelType;
/* Brush.falloff_shape */
enum {
- PAINT_FALLOFF_SHAPE_SPHERE = 0,
- PAINT_FALLOFF_SHAPE_TUBE = 1,
+ PAINT_FALLOFF_SHAPE_SPHERE = 0,
+ PAINT_FALLOFF_SHAPE_TUBE = 1,
};
#define MAX_BRUSH_PIXEL_RADIUS 500
#define GP_MAX_BRUSH_PIXEL_RADIUS 1000
-#endif /* __DNA_BRUSH_TYPES_H__ */
+#endif /* __DNA_BRUSH_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_cachefile_types.h b/source/blender/makesdna/DNA_cachefile_types.h
index e226519bba0..e5f77f70720 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -32,56 +32,56 @@ extern "C" {
/* CacheFile::flag */
enum {
- CACHEFILE_DS_EXPAND = (1 << 0),
- CACHEFILE_DIRTY = (1 << 1),
+ CACHEFILE_DS_EXPAND = (1 << 0),
+ CACHEFILE_DIRTY = (1 << 1),
};
/* CacheFile::draw_flag */
enum {
- CACHEFILE_KEYFRAME_DRAWN = (1 << 0),
+ CACHEFILE_KEYFRAME_DRAWN = (1 << 0),
};
/* Representation of an object's path inside the Alembic file.
* Note that this is not a file path. */
typedef struct AlembicObjectPath {
- struct AlembicObjectPath *next, *prev;
+ struct AlembicObjectPath *next, *prev;
- char path[4096];
+ char path[4096];
} AlembicObjectPath;
typedef struct CacheFile {
- ID id;
- struct AnimData *adt;
+ ID id;
+ struct AnimData *adt;
- struct AbcArchiveHandle *handle;
- void *handle_mutex;
+ struct AbcArchiveHandle *handle;
+ void *handle_mutex;
- /** Paths of the objects inside of the Alembic archive referenced by this CacheFile. */
- ListBase object_paths;
+ /** Paths of the objects inside of the Alembic archive referenced by this CacheFile. */
+ ListBase object_paths;
- /** 1024 = FILE_MAX. */
- char filepath[1024];
+ /** 1024 = FILE_MAX. */
+ char filepath[1024];
- char is_sequence;
- char forward_axis;
- char up_axis;
- char override_frame;
+ char is_sequence;
+ char forward_axis;
+ char up_axis;
+ char override_frame;
- float scale;
- /** The frame/time to lookup in the cache file. */
- float frame;
- /** The frame offset to subtract. */
- float frame_offset;
+ float scale;
+ /** The frame/time to lookup in the cache file. */
+ float frame;
+ /** The frame offset to subtract. */
+ float frame_offset;
- /** Animation flag. */
- short flag;
- short draw_flag;
+ /** Animation flag. */
+ short flag;
+ short draw_flag;
- char _pad[4];
+ char _pad[4];
} CacheFile;
#ifdef __cplusplus
}
#endif
-#endif /* __DNA_CACHEFILE_TYPES_H__ */
+#endif /* __DNA_CACHEFILE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index 0af69384c54..8c5d911b7fa 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -41,167 +41,167 @@ struct Object;
/* ------------------------------------------- */
/* Stereo Settings */
typedef struct CameraStereoSettings {
- float interocular_distance;
- float convergence_distance;
- short convergence_mode;
- short pivot;
- short flag;
- char _pad[2];
- /* Cut-off angle at which interocular distance start to fade down. */
- float pole_merge_angle_from;
- /* Cut-off angle at which interocular distance stops to fade down. */
- float pole_merge_angle_to;
+ float interocular_distance;
+ float convergence_distance;
+ short convergence_mode;
+ short pivot;
+ short flag;
+ char _pad[2];
+ /* Cut-off angle at which interocular distance start to fade down. */
+ float pole_merge_angle_from;
+ /* Cut-off angle at which interocular distance stops to fade down. */
+ float pole_merge_angle_to;
} CameraStereoSettings;
/* Background Picture */
typedef struct CameraBGImage {
- struct CameraBGImage *next, *prev;
-
- struct Image *ima;
- struct ImageUser iuser;
- struct MovieClip *clip;
- struct MovieClipUser cuser;
- float offset[2], scale, rotation;
- float alpha;
- short flag;
- short source;
+ struct CameraBGImage *next, *prev;
+
+ struct Image *ima;
+ struct ImageUser iuser;
+ struct MovieClip *clip;
+ struct MovieClipUser cuser;
+ float offset[2], scale, rotation;
+ float alpha;
+ short flag;
+ short source;
} CameraBGImage;
typedef 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];
+ /* 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];
} Camera_Runtime;
typedef struct Camera {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- /** CAM_PERSP, CAM_ORTHO or CAM_PANO. */
- char type;
- /** Draw type extra. */
- char dtx;
- short flag;
- float passepartalpha;
- float clip_start, clip_end;
- float lens, ortho_scale, drawsize;
- float sensor_x, sensor_y;
- float shiftx, shifty;
- float dof_distance;
-
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
-
- struct Object *dof_ob;
- struct GPUDOFSettings gpu_dof;
-
- /* CameraBGImage reference images */
- struct ListBase bg_images;
-
- char sensor_fit;
- char _pad[7];
-
- /* Stereo settings */
- struct CameraStereoSettings stereo;
-
- /** Runtime data (keep last). */
- Camera_Runtime runtime;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ /** CAM_PERSP, CAM_ORTHO or CAM_PANO. */
+ char type;
+ /** Draw type extra. */
+ char dtx;
+ short flag;
+ float passepartalpha;
+ float clip_start, clip_end;
+ float lens, ortho_scale, drawsize;
+ float sensor_x, sensor_y;
+ float shiftx, shifty;
+ float dof_distance;
+
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+
+ struct Object *dof_ob;
+ struct GPUDOFSettings gpu_dof;
+
+ /* CameraBGImage reference images */
+ struct ListBase bg_images;
+
+ char sensor_fit;
+ char _pad[7];
+
+ /* Stereo settings */
+ struct CameraStereoSettings stereo;
+
+ /** Runtime data (keep last). */
+ Camera_Runtime runtime;
} Camera;
/* **************** CAMERA ********************* */
/* type */
enum {
- CAM_PERSP = 0,
- CAM_ORTHO = 1,
- CAM_PANO = 2,
+ CAM_PERSP = 0,
+ CAM_ORTHO = 1,
+ CAM_PANO = 2,
};
/* dtx */
enum {
- CAM_DTX_CENTER = (1 << 0),
- CAM_DTX_CENTER_DIAG = (1 << 1),
- CAM_DTX_THIRDS = (1 << 2),
- CAM_DTX_GOLDEN = (1 << 3),
- CAM_DTX_GOLDEN_TRI_A = (1 << 4),
- CAM_DTX_GOLDEN_TRI_B = (1 << 5),
- CAM_DTX_HARMONY_TRI_A = (1 << 6),
- CAM_DTX_HARMONY_TRI_B = (1 << 7),
+ CAM_DTX_CENTER = (1 << 0),
+ CAM_DTX_CENTER_DIAG = (1 << 1),
+ CAM_DTX_THIRDS = (1 << 2),
+ CAM_DTX_GOLDEN = (1 << 3),
+ CAM_DTX_GOLDEN_TRI_A = (1 << 4),
+ CAM_DTX_GOLDEN_TRI_B = (1 << 5),
+ CAM_DTX_HARMONY_TRI_A = (1 << 6),
+ CAM_DTX_HARMONY_TRI_B = (1 << 7),
};
/* flag */
enum {
- 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),
+ 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
- CAM_PANORAMA = (1 << 7), /* deprecated */
+ CAM_PANORAMA = (1 << 7), /* deprecated */
#endif
- CAM_SHOWSENSOR = (1 << 8),
- CAM_SHOW_SAFE_CENTER = (1 << 9),
- CAM_SHOW_BG_IMAGE = (1 << 10),
+ CAM_SHOWSENSOR = (1 << 8),
+ CAM_SHOW_SAFE_CENTER = (1 << 9),
+ CAM_SHOW_BG_IMAGE = (1 << 10),
};
/* Sensor fit */
enum {
- CAMERA_SENSOR_FIT_AUTO = 0,
- CAMERA_SENSOR_FIT_HOR = 1,
- CAMERA_SENSOR_FIT_VERT = 2,
+ 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
+#define DEFAULT_SENSOR_WIDTH 36.0f
+#define DEFAULT_SENSOR_HEIGHT 24.0f
/* stereo->convergence_mode */
enum {
- CAM_S3D_OFFAXIS = 0,
- CAM_S3D_PARALLEL = 1,
- CAM_S3D_TOE = 2,
+ CAM_S3D_OFFAXIS = 0,
+ CAM_S3D_PARALLEL = 1,
+ CAM_S3D_TOE = 2,
};
/* stereo->pivot */
enum {
- CAM_S3D_PIVOT_LEFT = 0,
- CAM_S3D_PIVOT_RIGHT = 1,
- CAM_S3D_PIVOT_CENTER = 2,
+ CAM_S3D_PIVOT_LEFT = 0,
+ CAM_S3D_PIVOT_RIGHT = 1,
+ CAM_S3D_PIVOT_CENTER = 2,
};
/* stereo->flag */
enum {
- CAM_S3D_SPHERICAL = (1 << 0),
- CAM_S3D_POLE_MERGE = (1 << 1),
+ CAM_S3D_SPHERICAL = (1 << 0),
+ CAM_S3D_POLE_MERGE = (1 << 1),
};
/* CameraBGImage->flag */
/* may want to use 1 for select ? */
enum {
- 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 */
- CAM_BGIMG_FLAG_CAMERA_ASPECT = (1 << 5), /* don't stretch to fit the camera view */
- CAM_BGIMG_FLAG_CAMERA_CROP = (1 << 6), /* crop out the image */
-
- /* Axis flip options */
- CAM_BGIMG_FLAG_FLIP_X = (1 << 7),
- CAM_BGIMG_FLAG_FLIP_Y = (1 << 8),
+ 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 */
+ CAM_BGIMG_FLAG_CAMERA_ASPECT = (1 << 5), /* don't stretch to fit the camera view */
+ CAM_BGIMG_FLAG_CAMERA_CROP = (1 << 6), /* crop out the image */
+
+ /* Axis flip options */
+ CAM_BGIMG_FLAG_FLIP_X = (1 << 7),
+ CAM_BGIMG_FLAG_FLIP_Y = (1 << 8),
};
/* CameraBGImage->source */
/* may want to use 1 for select ?*/
enum {
- CAM_BGIMG_SOURCE_IMAGE = 0,
- CAM_BGIMG_SOURCE_MOVIE = 1,
+ CAM_BGIMG_SOURCE_IMAGE = 0,
+ CAM_BGIMG_SOURCE_MOVIE = 1,
};
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 9ab873e1264..9cedd8f0ebf 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -39,149 +39,147 @@
*/
typedef struct ClothSimSettings {
- /** UNUSED atm. */
- struct LinkNode *cache;
- /** See SB. */
- float mingoal;
- /** Mechanical damping of springs. */
- float Cdis DNA_DEPRECATED;
- /** Viscous/fluid damping. */
- float Cvi;
- /** Gravity/external force vector. */
- float gravity[3];
- /** This is the duration of our time step, computed.. */
- float dt;
- /** The mass of the entire cloth. */
- float mass;
- /** Structural spring stiffness. */
- float structural DNA_DEPRECATED;
- /** Shear spring stiffness. */
- float shear;
- /** Flexion spring stiffness. */
- float bending;
- /** Max bending scaling value, min is "bending". */
- float max_bend;
- /** Max structural scaling value, min is "structural". */
- float max_struct DNA_DEPRECATED;
- /** Max shear scaling value. */
- float max_shear;
- /** Max sewing force. */
- float max_sewing;
- /** Used for normalized springs. */
- float avg_spring_len;
- /** Parameter how fast cloth runs. */
- float timescale;
- /** Multiplies cloth speed. */
- float time_scale;
- /** See SB. */
- float maxgoal;
- /** Scaling of effector forces (see softbody_calc_forces)..*/
- float eff_force_scale;
- /** Scaling of effector wind (see softbody_calc_forces).. */
- float eff_wind_scale;
- float sim_time_old;
- float defgoal;
- float goalspring;
- float goalfrict;
- /** Smoothing of velocities for hair. */
- float velocity_smooth;
- /** Minimum density for hair. */
- float density_target;
- /** Influence of hair density. */
- float density_strength;
- /** Friction with colliders. */
- float collider_friction;
- /** Damp the velocity to speed up getting to the resting position. */
- float vel_damping DNA_DEPRECATED;
- /** Min amount to shrink cloth by 0.0f (no shrink) - 1.0f (shrink to nothing). */
- float shrink_min;
- /** Max amount to shrink cloth by 0.0f (no shrink) - 1.0f (shrink to nothing). */
- float shrink_max;
+ /** UNUSED atm. */
+ struct LinkNode *cache;
+ /** See SB. */
+ float mingoal;
+ /** Mechanical damping of springs. */
+ float Cdis DNA_DEPRECATED;
+ /** Viscous/fluid damping. */
+ float Cvi;
+ /** Gravity/external force vector. */
+ float gravity[3];
+ /** This is the duration of our time step, computed.. */
+ float dt;
+ /** The mass of the entire cloth. */
+ float mass;
+ /** Structural spring stiffness. */
+ float structural DNA_DEPRECATED;
+ /** Shear spring stiffness. */
+ float shear;
+ /** Flexion spring stiffness. */
+ float bending;
+ /** Max bending scaling value, min is "bending". */
+ float max_bend;
+ /** Max structural scaling value, min is "structural". */
+ float max_struct DNA_DEPRECATED;
+ /** Max shear scaling value. */
+ float max_shear;
+ /** Max sewing force. */
+ float max_sewing;
+ /** Used for normalized springs. */
+ float avg_spring_len;
+ /** Parameter how fast cloth runs. */
+ float timescale;
+ /** Multiplies cloth speed. */
+ float time_scale;
+ /** See SB. */
+ float maxgoal;
+ /** Scaling of effector forces (see softbody_calc_forces)..*/
+ float eff_force_scale;
+ /** Scaling of effector wind (see softbody_calc_forces).. */
+ float eff_wind_scale;
+ float sim_time_old;
+ float defgoal;
+ float goalspring;
+ float goalfrict;
+ /** Smoothing of velocities for hair. */
+ float velocity_smooth;
+ /** Minimum density for hair. */
+ float density_target;
+ /** Influence of hair density. */
+ float density_strength;
+ /** Friction with colliders. */
+ float collider_friction;
+ /** Damp the velocity to speed up getting to the resting position. */
+ float vel_damping DNA_DEPRECATED;
+ /** Min amount to shrink cloth by 0.0f (no shrink) - 1.0f (shrink to nothing). */
+ float shrink_min;
+ /** Max amount to shrink cloth by 0.0f (no shrink) - 1.0f (shrink to nothing). */
+ float shrink_max;
- /* XXX various hair stuff
- * should really be separate, this struct is a horrible mess already
- */
- /** Damping of bending springs. */
- float bending_damping;
- /** Size of voxel grid cells for continuum dynamics. */
- float voxel_cell_size;
- char _pad[4];
+ /* XXX various hair stuff
+ * should really be separate, this struct is a horrible mess already
+ */
+ /** Damping of bending springs. */
+ float bending_damping;
+ /** Size of voxel grid cells for continuum dynamics. */
+ float voxel_cell_size;
+ char _pad[4];
- /** Number of time steps per frame. */
- int stepsPerFrame;
- /** Flags, see CSIMSETT_FLAGS enum above. */
- int flags;
- /** How many frames of simulation to do before we start. */
- int preroll DNA_DEPRECATED;
- /** In percent!; if tearing enabled, a spring will get cut. */
- int maxspringlen;
- /** Which solver should be used? txold. */
- short solver_type;
- /** Vertex group for scaling bending stiffness. */
- short vgroup_bend;
- /** Optional vertexgroup name for assigning weight..*/
- short vgroup_mass;
- /** Vertex group for scaling structural stiffness. */
- short vgroup_struct;
- /** Vertex group for shrinking cloth. */
- short vgroup_shrink;
- /** Vertex group for scaling structural stiffness. */
- short shapekey_rest;
- /** Used for presets on GUI. */
- short presets;
- short reset;
+ /** Number of time steps per frame. */
+ int stepsPerFrame;
+ /** Flags, see CSIMSETT_FLAGS enum above. */
+ int flags;
+ /** How many frames of simulation to do before we start. */
+ int preroll DNA_DEPRECATED;
+ /** In percent!; if tearing enabled, a spring will get cut. */
+ int maxspringlen;
+ /** Which solver should be used? txold. */
+ short solver_type;
+ /** Vertex group for scaling bending stiffness. */
+ short vgroup_bend;
+ /** Optional vertexgroup name for assigning weight..*/
+ short vgroup_mass;
+ /** Vertex group for scaling structural stiffness. */
+ short vgroup_struct;
+ /** Vertex group for shrinking cloth. */
+ short vgroup_shrink;
+ /** Vertex group for scaling structural stiffness. */
+ short shapekey_rest;
+ /** Used for presets on GUI. */
+ short presets;
+ short reset;
- char _pad0[4];
- struct EffectorWeights *effector_weights;
+ char _pad0[4];
+ struct EffectorWeights *effector_weights;
- short bending_model;
- /** Vertex group for scaling structural stiffness. */
- short vgroup_shear;
- float tension;
- float compression;
- float max_tension;
- float max_compression;
- /** Mechanical damping of tension springs. */
- float tension_damp;
- /** Mechanical damping of compression springs. */
- float compression_damp;
- /** Mechanical damping of shear springs. */
- float shear_damp;
+ short bending_model;
+ /** Vertex group for scaling structural stiffness. */
+ short vgroup_shear;
+ float tension;
+ float compression;
+ float max_tension;
+ float max_compression;
+ /** Mechanical damping of tension springs. */
+ float tension_damp;
+ /** Mechanical damping of compression springs. */
+ float compression_damp;
+ /** Mechanical damping of shear springs. */
+ float shear_damp;
} ClothSimSettings;
-
typedef struct ClothCollSettings {
- /** E.g. pointer to temp memory for collisions. */
- struct LinkNode *collision_list;
- /** Min distance for collisions. */
- float epsilon;
- /** Fiction/damping with self contact. */
- float self_friction;
- /** Friction/damping applied on contact with other object. */
- float friction;
- /** Collision restitution on contact with other object. */
- float damping;
- /** For selfcollision. */
- float selfepsilon;
- float repel_force DNA_DEPRECATED;
- float distance_repel DNA_DEPRECATED;
- /** Collision flags defined in BKE_cloth.h. */
- int flags;
- /** How many iterations for the selfcollision loop. */
- short self_loop_count DNA_DEPRECATED;
- /** How many iterations for the collision loop. */
- short loop_count;
- char _pad[4];
- /** Only use colliders from this group of objects. */
- struct Collection *group;
- /** Vgroup to paint which vertices are used for self collisions. */
- short vgroup_selfcol;
- char _pad2[6];
- /** Impulse clamp for object collisions. */
- float clamp;
- /** Impulse clamp for self collisions. */
- float self_clamp;
+ /** E.g. pointer to temp memory for collisions. */
+ struct LinkNode *collision_list;
+ /** Min distance for collisions. */
+ float epsilon;
+ /** Fiction/damping with self contact. */
+ float self_friction;
+ /** Friction/damping applied on contact with other object. */
+ float friction;
+ /** Collision restitution on contact with other object. */
+ float damping;
+ /** For selfcollision. */
+ float selfepsilon;
+ float repel_force DNA_DEPRECATED;
+ float distance_repel DNA_DEPRECATED;
+ /** Collision flags defined in BKE_cloth.h. */
+ int flags;
+ /** How many iterations for the selfcollision loop. */
+ short self_loop_count DNA_DEPRECATED;
+ /** How many iterations for the collision loop. */
+ short loop_count;
+ char _pad[4];
+ /** Only use colliders from this group of objects. */
+ struct Collection *group;
+ /** Vgroup to paint which vertices are used for self collisions. */
+ short vgroup_selfcol;
+ char _pad2[6];
+ /** Impulse clamp for object collisions. */
+ float clamp;
+ /** Impulse clamp for self collisions. */
+ float self_clamp;
} ClothCollSettings;
-
#endif
diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h
index 56f3d6ff290..b935acd5a24 100644
--- a/source/blender/makesdna/DNA_collection_types.h
+++ b/source/blender/makesdna/DNA_collection_types.h
@@ -34,56 +34,54 @@ struct Collection;
struct Object;
typedef struct CollectionObject {
- struct CollectionObject *next, *prev;
- struct Object *ob;
+ struct CollectionObject *next, *prev;
+ struct Object *ob;
} CollectionObject;
-
typedef struct CollectionChild {
- struct CollectionChild *next, *prev;
- struct Collection *collection;
+ struct CollectionChild *next, *prev;
+ struct Collection *collection;
} CollectionChild;
-
typedef struct Collection {
- ID id;
+ ID id;
- /** CollectionObject. */
- ListBase gobject;
- /** CollectionChild. */
- ListBase children;
+ /** CollectionObject. */
+ ListBase gobject;
+ /** CollectionChild. */
+ ListBase children;
- struct PreviewImage *preview;
+ struct PreviewImage *preview;
- unsigned int layer DNA_DEPRECATED;
- float instance_offset[3];
+ unsigned int layer DNA_DEPRECATED;
+ float instance_offset[3];
- short flag;
- char _pad[6];
+ short flag;
+ char _pad[6];
- /* Runtime. Cache of objects in this collection and all its
- * children. This is created on demand when e.g. some physics
- * simulation needs it, we don't want to have it for every
- * collections due to memory usage reasons. */
- ListBase object_cache;
+ /* Runtime. Cache of objects in this collection and all its
+ * children. This is created on demand when e.g. some physics
+ * simulation needs it, we don't want to have it for every
+ * collections due to memory usage reasons. */
+ ListBase object_cache;
- /* Runtime. List of collections that are a parent of this
- * datablock. */
- ListBase parents;
+ /* Runtime. List of collections that are a parent of this
+ * datablock. */
+ ListBase parents;
- /* Deprecated */
- struct SceneCollection *collection DNA_DEPRECATED;
- struct ViewLayer *view_layer DNA_DEPRECATED;
+ /* Deprecated */
+ struct SceneCollection *collection DNA_DEPRECATED;
+ struct ViewLayer *view_layer DNA_DEPRECATED;
} Collection;
/* Collection->flag */
enum {
- COLLECTION_RESTRICT_VIEW = (1 << 0), /* Hidden in viewport. */
- COLLECTION_RESTRICT_SELECT = (1 << 1), /* Not selectable in viewport. */
- COLLECTION_DISABLED_DEPRECATED = (1 << 2), /* Not used anymore */
- COLLECTION_RESTRICT_RENDER = (1 << 3), /* Hidden in renders. */
- COLLECTION_HAS_OBJECT_CACHE = (1 << 4), /* Runtime: object_cache is populated. */
- COLLECTION_IS_MASTER = (1 << 5), /* Is master collection embedded in the scene. */
+ COLLECTION_RESTRICT_VIEW = (1 << 0), /* Hidden in viewport. */
+ COLLECTION_RESTRICT_SELECT = (1 << 1), /* Not selectable in viewport. */
+ COLLECTION_DISABLED_DEPRECATED = (1 << 2), /* Not used anymore */
+ COLLECTION_RESTRICT_RENDER = (1 << 3), /* Hidden in renders. */
+ COLLECTION_HAS_OBJECT_CACHE = (1 << 4), /* Runtime: object_cache is populated. */
+ COLLECTION_IS_MASTER = (1 << 5), /* Is master collection embedded in the scene. */
};
-#endif /* __DNA_COLLECTION_TYPES_H__ */
+#endif /* __DNA_COLLECTION_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h
index 76746ef2759..219fc96554a 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -29,187 +29,186 @@
/* general defines for kernel functions */
#define CM_RESOL 32
#define CM_TABLE 256
-#define CM_TABLEDIV (1.0f/256.0f)
+#define CM_TABLEDIV (1.0f / 256.0f)
-#define CM_TOT 4
+#define CM_TOT 4
typedef struct CurveMapPoint {
- float x, y;
- /** Shorty for result lookup. */
- short flag, shorty;
+ float x, y;
+ /** Shorty for result lookup. */
+ short flag, shorty;
} CurveMapPoint;
/* curvepoint->flag */
enum {
- CUMA_SELECT = (1 << 0),
- CUMA_HANDLE_VECTOR = (1 << 1),
- CUMA_HANDLE_AUTO_ANIM = (1 << 2),
+ CUMA_SELECT = (1 << 0),
+ CUMA_HANDLE_VECTOR = (1 << 1),
+ CUMA_HANDLE_AUTO_ANIM = (1 << 2),
};
typedef struct CurveMap {
- short totpoint, flag;
-
- /** Quick multiply value for reading table. */
- float range;
- /** The x-axis range for the table. */
- float mintable, maxtable;
- /** For extrapolated curves, the direction vector. */
- float ext_in[2], ext_out[2];
- /** Actual curve. */
- CurveMapPoint *curve;
- /** Display and evaluate table. */
- CurveMapPoint *table;
-
- /** For RGB curves, premulled table. */
- CurveMapPoint *premultable;
- /** For RGB curves, premulled extrapolation vector. */
- float premul_ext_in[2];
- float premul_ext_out[2];
+ short totpoint, flag;
+
+ /** Quick multiply value for reading table. */
+ float range;
+ /** The x-axis range for the table. */
+ float mintable, maxtable;
+ /** For extrapolated curves, the direction vector. */
+ float ext_in[2], ext_out[2];
+ /** Actual curve. */
+ CurveMapPoint *curve;
+ /** Display and evaluate table. */
+ CurveMapPoint *table;
+
+ /** For RGB curves, premulled table. */
+ CurveMapPoint *premultable;
+ /** For RGB curves, premulled extrapolation vector. */
+ float premul_ext_in[2];
+ float premul_ext_out[2];
} CurveMap;
/* cuma->flag */
-#define CUMA_EXTEND_EXTRAPOLATE 1
+#define CUMA_EXTEND_EXTRAPOLATE 1
typedef struct CurveMapping {
- /** Cur; for buttons, to show active curve. */
- int flag, cur;
- int preset;
- int changed_timestamp;
-
- /** 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];
-
- short tone;
- char _pad[6];
+ /** Cur; for buttons, to show active curve. */
+ int flag, cur;
+ int preset;
+ int changed_timestamp;
+
+ /** 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];
+
+ short tone;
+ char _pad[6];
} CurveMapping;
/* cumapping->flag */
-#define CUMA_DO_CLIP (1 << 0)
-#define CUMA_PREMULLED (1 << 1)
-#define CUMA_DRAW_CFRA (1 << 2)
-#define CUMA_DRAW_SAMPLE (1 << 3)
+#define CUMA_DO_CLIP (1 << 0)
+#define CUMA_PREMULLED (1 << 1)
+#define CUMA_DRAW_CFRA (1 << 2)
+#define CUMA_DRAW_SAMPLE (1 << 3)
/* cumapping->preset */
typedef enum eCurveMappingPreset {
- CURVE_PRESET_LINE = 0,
- CURVE_PRESET_SHARP = 1,
- CURVE_PRESET_SMOOTH = 2,
- CURVE_PRESET_MAX = 3,
- CURVE_PRESET_MID9 = 4,
- CURVE_PRESET_ROUND = 5,
- CURVE_PRESET_ROOT = 6,
- CURVE_PRESET_GAUSS = 7,
- CURVE_PRESET_BELL = 8,
+ CURVE_PRESET_LINE = 0,
+ CURVE_PRESET_SHARP = 1,
+ CURVE_PRESET_SMOOTH = 2,
+ CURVE_PRESET_MAX = 3,
+ CURVE_PRESET_MID9 = 4,
+ CURVE_PRESET_ROUND = 5,
+ CURVE_PRESET_ROOT = 6,
+ CURVE_PRESET_GAUSS = 7,
+ CURVE_PRESET_BELL = 8,
} eCurveMappingPreset;
/* CurveMapping->tone */
typedef enum eCurveMappingTone {
- CURVE_TONE_STANDARD = 0,
- CURVE_TONE_FILMLIKE = 2,
+ CURVE_TONE_STANDARD = 0,
+ CURVE_TONE_FILMLIKE = 2,
} eCurveMappingTone;
/* histogram->mode */
enum {
- HISTO_MODE_LUMA = 0,
- HISTO_MODE_RGB = 1,
- HISTO_MODE_R = 2,
- HISTO_MODE_G = 3,
- HISTO_MODE_B = 4,
- HISTO_MODE_ALPHA = 5,
+ HISTO_MODE_LUMA = 0,
+ HISTO_MODE_RGB = 1,
+ HISTO_MODE_R = 2,
+ HISTO_MODE_G = 3,
+ HISTO_MODE_B = 4,
+ HISTO_MODE_ALPHA = 5,
};
enum {
- HISTO_FLAG_LINE = (1 << 0),
- HISTO_FLAG_SAMPLELINE = (1 << 1),
+ HISTO_FLAG_LINE = (1 << 0),
+ HISTO_FLAG_SAMPLELINE = (1 << 1),
};
typedef struct Histogram {
- int channels;
- int x_resolution;
- float data_luma[256];
- float data_r[256];
- float data_g[256];
- float data_b[256];
- float data_a[256];
- float xmax, ymax;
- short mode;
- short flag;
- int height;
-
- /* sample line only */
- /* image coords src -> dst */
- float co[2][2];
+ int channels;
+ int x_resolution;
+ float data_luma[256];
+ float data_r[256];
+ float data_g[256];
+ float data_b[256];
+ float data_a[256];
+ float xmax, ymax;
+ short mode;
+ short flag;
+ int height;
+
+ /* sample line only */
+ /* image coords src -> dst */
+ float co[2][2];
} Histogram;
-
typedef struct Scopes {
- int ok;
- int sample_full;
- int sample_lines;
- float accuracy;
- int wavefrm_mode;
- float wavefrm_alpha;
- float wavefrm_yfac;
- int wavefrm_height;
- float vecscope_alpha;
- int vecscope_height;
- float minmax[3][2];
- struct Histogram hist;
- float *waveform_1;
- float *waveform_2;
- float *waveform_3;
- float *vecscope;
- int waveform_tot;
- char _pad[4];
+ int ok;
+ int sample_full;
+ int sample_lines;
+ float accuracy;
+ int wavefrm_mode;
+ float wavefrm_alpha;
+ float wavefrm_yfac;
+ int wavefrm_height;
+ float vecscope_alpha;
+ int vecscope_height;
+ float minmax[3][2];
+ struct Histogram hist;
+ float *waveform_1;
+ float *waveform_2;
+ float *waveform_3;
+ float *vecscope;
+ int waveform_tot;
+ char _pad[4];
} Scopes;
/* scopes->wavefrm_mode */
-#define SCOPES_WAVEFRM_LUMA 0
-#define SCOPES_WAVEFRM_RGB_PARADE 1
-#define SCOPES_WAVEFRM_YCC_601 2
-#define SCOPES_WAVEFRM_YCC_709 3
-#define SCOPES_WAVEFRM_YCC_JPEG 4
-#define SCOPES_WAVEFRM_RGB 5
+#define SCOPES_WAVEFRM_LUMA 0
+#define SCOPES_WAVEFRM_RGB_PARADE 1
+#define SCOPES_WAVEFRM_YCC_601 2
+#define SCOPES_WAVEFRM_YCC_709 3
+#define SCOPES_WAVEFRM_YCC_JPEG 4
+#define SCOPES_WAVEFRM_RGB 5
typedef struct ColorManagedViewSettings {
- int 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];
- /** Fstop exposure. */
- float exposure;
- /** Post-display gamma transform. */
- float gamma;
- /** Pre-display RGB curves transform. */
- struct CurveMapping *curve_mapping;
- void *_pad2;
+ int 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];
+ /** Fstop exposure. */
+ float exposure;
+ /** Post-display gamma transform. */
+ float gamma;
+ /** Pre-display RGB curves transform. */
+ struct CurveMapping *curve_mapping;
+ void *_pad2;
} ColorManagedViewSettings;
typedef struct ColorManagedDisplaySettings {
- char display_device[64];
+ char display_device[64];
} ColorManagedDisplaySettings;
typedef struct ColorManagedColorspaceSettings {
- /** MAX_COLORSPACE_NAME. */
- char name[64];
+ /** MAX_COLORSPACE_NAME. */
+ char name[64];
} ColorManagedColorspaceSettings;
/* ColorManagedViewSettings->flag */
enum {
- COLORMANAGE_VIEW_USE_CURVES = (1 << 0),
+ COLORMANAGE_VIEW_USE_CURVES = (1 << 0),
};
#endif
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 9dbebee5c89..3ca61400e2e 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -36,51 +36,50 @@ struct Text;
/* channels reside in Object or Action (ListBase) constraintChannels */
// XXX deprecated... old AnimSys
typedef struct bConstraintChannel {
- struct bConstraintChannel *next, *prev;
- struct Ipo *ipo;
- short flag;
- char name[30];
+ struct bConstraintChannel *next, *prev;
+ struct Ipo *ipo;
+ short flag;
+ char name[30];
} bConstraintChannel;
/* A Constraint */
typedef struct bConstraint {
- struct bConstraint *next, *prev;
-
- /** Constraint data (a valid constraint type). */
- void *data;
- /** Constraint type. */
- short type;
- /** Flag - General Settings. */
- short flag;
-
- /** Space that owner should be evaluated in. */
- char ownspace;
- /** Space that target should be evaluated in (only used if 1 target). */
- char tarspace;
-
- /** Constraint name, MAX_NAME. */
- char name[64];
-
- char _pad[2];
-
- /** Amount of influence exherted by constraint (0.0-1.0). */
- float enforce;
- /** Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail. */
- float headtail;
-
- /* old animation system, deprecated for 2.5. */
- /** Local influence ipo or driver */
- struct Ipo *ipo DNA_DEPRECATED;
-
- /* below are readonly fields that are set at runtime
- * by the solver for use in the GE (only IK atm) */
- /** Residual error on constraint expressed in blender unit. */
- float lin_error;
- /** Residual error on constraint expressed in radiant. */
- float rot_error;
+ struct bConstraint *next, *prev;
+
+ /** Constraint data (a valid constraint type). */
+ void *data;
+ /** Constraint type. */
+ short type;
+ /** Flag - General Settings. */
+ short flag;
+
+ /** Space that owner should be evaluated in. */
+ char ownspace;
+ /** Space that target should be evaluated in (only used if 1 target). */
+ char tarspace;
+
+ /** Constraint name, MAX_NAME. */
+ char name[64];
+
+ char _pad[2];
+
+ /** Amount of influence exherted by constraint (0.0-1.0). */
+ float enforce;
+ /** Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail. */
+ float headtail;
+
+ /* old animation system, deprecated for 2.5. */
+ /** Local influence ipo or driver */
+ struct Ipo *ipo DNA_DEPRECATED;
+
+ /* below are readonly fields that are set at runtime
+ * by the solver for use in the GE (only IK atm) */
+ /** Residual error on constraint expressed in blender unit. */
+ float lin_error;
+ /** Residual error on constraint expressed in radiant. */
+ float rot_error;
} bConstraint;
-
/* Multiple-target constraints --------------------- */
/* This struct defines a constraint target.
@@ -88,76 +87,74 @@ typedef struct bConstraint {
* constraint has.
*/
typedef struct bConstraintTarget {
- struct bConstraintTarget *next, *prev;
-
- /** Object to use as target. */
- struct Object *tar;
- /** Subtarget - pchan or vgroup name, MAX_ID_NAME-2. */
- char subtarget[64];
-
- /** Matrix used during constraint solving - should be cleared before each use. */
- float matrix[4][4];
-
- /** Space that target should be evaluated in (overrides bConstraint->tarspace). */
- short space;
- /** Runtime settings (for editor, etc.). */
- short flag;
- /** Type of target (eConstraintObType). */
- short type;
- /** Rotation order for target (as defined in BLI_math.h). */
- short rotOrder;
- /** Weight for armature deform. */
- float weight;
- char _pad[4];
+ struct bConstraintTarget *next, *prev;
+
+ /** Object to use as target. */
+ struct Object *tar;
+ /** Subtarget - pchan or vgroup name, MAX_ID_NAME-2. */
+ char subtarget[64];
+
+ /** Matrix used during constraint solving - should be cleared before each use. */
+ float matrix[4][4];
+
+ /** Space that target should be evaluated in (overrides bConstraint->tarspace). */
+ short space;
+ /** Runtime settings (for editor, etc.). */
+ short flag;
+ /** Type of target (eConstraintObType). */
+ short type;
+ /** Rotation order for target (as defined in BLI_math.h). */
+ short rotOrder;
+ /** Weight for armature deform. */
+ float weight;
+ char _pad[4];
} bConstraintTarget;
/* bConstraintTarget -> flag */
typedef enum eConstraintTargetFlag {
- /** temporary target-struct that needs to be freed after use */
- CONSTRAINT_TAR_TEMP = (1 << 0),
+ /** temporary target-struct that needs to be freed after use */
+ CONSTRAINT_TAR_TEMP = (1 << 0),
} eConstraintTargetFlag;
/* bConstraintTarget/bConstraintOb -> type */
typedef enum eConstraintObType {
- /** string is "" */
- CONSTRAINT_OBTYPE_OBJECT = 1,
- /** string is bone-name */
- CONSTRAINT_OBTYPE_BONE = 2,
- /** string is vertex-group name */
- CONSTRAINT_OBTYPE_VERT = 3,
- /** string is vertex-group name - is not available until curves get vgroups */
- CONSTRAINT_OBTYPE_CV = 4,
+ /** string is "" */
+ CONSTRAINT_OBTYPE_OBJECT = 1,
+ /** string is bone-name */
+ CONSTRAINT_OBTYPE_BONE = 2,
+ /** string is vertex-group name */
+ CONSTRAINT_OBTYPE_VERT = 3,
+ /** string is vertex-group name - is not available until curves get vgroups */
+ CONSTRAINT_OBTYPE_CV = 4,
} eConstraintObType;
-
/* Python Script Constraint */
typedef struct bPythonConstraint {
- /** Text-buffer (containing script) to execute. */
- struct Text *text;
- /** 'id-properties' used to store custom properties for constraint. */
- IDProperty *prop;
-
- /** General settings/state indicators accessed by bitmapping. */
- int flag;
- /** Number of targets - usually only 1-3 are needed. */
- int tarnum;
-
- /** A list of targets that this constraint has (bConstraintTarget-s). */
- ListBase targets;
-
- /**
- * Target from previous implementation
- * (version-patch sets this to NULL on file-load).
- */
- struct Object *tar;
- /**
- * Subtarger from previous implementation
- * (version-patch sets this to "" on file-load), MAX_ID_NAME-2.
- */
- char subtarget[64];
+ /** Text-buffer (containing script) to execute. */
+ struct Text *text;
+ /** 'id-properties' used to store custom properties for constraint. */
+ IDProperty *prop;
+
+ /** General settings/state indicators accessed by bitmapping. */
+ int flag;
+ /** Number of targets - usually only 1-3 are needed. */
+ int tarnum;
+
+ /** A list of targets that this constraint has (bConstraintTarget-s). */
+ ListBase targets;
+
+ /**
+ * Target from previous implementation
+ * (version-patch sets this to NULL on file-load).
+ */
+ struct Object *tar;
+ /**
+ * Subtarger from previous implementation
+ * (version-patch sets this to "" on file-load), MAX_ID_NAME-2.
+ */
+ char subtarget[64];
} bPythonConstraint;
-
/* Inverse-Kinematics (IK) constraint
* This constraint supports a variety of mode determine by the type field
* according to eConstraint_IK_Type.
@@ -165,441 +162,440 @@ typedef struct bPythonConstraint {
* This is indicated in the comments for each field
*/
typedef struct bKinematicConstraint {
- /** All: target object in case constraint needs a target. */
- struct Object *tar;
- /** All: Maximum number of iterations to try. */
- short iterations;
- /** All & CopyPose: some options Like CONSTRAINT_IK_TIP. */
- short flag;
- /** All: index to rootbone, if zero go all the way to mother bone. */
- short rootbone;
- /** CopyPose: for auto-ik, maximum length of chain. */
- short max_rootbone;
- /** All: String to specify sub-object target, MAX_ID_NAME-2. */
- char subtarget[64];
- /** All: Pole vector target. */
- struct Object *poletar;
- /** All: Pole vector sub-object target, MAX_ID_NAME-2. */
- char polesubtarget[64];
- /** All: Pole vector rest angle. */
- float poleangle;
- /** All: Weight of constraint in IK tree. */
- float weight;
- /** CopyPose: Amount of rotation a target applies on chain. */
- float orientweight;
- /** CopyPose: for target-less IK. */
- float grabtarget[3];
- /** Subtype of IK constraint: eConstraint_IK_Type. */
- short type;
- /** Distance: how to limit in relation to clamping sphere: LIMITDIST_... */
- short mode;
- /** Distance: distance (radius of clamping sphere) from target. */
- float dist;
+ /** All: target object in case constraint needs a target. */
+ struct Object *tar;
+ /** All: Maximum number of iterations to try. */
+ short iterations;
+ /** All & CopyPose: some options Like CONSTRAINT_IK_TIP. */
+ short flag;
+ /** All: index to rootbone, if zero go all the way to mother bone. */
+ short rootbone;
+ /** CopyPose: for auto-ik, maximum length of chain. */
+ short max_rootbone;
+ /** All: String to specify sub-object target, MAX_ID_NAME-2. */
+ char subtarget[64];
+ /** All: Pole vector target. */
+ struct Object *poletar;
+ /** All: Pole vector sub-object target, MAX_ID_NAME-2. */
+ char polesubtarget[64];
+ /** All: Pole vector rest angle. */
+ float poleangle;
+ /** All: Weight of constraint in IK tree. */
+ float weight;
+ /** CopyPose: Amount of rotation a target applies on chain. */
+ float orientweight;
+ /** CopyPose: for target-less IK. */
+ float grabtarget[3];
+ /** Subtype of IK constraint: eConstraint_IK_Type. */
+ short type;
+ /** Distance: how to limit in relation to clamping sphere: LIMITDIST_... */
+ short mode;
+ /** Distance: distance (radius of clamping sphere) from target. */
+ float dist;
} bKinematicConstraint;
typedef enum eConstraint_IK_Type {
- /** 'standard' IK constraint: match position and/or orientation of target */
- CONSTRAINT_IK_COPYPOSE = 0,
- /** maintain distance with target */
- CONSTRAINT_IK_DISTANCE = 1,
+ /** 'standard' IK constraint: match position and/or orientation of target */
+ CONSTRAINT_IK_COPYPOSE = 0,
+ /** maintain distance with target */
+ CONSTRAINT_IK_DISTANCE = 1,
} eConstraint_IK_Type;
-
/* Spline IK Constraint
* Aligns 'n' bones to the curvature defined by the curve,
* with the chain ending on the bone that owns this constraint,
* and starting on the nth parent.
*/
typedef struct bSplineIKConstraint {
- /* target(s) */
- /** Curve object (with follow path enabled) which drives the bone chain. */
- struct Object *tar;
-
- /* binding details */
- /**
- * Array of numpoints items,
- * denoting parametric positions along curve that joints should follow.
- */
- float *points;
- /** Number of points to bound in points array. */
- short numpoints;
- /** Number of bones ('n') that are in the chain. */
- short chainlen;
-
- /* settings */
- /** General settings for constraint. */
- short flag;
- /** Method used for determining the x & z scaling of the bones. */
- short xzScaleMode;
- /** Method used for determining the y scaling of the bones. */
- short yScaleMode;
- short _pad[3];
-
- /* volume preservation settings */
- float bulge;
- float bulge_min;
- float bulge_max;
- float bulge_smooth;
+ /* target(s) */
+ /** Curve object (with follow path enabled) which drives the bone chain. */
+ struct Object *tar;
+
+ /* binding details */
+ /**
+ * Array of numpoints items,
+ * denoting parametric positions along curve that joints should follow.
+ */
+ float *points;
+ /** Number of points to bound in points array. */
+ short numpoints;
+ /** Number of bones ('n') that are in the chain. */
+ short chainlen;
+
+ /* settings */
+ /** General settings for constraint. */
+ short flag;
+ /** Method used for determining the x & z scaling of the bones. */
+ short xzScaleMode;
+ /** Method used for determining the y scaling of the bones. */
+ short yScaleMode;
+ short _pad[3];
+
+ /* volume preservation settings */
+ float bulge;
+ float bulge_min;
+ float bulge_max;
+ float bulge_smooth;
} bSplineIKConstraint;
/* Armature Constraint */
typedef struct bArmatureConstraint {
- /** General settings/state indicators accessed by bitmapping. */
- int flag;
- char _pad[4];
+ /** General settings/state indicators accessed by bitmapping. */
+ int flag;
+ char _pad[4];
- /** A list of targets that this constraint has (bConstraintTarget-s). */
- ListBase targets;
+ /** A list of targets that this constraint has (bConstraintTarget-s). */
+ ListBase targets;
} bArmatureConstraint;
/* Single-target subobject constraints --------------------- */
/* Track To Constraint */
typedef struct bTrackToConstraint {
- struct Object *tar;
- /**
- * I'll be using reserved1 and reserved2 as Track and Up flags,
- * not sure if that's what they were intended for anyway.
- * Not sure either if it would create backward incompatibility if I were to rename them.
- * - theeth
- */
- int reserved1;
- int reserved2;
- int flags;
- char _pad[4];
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ /**
+ * I'll be using reserved1 and reserved2 as Track and Up flags,
+ * not sure if that's what they were intended for anyway.
+ * Not sure either if it would create backward incompatibility if I were to rename them.
+ * - theeth
+ */
+ int reserved1;
+ int reserved2;
+ int flags;
+ char _pad[4];
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bTrackToConstraint;
/* Copy Rotation Constraint */
typedef struct bRotateLikeConstraint {
- struct Object *tar;
- int flag;
- int reserved1;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int flag;
+ int reserved1;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bRotateLikeConstraint;
/* Copy Location Constraint */
typedef struct bLocateLikeConstraint {
- struct Object *tar;
- int flag;
- int reserved1;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int flag;
+ int reserved1;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bLocateLikeConstraint;
/* Copy Scale Constraint */
typedef struct bSizeLikeConstraint {
- struct Object *tar;
- int flag;
- int reserved1;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int flag;
+ int reserved1;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bSizeLikeConstraint;
/* Maintain Volume Constraint */
typedef struct bSameVolumeConstraint {
- int flag;
- float volume;
+ int flag;
+ float volume;
} bSameVolumeConstraint;
/* Copy Transform Constraint */
typedef struct bTransLikeConstraint {
- struct Object *tar;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bTransLikeConstraint;
/* Floor Constraint */
typedef struct bMinMaxConstraint {
- struct Object *tar;
- int minmaxflag;
- float offset;
- int flag;
- /** For backward compatibility. */
- short sticky, stuck;
- char _pad[4];
- float cache[3];
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int minmaxflag;
+ float offset;
+ int flag;
+ /** For backward compatibility. */
+ short sticky, stuck;
+ char _pad[4];
+ float cache[3];
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bMinMaxConstraint;
/* Action Constraint */
typedef struct bActionConstraint {
- struct Object *tar;
- /** What transform 'channel' drives the result. */
- short type;
- /** Was used in versions prior to the Constraints recode. */
- short local;
- int start;
- int end;
- float min;
- float max;
- int flag;
- struct bAction *act;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ /** What transform 'channel' drives the result. */
+ short type;
+ /** Was used in versions prior to the Constraints recode. */
+ short local;
+ int start;
+ int end;
+ float min;
+ float max;
+ int flag;
+ struct bAction *act;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bActionConstraint;
/* Locked Axis Tracking constraint */
typedef struct bLockTrackConstraint {
- struct Object *tar;
- int trackflag;
- int lockflag;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int trackflag;
+ int lockflag;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bLockTrackConstraint;
/* Damped Tracking constraint */
typedef struct bDampTrackConstraint {
- struct Object *tar;
- int trackflag;
- char _pad[4];
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int trackflag;
+ char _pad[4];
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bDampTrackConstraint;
/* Follow Path constraints */
typedef struct bFollowPathConstraint {
- /** Must be path object. */
- struct Object *tar;
+ /** Must be path object. */
+ struct Object *tar;
- /** Offset in time on the path (in frames), when NOT using 'fixed position'. */
- float offset;
- /** Parametric offset factor defining position along path, when using 'fixed position'. */
- float offset_fac;
+ /** Offset in time on the path (in frames), when NOT using 'fixed position'. */
+ float offset;
+ /** Parametric offset factor defining position along path, when using 'fixed position'. */
+ float offset_fac;
- int followflag;
+ int followflag;
- short trackflag;
- short upflag;
+ short trackflag;
+ short upflag;
} bFollowPathConstraint;
/* Stretch to constraint */
typedef struct bStretchToConstraint {
- struct Object *tar;
- int flag;
- int volmode;
- int plane;
- float orglength;
- float bulge;
- float bulge_min;
- float bulge_max;
- float bulge_smooth;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
+ struct Object *tar;
+ int flag;
+ int volmode;
+ int plane;
+ float orglength;
+ float bulge;
+ float bulge_min;
+ float bulge_max;
+ float bulge_smooth;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
} bStretchToConstraint;
/* Rigid Body constraint */
typedef struct bRigidBodyJointConstraint {
- struct Object *tar;
- struct Object *child;
- int type;
- float pivX;
- float pivY;
- float pivZ;
- float axX;
- float axY;
- float axZ;
- float minLimit[6];
- float maxLimit[6];
- float extraFz;
- short flag;
- char _pad[6];
+ struct Object *tar;
+ struct Object *child;
+ int type;
+ float pivX;
+ float pivY;
+ float pivZ;
+ float axX;
+ float axY;
+ float axZ;
+ float minLimit[6];
+ float maxLimit[6];
+ float extraFz;
+ short flag;
+ char _pad[6];
} bRigidBodyJointConstraint;
/* Clamp-To Constraint */
typedef struct bClampToConstraint {
- /** 'target' must be a curve. */
- struct Object *tar;
- /** Which axis/plane to compare owner's location on . */
- int flag;
- /** For legacy reasons, this is flag2. used for any extra settings. */
- int flag2;
+ /** 'target' must be a curve. */
+ struct Object *tar;
+ /** Which axis/plane to compare owner's location on . */
+ int flag;
+ /** For legacy reasons, this is flag2. used for any extra settings. */
+ int flag2;
} bClampToConstraint;
/* Child Of Constraint */
typedef struct bChildOfConstraint {
- /** Object which will act as parent (or target comes from). */
- struct Object *tar;
- /** Settings. */
- int flag;
- char _pad[4];
- /** Parent-inverse matrix to use. */
- float invmat[4][4];
- /** String to specify a subobject target, MAX_ID_NAME-2. */
- char subtarget[64];
+ /** Object which will act as parent (or target comes from). */
+ struct Object *tar;
+ /** Settings. */
+ int flag;
+ char _pad[4];
+ /** Parent-inverse matrix to use. */
+ float invmat[4][4];
+ /** String to specify a subobject target, MAX_ID_NAME-2. */
+ char subtarget[64];
} bChildOfConstraint;
/* Generic Transform->Transform Constraint */
typedef struct bTransformConstraint {
- /** Target (i.e. 'driver' object/bone). */
- struct Object *tar;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
-
- /** Can be loc(0), rot(1) or size(2). */
- short from, to;
- /** Defines which target-axis deform is copied by each owner-axis. */
- char map[3];
- /** Extrapolate motion? if 0, confine to ranges. */
- char expo;
-
- /** From_min/max defines range of target transform. */
- float from_min[3];
- /** To map on to to_min/max range. */
- float from_max[3];
- /** Range of motion on owner caused by target . */
- float to_min[3];
- float to_max[3];
-
- /** From_min/max defines range of target transform. */
- float from_min_rot[3];
- /** To map on to to_min/max range. */
- float from_max_rot[3];
- /** Range of motion on owner caused by target . */
- float to_min_rot[3];
- float to_max_rot[3];
-
- /** From_min/max defines range of target transform. */
- float from_min_scale[3];
- /** To map on to to_min/max range. */
- float from_max_scale[3];
- /** Range of motion on owner caused by target . */
- float to_min_scale[3];
- float to_max_scale[3];
+ /** Target (i.e. 'driver' object/bone). */
+ struct Object *tar;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
+
+ /** Can be loc(0), rot(1) or size(2). */
+ short from, to;
+ /** Defines which target-axis deform is copied by each owner-axis. */
+ char map[3];
+ /** Extrapolate motion? if 0, confine to ranges. */
+ char expo;
+
+ /** From_min/max defines range of target transform. */
+ float from_min[3];
+ /** To map on to to_min/max range. */
+ float from_max[3];
+ /** Range of motion on owner caused by target . */
+ float to_min[3];
+ float to_max[3];
+
+ /** From_min/max defines range of target transform. */
+ float from_min_rot[3];
+ /** To map on to to_min/max range. */
+ float from_max_rot[3];
+ /** Range of motion on owner caused by target . */
+ float to_min_rot[3];
+ float to_max_rot[3];
+
+ /** From_min/max defines range of target transform. */
+ float from_min_scale[3];
+ /** To map on to to_min/max range. */
+ float from_max_scale[3];
+ /** Range of motion on owner caused by target . */
+ float to_min_scale[3];
+ float to_max_scale[3];
} bTransformConstraint;
/* Pivot Constraint */
typedef struct bPivotConstraint {
- /* Pivot Point:
- * Either target object + offset, or just offset is used
- */
- /** Target object (optional). */
- struct Object *tar;
- /** Subtarget name (optional), MAX_ID_NAME-2. */
- char subtarget[64];
- /** Offset from the target to use, regardless of whether it exists. */
- float offset[3];
-
- /* Rotation-driven activation:
- * This option provides easier one-stop setups for footrolls
- */
- /** Rotation axes to consider for this (#ePivotConstraint_Axis). */
- short rotAxis;
-
- /* General flags */
- /** #ePivotConstraint_Flag. */
- short flag;
+ /* Pivot Point:
+ * Either target object + offset, or just offset is used
+ */
+ /** Target object (optional). */
+ struct Object *tar;
+ /** Subtarget name (optional), MAX_ID_NAME-2. */
+ char subtarget[64];
+ /** Offset from the target to use, regardless of whether it exists. */
+ float offset[3];
+
+ /* Rotation-driven activation:
+ * This option provides easier one-stop setups for footrolls
+ */
+ /** Rotation axes to consider for this (#ePivotConstraint_Axis). */
+ short rotAxis;
+
+ /* General flags */
+ /** #ePivotConstraint_Flag. */
+ short flag;
} bPivotConstraint;
/* transform limiting constraints - zero target ---------------------------- */
/* Limit Location Constraint */
typedef struct bLocLimitConstraint {
- float xmin, xmax;
- float ymin, ymax;
- float zmin, zmax;
- short flag;
- short flag2;
+ float xmin, xmax;
+ float ymin, ymax;
+ float zmin, zmax;
+ short flag;
+ short flag2;
} bLocLimitConstraint;
/* Limit Rotation Constraint */
typedef struct bRotLimitConstraint {
- float xmin, xmax;
- float ymin, ymax;
- float zmin, zmax;
- short flag;
- short flag2;
+ float xmin, xmax;
+ float ymin, ymax;
+ float zmin, zmax;
+ short flag;
+ short flag2;
} bRotLimitConstraint;
/* Limit Scale Constraint */
typedef struct bSizeLimitConstraint {
- float xmin, xmax;
- float ymin, ymax;
- float zmin, zmax;
- short flag;
- short flag2;
+ float xmin, xmax;
+ float ymin, ymax;
+ float zmin, zmax;
+ short flag;
+ short flag2;
} bSizeLimitConstraint;
/* Limit Distance Constraint */
typedef struct bDistLimitConstraint {
- struct Object *tar;
- /** MAX_ID_NAME-2. */
- char subtarget[64];
-
- /** Distance (radius of clamping sphere) from target. */
- float dist;
- /** Distance from clamping-sphere to start applying 'fade'. */
- float soft;
-
- /** Settings. */
- short flag;
- /** How to limit in relation to clamping sphere. */
- short mode;
- char _pad[4];
+ struct Object *tar;
+ /** MAX_ID_NAME-2. */
+ char subtarget[64];
+
+ /** Distance (radius of clamping sphere) from target. */
+ float dist;
+ /** Distance from clamping-sphere to start applying 'fade'. */
+ float soft;
+
+ /** Settings. */
+ short flag;
+ /** How to limit in relation to clamping sphere. */
+ short mode;
+ char _pad[4];
} bDistLimitConstraint;
/* ShrinkWrap Constraint */
typedef struct bShrinkwrapConstraint {
- struct Object *target;
- /** Distance to kept from target. */
- float dist;
- /** Shrink type (look on MOD shrinkwrap for values). */
- short shrinkType;
- /** Axis to project/constrain. */
- char projAxis;
- /** Space to project axis in. */
- char projAxisSpace;
- /** Distance to search. */
- float projLimit;
- /** Inside/outside/on surface (see MOD shrinkwrap). */
- char shrinkMode;
- /** Options. */
- char flag;
- /** Axis to align to normal. */
- char trackAxis;
- char _pad;
+ struct Object *target;
+ /** Distance to kept from target. */
+ float dist;
+ /** Shrink type (look on MOD shrinkwrap for values). */
+ short shrinkType;
+ /** Axis to project/constrain. */
+ char projAxis;
+ /** Space to project axis in. */
+ char projAxisSpace;
+ /** Distance to search. */
+ float projLimit;
+ /** Inside/outside/on surface (see MOD shrinkwrap). */
+ char shrinkMode;
+ /** Options. */
+ char flag;
+ /** Axis to align to normal. */
+ char trackAxis;
+ char _pad;
} bShrinkwrapConstraint;
/* Follow Track constraints */
typedef struct bFollowTrackConstraint {
- struct MovieClip *clip;
- /** MAX_NAME. */
- char track[64];
- int flag;
- int frame_method;
- /** MAX_NAME. */
- char object[64];
- struct Object *camera;
- struct Object *depth_ob;
+ struct MovieClip *clip;
+ /** MAX_NAME. */
+ char track[64];
+ int flag;
+ int frame_method;
+ /** MAX_NAME. */
+ char object[64];
+ struct Object *camera;
+ struct Object *depth_ob;
} bFollowTrackConstraint;
/* Camera Solver constraints */
typedef struct bCameraSolverConstraint {
- struct MovieClip *clip;
- int flag;
- char _pad[4];
+ struct MovieClip *clip;
+ int flag;
+ char _pad[4];
} bCameraSolverConstraint;
/* Camera Solver constraints */
typedef struct bObjectSolverConstraint {
- struct MovieClip *clip;
- int flag;
- char _pad[4];
- /** MAX_NAME. */
- char object[64];
- /** Parent-inverse matrix to use. */
- float invmat[4][4];
- struct Object *camera;
+ struct MovieClip *clip;
+ int flag;
+ char _pad[4];
+ /** MAX_NAME. */
+ char object[64];
+ /** Parent-inverse matrix to use. */
+ float invmat[4][4];
+ struct Object *camera;
} bObjectSolverConstraint;
/* Transform matrix cache constraint */
typedef struct bTransformCacheConstraint {
- struct CacheFile *cache_file;
- struct CacheReader *reader;
- /** FILE_MAX. */
- char object_path[1024];
+ struct CacheFile *cache_file;
+ struct CacheReader *reader;
+ /** FILE_MAX. */
+ char object_path[1024];
} bTransformCacheConstraint;
/* ------------------------------------------ */
@@ -609,63 +605,63 @@ typedef struct bTransformCacheConstraint {
* broken as their correct value cannot be resolved
*/
typedef enum eBConstraint_Types {
- /** Invalid/legacy constraint */
- CONSTRAINT_TYPE_NULL = 0,
- /** Unimplemented non longer :) - during constraints recode, Aligorith */
- CONSTRAINT_TYPE_CHILDOF = 1,
- CONSTRAINT_TYPE_TRACKTO = 2,
- CONSTRAINT_TYPE_KINEMATIC = 3,
- CONSTRAINT_TYPE_FOLLOWPATH = 4,
- /** Unimplemented no longer :) - Aligorith */
- CONSTRAINT_TYPE_ROTLIMIT = 5,
- /** Unimplemented no longer :) - Aligorith */
- CONSTRAINT_TYPE_LOCLIMIT = 6,
- /** Unimplemented no longer :) - Aligorith */
- CONSTRAINT_TYPE_SIZELIMIT = 7,
- CONSTRAINT_TYPE_ROTLIKE = 8,
- CONSTRAINT_TYPE_LOCLIKE = 9,
- CONSTRAINT_TYPE_SIZELIKE = 10,
- /** Unimplemented no longer :) - Aligorith. Scripts */
- CONSTRAINT_TYPE_PYTHON = 11,
- CONSTRAINT_TYPE_ACTION = 12,
- /** New Tracking constraint that locks an axis in place - theeth */
- CONSTRAINT_TYPE_LOCKTRACK = 13,
- /** limit distance */
- CONSTRAINT_TYPE_DISTLIMIT = 14,
- /** claiming this to be mine :) is in tuhopuu bjornmose */
- CONSTRAINT_TYPE_STRETCHTO = 15,
- /** floor constraint */
- CONSTRAINT_TYPE_MINMAX = 16,
- /* CONSTRAINT_TYPE_DEPRECATED = 17 */
- /** clampto constraint */
- CONSTRAINT_TYPE_CLAMPTO = 18,
- /** transformation (loc/rot/size -> loc/rot/size) constraint */
- CONSTRAINT_TYPE_TRANSFORM = 19,
- /** shrinkwrap (loc/rot) constraint */
- CONSTRAINT_TYPE_SHRINKWRAP = 20,
- /** New Tracking constraint that minimizes twisting */
- CONSTRAINT_TYPE_DAMPTRACK = 21,
- /** Spline-IK - Align 'n' bones to a curve */
- CONSTRAINT_TYPE_SPLINEIK = 22,
- /** Copy transform matrix */
- CONSTRAINT_TYPE_TRANSLIKE = 23,
- /** Maintain volume during scaling */
- CONSTRAINT_TYPE_SAMEVOL = 24,
- /** Pivot Constraint */
- CONSTRAINT_TYPE_PIVOT = 25,
- /** Follow Track Constraint */
- CONSTRAINT_TYPE_FOLLOWTRACK = 26,
- /** Camera Solver Constraint */
- CONSTRAINT_TYPE_CAMERASOLVER = 27,
- /** Object Solver Constraint */
- CONSTRAINT_TYPE_OBJECTSOLVER = 28,
- /** Transform Cache Constraint */
- CONSTRAINT_TYPE_TRANSFORM_CACHE = 29,
- /** Armature Deform Constraint */
- CONSTRAINT_TYPE_ARMATURE = 30,
-
- /* NOTE: no constraints are allowed to be added after this */
- NUM_CONSTRAINT_TYPES,
+ /** Invalid/legacy constraint */
+ CONSTRAINT_TYPE_NULL = 0,
+ /** Unimplemented non longer :) - during constraints recode, Aligorith */
+ CONSTRAINT_TYPE_CHILDOF = 1,
+ CONSTRAINT_TYPE_TRACKTO = 2,
+ CONSTRAINT_TYPE_KINEMATIC = 3,
+ CONSTRAINT_TYPE_FOLLOWPATH = 4,
+ /** Unimplemented no longer :) - Aligorith */
+ CONSTRAINT_TYPE_ROTLIMIT = 5,
+ /** Unimplemented no longer :) - Aligorith */
+ CONSTRAINT_TYPE_LOCLIMIT = 6,
+ /** Unimplemented no longer :) - Aligorith */
+ CONSTRAINT_TYPE_SIZELIMIT = 7,
+ CONSTRAINT_TYPE_ROTLIKE = 8,
+ CONSTRAINT_TYPE_LOCLIKE = 9,
+ CONSTRAINT_TYPE_SIZELIKE = 10,
+ /** Unimplemented no longer :) - Aligorith. Scripts */
+ CONSTRAINT_TYPE_PYTHON = 11,
+ CONSTRAINT_TYPE_ACTION = 12,
+ /** New Tracking constraint that locks an axis in place - theeth */
+ CONSTRAINT_TYPE_LOCKTRACK = 13,
+ /** limit distance */
+ CONSTRAINT_TYPE_DISTLIMIT = 14,
+ /** claiming this to be mine :) is in tuhopuu bjornmose */
+ CONSTRAINT_TYPE_STRETCHTO = 15,
+ /** floor constraint */
+ CONSTRAINT_TYPE_MINMAX = 16,
+ /* CONSTRAINT_TYPE_DEPRECATED = 17 */
+ /** clampto constraint */
+ CONSTRAINT_TYPE_CLAMPTO = 18,
+ /** transformation (loc/rot/size -> loc/rot/size) constraint */
+ CONSTRAINT_TYPE_TRANSFORM = 19,
+ /** shrinkwrap (loc/rot) constraint */
+ CONSTRAINT_TYPE_SHRINKWRAP = 20,
+ /** New Tracking constraint that minimizes twisting */
+ CONSTRAINT_TYPE_DAMPTRACK = 21,
+ /** Spline-IK - Align 'n' bones to a curve */
+ CONSTRAINT_TYPE_SPLINEIK = 22,
+ /** Copy transform matrix */
+ CONSTRAINT_TYPE_TRANSLIKE = 23,
+ /** Maintain volume during scaling */
+ CONSTRAINT_TYPE_SAMEVOL = 24,
+ /** Pivot Constraint */
+ CONSTRAINT_TYPE_PIVOT = 25,
+ /** Follow Track Constraint */
+ CONSTRAINT_TYPE_FOLLOWTRACK = 26,
+ /** Camera Solver Constraint */
+ CONSTRAINT_TYPE_CAMERASOLVER = 27,
+ /** Object Solver Constraint */
+ CONSTRAINT_TYPE_OBJECTSOLVER = 28,
+ /** Transform Cache Constraint */
+ CONSTRAINT_TYPE_TRANSFORM_CACHE = 29,
+ /** Armature Deform Constraint */
+ CONSTRAINT_TYPE_ARMATURE = 30,
+
+ /* NOTE: no constraints are allowed to be added after this */
+ NUM_CONSTRAINT_TYPES,
} eBConstraint_Types;
/* bConstraint->flag */
@@ -673,391 +669,392 @@ typedef enum eBConstraint_Types {
/* flag 0x20 (1 << 5) was used to indicate that a constraint was evaluated
* using a 'local' hack for posebones only. */
typedef enum eBConstraint_Flags {
- /* expand for UI */
- CONSTRAINT_EXPAND = (1 << 0),
- /* pre-check for illegal object name or bone name */
- CONSTRAINT_DISABLE = (1 << 2),
- /* to indicate which Ipo should be shown, maybe for 3d access later too */
- CONSTRAINT_ACTIVE = (1 << 4),
- /* to indicate that the owner's space should only be changed into ownspace, but not out of it */
- CONSTRAINT_SPACEONCE = (1 << 6),
- /* influence ipo is on constraint itself, not in action channel */
- CONSTRAINT_OWN_IPO = (1 << 7),
- /* indicates that constraint was added locally (i.e. didn't come from the proxy-lib) */
- CONSTRAINT_PROXY_LOCAL = (1 << 8),
- /* indicates that constraint is temporarily disabled (only used in GE) */
- CONSTRAINT_OFF = (1 << 9),
- /* use bbone curve shape when calculating headtail values (also used by dependency graph!) */
- CONSTRAINT_BBONE_SHAPE = (1 << 10),
- /* That constraint has been inserted in local override (i.e. it can be fully edited!). */
- CONSTRAINT_STATICOVERRIDE_LOCAL = (1 << 11),
- /* use full transformation (not just segment locations) - only set at runtime */
- CONSTRAINT_BBONE_SHAPE_FULL = (1 << 12),
+ /* expand for UI */
+ CONSTRAINT_EXPAND = (1 << 0),
+ /* pre-check for illegal object name or bone name */
+ CONSTRAINT_DISABLE = (1 << 2),
+ /* to indicate which Ipo should be shown, maybe for 3d access later too */
+ CONSTRAINT_ACTIVE = (1 << 4),
+ /* to indicate that the owner's space should only be changed into ownspace, but not out of it */
+ CONSTRAINT_SPACEONCE = (1 << 6),
+ /* influence ipo is on constraint itself, not in action channel */
+ CONSTRAINT_OWN_IPO = (1 << 7),
+ /* indicates that constraint was added locally (i.e. didn't come from the proxy-lib) */
+ CONSTRAINT_PROXY_LOCAL = (1 << 8),
+ /* indicates that constraint is temporarily disabled (only used in GE) */
+ CONSTRAINT_OFF = (1 << 9),
+ /* use bbone curve shape when calculating headtail values (also used by dependency graph!) */
+ CONSTRAINT_BBONE_SHAPE = (1 << 10),
+ /* That constraint has been inserted in local override (i.e. it can be fully edited!). */
+ CONSTRAINT_STATICOVERRIDE_LOCAL = (1 << 11),
+ /* use full transformation (not just segment locations) - only set at runtime */
+ CONSTRAINT_BBONE_SHAPE_FULL = (1 << 12),
} eBConstraint_Flags;
/* bConstraint->ownspace/tarspace */
typedef enum eBConstraint_SpaceTypes {
- /** Default for all - worldspace. */
- CONSTRAINT_SPACE_WORLD = 0,
- /** For objects (relative to parent/without parent influence),
- * for bones (along normals of bone, without parent/restpositions). */
- CONSTRAINT_SPACE_LOCAL = 1,
- /** For posechannels - pose space. */
- CONSTRAINT_SPACE_POSE = 2,
- /** For posechannels - local with parent. */
- CONSTRAINT_SPACE_PARLOCAL = 3,
- /** For files from between 2.43-2.46 (should have been parlocal). */
- CONSTRAINT_SPACE_INVALID = 4, /* do not exchange for anything! */
+ /** Default for all - worldspace. */
+ CONSTRAINT_SPACE_WORLD = 0,
+ /** For objects (relative to parent/without parent influence),
+ * for bones (along normals of bone, without parent/restpositions). */
+ CONSTRAINT_SPACE_LOCAL = 1,
+ /** For posechannels - pose space. */
+ CONSTRAINT_SPACE_POSE = 2,
+ /** For posechannels - local with parent. */
+ CONSTRAINT_SPACE_PARLOCAL = 3,
+ /** For files from between 2.43-2.46 (should have been parlocal). */
+ CONSTRAINT_SPACE_INVALID = 4, /* do not exchange for anything! */
} eBConstraint_SpaceTypes;
/* bConstraintChannel.flag */
// XXX deprecated... old AnimSys
typedef enum eConstraintChannel_Flags {
- CONSTRAINT_CHANNEL_SELECT = (1 << 0),
- CONSTRAINT_CHANNEL_PROTECTED = (1 << 1),
+ CONSTRAINT_CHANNEL_SELECT = (1 << 0),
+ CONSTRAINT_CHANNEL_PROTECTED = (1 << 1),
} eConstraintChannel_Flags;
/* -------------------------------------- */
/* bRotateLikeConstraint.flag */
typedef enum eCopyRotation_Flags {
- ROTLIKE_X = (1 << 0),
- ROTLIKE_Y = (1 << 1),
- ROTLIKE_Z = (1 << 2),
- ROTLIKE_X_INVERT = (1 << 4),
- ROTLIKE_Y_INVERT = (1 << 5),
- ROTLIKE_Z_INVERT = (1 << 6),
- ROTLIKE_OFFSET = (1 << 7),
+ ROTLIKE_X = (1 << 0),
+ ROTLIKE_Y = (1 << 1),
+ ROTLIKE_Z = (1 << 2),
+ ROTLIKE_X_INVERT = (1 << 4),
+ ROTLIKE_Y_INVERT = (1 << 5),
+ ROTLIKE_Z_INVERT = (1 << 6),
+ ROTLIKE_OFFSET = (1 << 7),
} eCopyRotation_Flags;
/* bLocateLikeConstraint.flag */
typedef enum eCopyLocation_Flags {
- LOCLIKE_X = (1 << 0),
- LOCLIKE_Y = (1 << 1),
- LOCLIKE_Z = (1 << 2),
- /** LOCLIKE_TIP is a deprecated option... use headtail=1.0f instead */
- LOCLIKE_TIP = (1 << 3),
- LOCLIKE_X_INVERT = (1 << 4),
- LOCLIKE_Y_INVERT = (1 << 5),
- LOCLIKE_Z_INVERT = (1 << 6),
- LOCLIKE_OFFSET = (1 << 7),
+ LOCLIKE_X = (1 << 0),
+ LOCLIKE_Y = (1 << 1),
+ LOCLIKE_Z = (1 << 2),
+ /** LOCLIKE_TIP is a deprecated option... use headtail=1.0f instead */
+ LOCLIKE_TIP = (1 << 3),
+ LOCLIKE_X_INVERT = (1 << 4),
+ LOCLIKE_Y_INVERT = (1 << 5),
+ LOCLIKE_Z_INVERT = (1 << 6),
+ LOCLIKE_OFFSET = (1 << 7),
} eCopyLocation_Flags;
/* bSizeLikeConstraint.flag */
typedef enum eCopyScale_Flags {
- SIZELIKE_X = (1 << 0),
- SIZELIKE_Y = (1 << 1),
- SIZELIKE_Z = (1 << 2),
- SIZELIKE_OFFSET = (1 << 3),
- SIZELIKE_MULTIPLY = (1 << 4),
+ SIZELIKE_X = (1 << 0),
+ SIZELIKE_Y = (1 << 1),
+ SIZELIKE_Z = (1 << 2),
+ SIZELIKE_OFFSET = (1 << 3),
+ SIZELIKE_MULTIPLY = (1 << 4),
} eCopyScale_Flags;
/* bTransformConstraint.to/from */
typedef enum eTransform_ToFrom {
- TRANS_LOCATION = 0,
- TRANS_ROTATION = 1,
- TRANS_SCALE = 2,
+ TRANS_LOCATION = 0,
+ TRANS_ROTATION = 1,
+ TRANS_SCALE = 2,
} eTransform_ToFrom;
/* bSameVolumeConstraint.flag */
typedef enum eSameVolume_Modes {
- SAMEVOL_X = 0,
- SAMEVOL_Y = 1,
- SAMEVOL_Z = 2,
+ SAMEVOL_X = 0,
+ SAMEVOL_Y = 1,
+ SAMEVOL_Z = 2,
} eSameVolume_Modes;
/* bActionConstraint.flag */
typedef enum eActionConstraint_Flags {
- /* Bones use "object" part of target action, instead of "same bone name" part */
- ACTCON_BONE_USE_OBJECT_ACTION = (1 << 0),
+ /* Bones use "object" part of target action, instead of "same bone name" part */
+ ACTCON_BONE_USE_OBJECT_ACTION = (1 << 0),
} eActionConstraint_Flags;
/* Locked-Axis Values (Locked Track) */
typedef enum eLockAxis_Modes {
- LOCK_X = 0,
- LOCK_Y = 1,
- LOCK_Z = 2,
+ LOCK_X = 0,
+ LOCK_Y = 1,
+ LOCK_Z = 2,
} eLockAxis_Modes;
/* Up-Axis Values (TrackTo and Locked Track) */
typedef enum eUpAxis_Modes {
- UP_X = 0,
- UP_Y = 1,
- UP_Z = 2,
+ UP_X = 0,
+ UP_Y = 1,
+ UP_Z = 2,
} eUpAxis_Modes;
/* Tracking axis (TrackTo, Locked Track, Damped Track) and minmax (floor) constraint */
typedef enum eTrackToAxis_Modes {
- TRACK_X = 0,
- TRACK_Y = 1,
- TRACK_Z = 2,
- TRACK_nX = 3,
- TRACK_nY = 4,
- TRACK_nZ = 5,
+ TRACK_X = 0,
+ TRACK_Y = 1,
+ TRACK_Z = 2,
+ TRACK_nX = 3,
+ TRACK_nY = 4,
+ TRACK_nZ = 5,
} eTrackToAxis_Modes;
/* Shrinkwrap flags */
typedef enum eShrinkwrap_Flags {
- /* Also raycast in the opposite direction. */
- CON_SHRINKWRAP_PROJECT_OPPOSITE = (1 << 0),
- /* Invert the cull mode when projecting opposite. */
- CON_SHRINKWRAP_PROJECT_INVERT_CULL = (1 << 1),
- /* Align the specified axis to the target normal. */
- CON_SHRINKWRAP_TRACK_NORMAL = (1 << 2),
-
- /* Ignore front faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE */
- CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE = (1 << 3),
- /* Ignore back faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_BACKFACE */
- CON_SHRINKWRAP_PROJECT_CULL_BACKFACE = (1 << 4),
+ /* Also raycast in the opposite direction. */
+ CON_SHRINKWRAP_PROJECT_OPPOSITE = (1 << 0),
+ /* Invert the cull mode when projecting opposite. */
+ CON_SHRINKWRAP_PROJECT_INVERT_CULL = (1 << 1),
+ /* Align the specified axis to the target normal. */
+ CON_SHRINKWRAP_TRACK_NORMAL = (1 << 2),
+
+ /* Ignore front faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE */
+ CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE = (1 << 3),
+ /* Ignore back faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_BACKFACE */
+ CON_SHRINKWRAP_PROJECT_CULL_BACKFACE = (1 << 4),
} eShrinkwrap_Flags;
-#define CON_SHRINKWRAP_PROJECT_CULL_MASK (CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE | CON_SHRINKWRAP_PROJECT_CULL_BACKFACE)
+#define CON_SHRINKWRAP_PROJECT_CULL_MASK \
+ (CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE | CON_SHRINKWRAP_PROJECT_CULL_BACKFACE)
/* FollowPath flags */
typedef enum eFollowPath_Flags {
- FOLLOWPATH_FOLLOW = (1 << 0),
- FOLLOWPATH_STATIC = (1 << 1),
- FOLLOWPATH_RADIUS = (1 << 2),
+ FOLLOWPATH_FOLLOW = (1 << 0),
+ FOLLOWPATH_STATIC = (1 << 1),
+ FOLLOWPATH_RADIUS = (1 << 2),
} eFollowPath_Flags;
/* bTrackToConstraint->flags */
typedef enum eTrackTo_Flags {
- TARGET_Z_UP = (1 << 0),
+ TARGET_Z_UP = (1 << 0),
} eTrackTo_Flags;
/* Stretch To Constraint -> volmode */
typedef enum eStretchTo_VolMode {
- VOLUME_XZ = 0,
- VOLUME_X = 1,
- VOLUME_Z = 2,
- NO_VOLUME = 3,
+ VOLUME_XZ = 0,
+ VOLUME_X = 1,
+ VOLUME_Z = 2,
+ NO_VOLUME = 3,
} eStretchTo_VolMode;
/* Stretch To Constraint -> plane mode */
typedef enum eStretchTo_PlaneMode {
- PLANE_X = 0,
- PLANE_Y = 1,
- PLANE_Z = 2,
+ PLANE_X = 0,
+ PLANE_Y = 1,
+ PLANE_Z = 2,
} eStretchTo_PlaneMode;
/* Clamp-To Constraint ->flag */
typedef enum eClampTo_Modes {
- CLAMPTO_AUTO = 0,
- CLAMPTO_X = 1,
- CLAMPTO_Y = 2,
- CLAMPTO_Z = 3,
+ CLAMPTO_AUTO = 0,
+ CLAMPTO_X = 1,
+ CLAMPTO_Y = 2,
+ CLAMPTO_Z = 3,
} eClampTo_Modes;
/* ClampTo Constraint ->flag2 */
typedef enum eClampTo_Flags {
- CLAMPTO_CYCLIC = (1 << 0),
+ CLAMPTO_CYCLIC = (1 << 0),
} eClampTo_Flags;
/* bKinematicConstraint->flag */
typedef enum eKinematic_Flags {
- CONSTRAINT_IK_TIP = (1 << 0),
- CONSTRAINT_IK_ROT = (1 << 1),
- /* targetless */
- CONSTRAINT_IK_AUTO = (1 << 2),
- /* autoik */
- CONSTRAINT_IK_TEMP = (1 << 3),
- CONSTRAINT_IK_STRETCH = (1 << 4),
- CONSTRAINT_IK_POS = (1 << 5),
- CONSTRAINT_IK_SETANGLE = (1 << 6),
- CONSTRAINT_IK_GETANGLE = (1 << 7),
- /* limit axis */
- CONSTRAINT_IK_NO_POS_X = (1 << 8),
- CONSTRAINT_IK_NO_POS_Y = (1 << 9),
- CONSTRAINT_IK_NO_POS_Z = (1 << 10),
- CONSTRAINT_IK_NO_ROT_X = (1 << 11),
- CONSTRAINT_IK_NO_ROT_Y = (1 << 12),
- CONSTRAINT_IK_NO_ROT_Z = (1 << 13),
- /* axis relative to target */
- CONSTRAINT_IK_TARGETAXIS = (1 << 14),
+ CONSTRAINT_IK_TIP = (1 << 0),
+ CONSTRAINT_IK_ROT = (1 << 1),
+ /* targetless */
+ CONSTRAINT_IK_AUTO = (1 << 2),
+ /* autoik */
+ CONSTRAINT_IK_TEMP = (1 << 3),
+ CONSTRAINT_IK_STRETCH = (1 << 4),
+ CONSTRAINT_IK_POS = (1 << 5),
+ CONSTRAINT_IK_SETANGLE = (1 << 6),
+ CONSTRAINT_IK_GETANGLE = (1 << 7),
+ /* limit axis */
+ CONSTRAINT_IK_NO_POS_X = (1 << 8),
+ CONSTRAINT_IK_NO_POS_Y = (1 << 9),
+ CONSTRAINT_IK_NO_POS_Z = (1 << 10),
+ CONSTRAINT_IK_NO_ROT_X = (1 << 11),
+ CONSTRAINT_IK_NO_ROT_Y = (1 << 12),
+ CONSTRAINT_IK_NO_ROT_Z = (1 << 13),
+ /* axis relative to target */
+ CONSTRAINT_IK_TARGETAXIS = (1 << 14),
} eKinematic_Flags;
/* bSplineIKConstraint->flag */
typedef enum eSplineIK_Flags {
- /* chain has been attached to spline */
- CONSTRAINT_SPLINEIK_BOUND = (1 << 0),
- /* root of chain is not influenced by the constraint */
- CONSTRAINT_SPLINEIK_NO_ROOT = (1 << 1),
+ /* chain has been attached to spline */
+ CONSTRAINT_SPLINEIK_BOUND = (1 << 0),
+ /* root of chain is not influenced by the constraint */
+ CONSTRAINT_SPLINEIK_NO_ROOT = (1 << 1),
#ifdef DNA_DEPRECATED
- /* bones in the chain should not scale to fit the curve */
- CONSTRAINT_SPLINEIK_SCALE_LIMITED = (1 << 2),
+ /* bones in the chain should not scale to fit the curve */
+ CONSTRAINT_SPLINEIK_SCALE_LIMITED = (1 << 2),
#endif
- /* evenly distribute the bones along the path regardless of length */
- CONSTRAINT_SPLINEIK_EVENSPLITS = (1 << 3),
- /* don't adjust the x and z scaling of the bones by the curve radius */
- CONSTRAINT_SPLINEIK_NO_CURVERAD = (1 << 4),
-
- /* for "volumetric" xz scale mode, limit the minimum or maximum scale values */
- CONSTRAINT_SPLINEIK_USE_BULGE_MIN = (1 << 5),
- CONSTRAINT_SPLINEIK_USE_BULGE_MAX = (1 << 6),
+ /* evenly distribute the bones along the path regardless of length */
+ CONSTRAINT_SPLINEIK_EVENSPLITS = (1 << 3),
+ /* don't adjust the x and z scaling of the bones by the curve radius */
+ CONSTRAINT_SPLINEIK_NO_CURVERAD = (1 << 4),
+
+ /* for "volumetric" xz scale mode, limit the minimum or maximum scale values */
+ CONSTRAINT_SPLINEIK_USE_BULGE_MIN = (1 << 5),
+ CONSTRAINT_SPLINEIK_USE_BULGE_MAX = (1 << 6),
} eSplineIK_Flags;
/* bSplineIKConstraint->xzScaleMode */
typedef enum eSplineIK_XZScaleModes {
- /* no x/z scaling */
- CONSTRAINT_SPLINEIK_XZS_NONE = 0,
- /* bones in the chain should take their x/z scales from the original scaling */
- CONSTRAINT_SPLINEIK_XZS_ORIGINAL = 1,
- /* x/z scales are the inverse of the y-scale */
- CONSTRAINT_SPLINEIK_XZS_INVERSE = 2,
- /* x/z scales are computed using a volume preserving technique (from Stretch To constraint) */
- CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC = 3,
+ /* no x/z scaling */
+ CONSTRAINT_SPLINEIK_XZS_NONE = 0,
+ /* bones in the chain should take their x/z scales from the original scaling */
+ CONSTRAINT_SPLINEIK_XZS_ORIGINAL = 1,
+ /* x/z scales are the inverse of the y-scale */
+ CONSTRAINT_SPLINEIK_XZS_INVERSE = 2,
+ /* x/z scales are computed using a volume preserving technique (from Stretch To constraint) */
+ CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC = 3,
} eSplineIK_XZScaleModes;
/* bSplineIKConstraint->yScaleMode */
typedef enum eSplineIK_YScaleModes {
- /* no y scaling */
- CONSTRAINT_SPLINEIK_YS_NONE = 0,
- /* bones in the chain should be scaled to fit the length of the curve */
- CONSTRAINT_SPLINEIK_YS_FIT_CURVE = 1,
- /* bones in the chain should take their y scales from the original scaling */
- CONSTRAINT_SPLINEIK_YS_ORIGINAL = 2,
+ /* no y scaling */
+ CONSTRAINT_SPLINEIK_YS_NONE = 0,
+ /* bones in the chain should be scaled to fit the length of the curve */
+ CONSTRAINT_SPLINEIK_YS_FIT_CURVE = 1,
+ /* bones in the chain should take their y scales from the original scaling */
+ CONSTRAINT_SPLINEIK_YS_ORIGINAL = 2,
} eSplineIK_YScaleModes;
/* bArmatureConstraint -> flag */
typedef enum eArmature_Flags {
- /** use dual quaternion blending */
- CONSTRAINT_ARMATURE_QUATERNION = (1 << 0),
- /** use envelopes */
- CONSTRAINT_ARMATURE_ENVELOPE = (1 << 1),
- /** use current bone location */
- CONSTRAINT_ARMATURE_CUR_LOCATION = (1 << 2),
+ /** use dual quaternion blending */
+ CONSTRAINT_ARMATURE_QUATERNION = (1 << 0),
+ /** use envelopes */
+ CONSTRAINT_ARMATURE_ENVELOPE = (1 << 1),
+ /** use current bone location */
+ CONSTRAINT_ARMATURE_CUR_LOCATION = (1 << 2),
} eArmature_Flags;
/* MinMax (floor) flags */
typedef enum eFloor_Flags {
- MINMAX_STICKY = (1 << 0),
- MINMAX_STUCK = (1 << 1),
- MINMAX_USEROT = (1 << 2),
+ MINMAX_STICKY = (1 << 0),
+ MINMAX_STUCK = (1 << 1),
+ MINMAX_USEROT = (1 << 2),
} eFloor_Flags;
/* transform limiting constraints -> flag2 */
typedef enum eTransformLimits_Flags2 {
- /* not used anymore - for older Limit Location constraints only */
- LIMIT_NOPARENT = (1 << 0),
- /* for all Limit constraints - allow to be used during transform? */
- LIMIT_TRANSFORM = (1 << 1),
+ /* not used anymore - for older Limit Location constraints only */
+ LIMIT_NOPARENT = (1 << 0),
+ /* for all Limit constraints - allow to be used during transform? */
+ LIMIT_TRANSFORM = (1 << 1),
} eTransformLimits_Flags2;
/* transform limiting constraints -> flag (own flags) */
typedef enum eTransformLimits_Flags {
- LIMIT_XMIN = (1 << 0),
- LIMIT_XMAX = (1 << 1),
- LIMIT_YMIN = (1 << 2),
- LIMIT_YMAX = (1 << 3),
- LIMIT_ZMIN = (1 << 4),
- LIMIT_ZMAX = (1 << 5),
+ LIMIT_XMIN = (1 << 0),
+ LIMIT_XMAX = (1 << 1),
+ LIMIT_YMIN = (1 << 2),
+ LIMIT_YMAX = (1 << 3),
+ LIMIT_ZMIN = (1 << 4),
+ LIMIT_ZMAX = (1 << 5),
} eTransformLimits_Flags;
/* limit rotation constraint -> flag (own flags) */
typedef enum eRotLimit_Flags {
- LIMIT_XROT = (1 << 0),
- LIMIT_YROT = (1 << 1),
- LIMIT_ZROT = (1 << 2),
+ LIMIT_XROT = (1 << 0),
+ LIMIT_YROT = (1 << 1),
+ LIMIT_ZROT = (1 << 2),
} eRotLimit_Flags;
/* distance limit constraint */
- /* bDistLimitConstraint->flag */
+/* bDistLimitConstraint->flag */
typedef enum eDistLimit_Flag {
- /* "soft" cushion effect when reaching the limit sphere */ // NOT IMPLEMENTED!
- LIMITDIST_USESOFT = (1 << 0),
- /* as for all Limit constraints - allow to be used during transform? */
- LIMITDIST_TRANSFORM = (1 << 1),
+ /* "soft" cushion effect when reaching the limit sphere */ // NOT IMPLEMENTED!
+ LIMITDIST_USESOFT = (1 << 0),
+ /* as for all Limit constraints - allow to be used during transform? */
+ LIMITDIST_TRANSFORM = (1 << 1),
} eDistLimit_Flag;
- /* bDistLimitConstraint->mode */
+/* bDistLimitConstraint->mode */
typedef enum eDistLimit_Modes {
- LIMITDIST_INSIDE = 0,
- LIMITDIST_OUTSIDE = 1,
- LIMITDIST_ONSURFACE = 2,
+ LIMITDIST_INSIDE = 0,
+ LIMITDIST_OUTSIDE = 1,
+ LIMITDIST_ONSURFACE = 2,
} eDistLimit_Modes;
/* python constraint -> flag */
typedef enum ePyConstraint_Flags {
- PYCON_USETARGETS = (1 << 0),
- PYCON_SCRIPTERROR = (1 << 1),
+ PYCON_USETARGETS = (1 << 0),
+ PYCON_SCRIPTERROR = (1 << 1),
} ePyConstraint_Flags;
/* ChildOf Constraint -> flag */
typedef enum eChildOf_Flags {
- CHILDOF_LOCX = (1 << 0),
- CHILDOF_LOCY = (1 << 1),
- CHILDOF_LOCZ = (1 << 2),
- CHILDOF_ROTX = (1 << 3),
- CHILDOF_ROTY = (1 << 4),
- CHILDOF_ROTZ = (1 << 5),
- CHILDOF_SIZEX = (1 << 6),
- CHILDOF_SIZEY = (1 << 7),
- CHILDOF_SIZEZ = (1 << 8),
- CHILDOF_ALL = 511,
+ CHILDOF_LOCX = (1 << 0),
+ CHILDOF_LOCY = (1 << 1),
+ CHILDOF_LOCZ = (1 << 2),
+ CHILDOF_ROTX = (1 << 3),
+ CHILDOF_ROTY = (1 << 4),
+ CHILDOF_ROTZ = (1 << 5),
+ CHILDOF_SIZEX = (1 << 6),
+ CHILDOF_SIZEY = (1 << 7),
+ CHILDOF_SIZEZ = (1 << 8),
+ CHILDOF_ALL = 511,
} eChildOf_Flags;
/* Pivot Constraint */
- /* Restrictions for Pivot Constraint axis to consider for enabling constraint */
+/* Restrictions for Pivot Constraint axis to consider for enabling constraint */
typedef enum ePivotConstraint_Axis {
- /* do not consider this activity-clamping */
- PIVOTCON_AXIS_NONE = -1,
-
- /* consider -ve x-axis rotations */
- PIVOTCON_AXIS_X_NEG = 0,
- /* consider -ve y-axis rotations */
- PIVOTCON_AXIS_Y_NEG = 1,
- /* consider -ve z-axis rotations */
- PIVOTCON_AXIS_Z_NEG = 2,
-
- /* consider +ve x-axis rotations */
- PIVOTCON_AXIS_X = 3,
- /* consider +ve y-axis rotations */
- PIVOTCON_AXIS_Y = 4,
- /* consider +ve z-axis rotations */
- PIVOTCON_AXIS_Z = 5,
+ /* do not consider this activity-clamping */
+ PIVOTCON_AXIS_NONE = -1,
+
+ /* consider -ve x-axis rotations */
+ PIVOTCON_AXIS_X_NEG = 0,
+ /* consider -ve y-axis rotations */
+ PIVOTCON_AXIS_Y_NEG = 1,
+ /* consider -ve z-axis rotations */
+ PIVOTCON_AXIS_Z_NEG = 2,
+
+ /* consider +ve x-axis rotations */
+ PIVOTCON_AXIS_X = 3,
+ /* consider +ve y-axis rotations */
+ PIVOTCON_AXIS_Y = 4,
+ /* consider +ve z-axis rotations */
+ PIVOTCON_AXIS_Z = 5,
} ePivotConstraint_Axis;
- /* settings for Pivot Constraint in general */
+/* settings for Pivot Constraint in general */
typedef enum ePivotConstraint_Flag {
- /* offset is to be interpreted as being a fixed-point in space */
- PIVOTCON_FLAG_OFFSET_ABS = (1 << 0),
- /* rotation-based activation uses negative rotation to drive result */
- PIVOTCON_FLAG_ROTACT_NEG = (1 << 1),
+ /* offset is to be interpreted as being a fixed-point in space */
+ PIVOTCON_FLAG_OFFSET_ABS = (1 << 0),
+ /* rotation-based activation uses negative rotation to drive result */
+ PIVOTCON_FLAG_ROTACT_NEG = (1 << 1),
} ePivotConstraint_Flag;
typedef enum eFollowTrack_Flags {
- FOLLOWTRACK_ACTIVECLIP = (1 << 0),
- FOLLOWTRACK_USE_3D_POSITION = (1 << 1),
- FOLLOWTRACK_USE_UNDISTORTION = (1 << 2),
+ FOLLOWTRACK_ACTIVECLIP = (1 << 0),
+ FOLLOWTRACK_USE_3D_POSITION = (1 << 1),
+ FOLLOWTRACK_USE_UNDISTORTION = (1 << 2),
} eFollowTrack_Flags;
typedef enum eFollowTrack_FrameMethod {
- FOLLOWTRACK_FRAME_STRETCH = 0,
- FOLLOWTRACK_FRAME_FIT = 1,
- FOLLOWTRACK_FRAME_CROP = 2,
+ FOLLOWTRACK_FRAME_STRETCH = 0,
+ FOLLOWTRACK_FRAME_FIT = 1,
+ FOLLOWTRACK_FRAME_CROP = 2,
} eFollowTrack_FrameMethod;
/* CameraSolver Constraint -> flag */
typedef enum eCameraSolver_Flags {
- CAMERASOLVER_ACTIVECLIP = (1 << 0),
+ CAMERASOLVER_ACTIVECLIP = (1 << 0),
} eCameraSolver_Flags;
/* ObjectSolver Constraint -> flag */
typedef enum eObjectSolver_Flags {
- OBJECTSOLVER_ACTIVECLIP = (1 << 0),
+ OBJECTSOLVER_ACTIVECLIP = (1 << 0),
} eObjectSolver_Flags;
/* ObjectSolver Constraint -> flag */
typedef enum eStretchTo_Flags {
- STRETCHTOCON_USE_BULGE_MIN = (1 << 0),
- STRETCHTOCON_USE_BULGE_MAX = (1 << 1),
+ STRETCHTOCON_USE_BULGE_MIN = (1 << 0),
+ STRETCHTOCON_USE_BULGE_MAX = (1 << 1),
} eStretchTo_Flags;
/* important: these defines need to match up with PHY_DynamicTypes headerfile */
-#define CONSTRAINT_RB_BALL 1
-#define CONSTRAINT_RB_HINGE 2
+#define CONSTRAINT_RB_BALL 1
+#define CONSTRAINT_RB_HINGE 2
#define CONSTRAINT_RB_CONETWIST 4
-#define CONSTRAINT_RB_VEHICLE 11
+#define CONSTRAINT_RB_VEHICLE 11
#define CONSTRAINT_RB_GENERIC6DOF 12
#endif
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 1ee81b56636..3c63f909efd 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -29,7 +29,7 @@
#include "DNA_vec_types.h"
#include "DNA_ID.h"
-#define MAXTEXTBOX 256 /* used in readfile.c and editfont.c */
+#define MAXTEXTBOX 256 /* used in readfile.c and editfont.c */
struct AnimData;
struct BoundBox;
@@ -45,44 +45,44 @@ struct VFont;
#
#
typedef struct PathPoint {
- /** Grr, cant get rid of tilt yet. */
- float vec[4];
- float quat[4];
- float radius, weight;
+ /** Grr, cant get rid of tilt yet. */
+ float vec[4];
+ float quat[4];
+ float radius, weight;
} PathPoint;
/* These two Lines with # tell makesdna this struct can be excluded. */
#
#
typedef struct Path {
- struct PathPoint *data;
- int len;
- float totdist;
+ struct PathPoint *data;
+ int len;
+ float totdist;
} Path;
/* These two Lines with # tell makesdna this struct can be excluded. */
#
#
typedef struct BevPoint {
- float vec[3], tilt, radius, weight, offset;
- /** 2D Only. */
- float sina, cosa;
- /** 3D Only. */
- float dir[3], tan[3], quat[4];
- short split_tag, dupe_tag;
+ float vec[3], tilt, radius, weight, offset;
+ /** 2D Only. */
+ float sina, cosa;
+ /** 3D Only. */
+ float dir[3], tan[3], quat[4];
+ short split_tag, dupe_tag;
} BevPoint;
/* These two Lines with # tell makesdna this struct can be excluded. */
#
#
typedef struct BevList {
- struct BevList *next, *prev;
- int nr, dupe_nr;
- int poly, hole;
- int charidx;
- int *segbevcount;
- float *seglen;
- BevPoint *bevpoints;
+ struct BevList *next, *prev;
+ int nr, dupe_nr;
+ int poly, hole;
+ int charidx;
+ int *segbevcount;
+ float *seglen;
+ BevPoint *bevpoints;
} BevList;
/**
@@ -103,52 +103,52 @@ typedef struct BevList {
* - vec[2][2] = z location of handle 2 (not used for FCurve Points(2d))
*/
typedef 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. */
- char ipo;
-
- /** H1, h2: the handle type of the two handles. */
- char h1, h2;
- /** F1, f2, f3: used for selection status. */
- char f1, f2, f3;
-
- /** Hide: used to indicate whether BezTriple is hidden (3D),
- * type of keyframe (eBezTriple_KeyframeType). */
- char hide;
-
- /** Easing: easing type for interpolation mode (eBezTriple_Easing). */
- char easing;
- /** BEZT_IPO_BACK. */
- float back;
- /** BEZT_IPO_ELASTIC. */
- float amplitude, period;
-
- /** F5: used for auto handle to distinguish between normal handle and exception (extrema). */
- char f5;
- char _pad[3];
+ 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. */
+ char ipo;
+
+ /** H1, h2: the handle type of the two handles. */
+ char h1, h2;
+ /** F1, f2, f3: used for selection status. */
+ char f1, f2, f3;
+
+ /** Hide: used to indicate whether BezTriple is hidden (3D),
+ * type of keyframe (eBezTriple_KeyframeType). */
+ char hide;
+
+ /** Easing: easing type for interpolation mode (eBezTriple_Easing). */
+ char easing;
+ /** BEZT_IPO_BACK. */
+ float back;
+ /** BEZT_IPO_ELASTIC. */
+ float amplitude, period;
+
+ /** F5: used for auto handle to distinguish between normal handle and exception (extrema). */
+ char f5;
+ char _pad[3];
} BezTriple;
/**
* \note #BPoint.tilt location in struct is abused by Key system.
*/
typedef 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. */
- short f1, hide;
- /** User-set radius per point for beveling etc. */
- float radius;
- char _pad[4];
+ 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. */
+ short f1, hide;
+ /** User-set radius per point for beveling etc. */
+ float radius;
+ char _pad[4];
} BPoint;
/**
@@ -156,373 +156,388 @@ typedef struct BPoint {
* also, it should be NURBS (Nurb isn't the singular of Nurbs).
*/
typedef struct Nurb {
- /** Multiple nurbs per curve object are allowed. */
- struct Nurb *next, *prev;
- short type;
- /** Index into material list. */
- short mat_nr;
- short hide, flag;
- /** Number of points in the U or V directions. */
- int pntsu, pntsv;
- char _pad[4];
- /** Tessellation resolution in the U or V directions. */
- short resolu, resolv;
- short orderu, orderv;
- short flagu, flagv;
-
- float *knotsu, *knotsv;
- BPoint *bp;
- BezTriple *bezt;
-
- /** KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE. */
- short tilt_interp;
- short radius_interp;
-
- /* only used for dynamically generated Nurbs created from OB_FONT's */
- int charidx;
+ /** Multiple nurbs per curve object are allowed. */
+ struct Nurb *next, *prev;
+ short type;
+ /** Index into material list. */
+ short mat_nr;
+ short hide, flag;
+ /** Number of points in the U or V directions. */
+ int pntsu, pntsv;
+ char _pad[4];
+ /** Tessellation resolution in the U or V directions. */
+ short resolu, resolv;
+ short orderu, orderv;
+ short flagu, flagv;
+
+ float *knotsu, *knotsv;
+ BPoint *bp;
+ BezTriple *bezt;
+
+ /** KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE. */
+ short tilt_interp;
+ short radius_interp;
+
+ /* only used for dynamically generated Nurbs created from OB_FONT's */
+ int charidx;
} Nurb;
typedef struct CharInfo {
- short kern;
- /** Index start at 1, unlike mesh & nurbs. */
- short mat_nr;
- char flag;
- char _pad[3];
+ short kern;
+ /** Index start at 1, unlike mesh & nurbs. */
+ short mat_nr;
+ char flag;
+ char _pad[3];
} CharInfo;
typedef struct TextBox {
- float x, y, w, h;
+ float x, y, w, h;
} TextBox;
typedef struct EditNurb {
- /* base of nurbs' list (old Curve->editnurb) */
- ListBase nurbs;
+ /* base of nurbs' list (old Curve->editnurb) */
+ ListBase nurbs;
- /* index data for shape keys */
- struct GHash *keyindex;
+ /* index data for shape keys */
+ struct GHash *keyindex;
- /* shape key being edited */
- int shapenr;
+ /* shape key being edited */
+ int shapenr;
- char _pad[4];
+ char _pad[4];
} EditNurb;
typedef struct Curve {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- struct BoundBox *bb;
-
- /** Actual data, called splines in rna. */
- ListBase nurb;
-
- /** Edited data, not in file, use pointer so we can check for it. */
- EditNurb *editnurb;
-
- struct Object *bevobj, *taperobj, *textoncurve;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- struct Key *key;
- struct Material **mat;
-
- /* texture space, copied as one block in editobject.c */
- float loc[3];
- float size[3];
- float rot[3];
-
- /** Creation-time type of curve datablock. */
- short type;
-
- /** Keep a short because of BKE_object_obdata_texspace_get(). */
- short texflag;
- char _pad0[2];
- short twist_mode;
- float twist_smooth, smallcaps_scale;
-
- int pathlen;
- short bevresol, totcol;
- int flag;
- float width, ext1, ext2;
-
- /* default */
- short resolu, resolv;
- short resolu_ren, resolv_ren;
-
- /* edit, index in nurb list */
- int actnu;
- /* edit, index in active nurb (BPoint or BezTriple) */
- int actvert;
-
- char overflow;
- char spacemode, align_y;
- char _pad[3];
-
- /* font part */
- short lines;
- float spacing, linedist, shear, fsize, wordspace, ulpos, ulheight;
- float xof, yof;
- float linewidth;
-
- /* copy of EditFont vars (wchar_t aligned),
- * warning! don't use in editmode (storage only) */
- int pos;
- int selstart, selend;
-
- /* text data */
- /** Number of characters (strinfo). */
- int len_wchar;
- /** Number of bytes (str - utf8). */
- int len;
- char *str;
- struct EditFont *editfont;
-
- char family[64];
- struct VFont *vfont;
- struct VFont *vfontb;
- struct VFont *vfonti;
- struct VFont *vfontbi;
-
- struct TextBox *tb;
- int totbox, actbox;
-
- struct CharInfo *strinfo;
- struct CharInfo curinfo;
- /* font part end */
-
-
- /** Current evaltime - for use by Objects parented to curves. */
- float ctime;
- float bevfac1, bevfac2;
- char bevfac1_mapping, bevfac2_mapping;
-
- char _pad2[6];
- float fsize_realtime;
-
- void *batch_cache;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ struct BoundBox *bb;
+
+ /** Actual data, called splines in rna. */
+ ListBase nurb;
+
+ /** Edited data, not in file, use pointer so we can check for it. */
+ EditNurb *editnurb;
+
+ struct Object *bevobj, *taperobj, *textoncurve;
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ struct Key *key;
+ struct Material **mat;
+
+ /* texture space, copied as one block in editobject.c */
+ float loc[3];
+ float size[3];
+ float rot[3];
+
+ /** Creation-time type of curve datablock. */
+ short type;
+
+ /** Keep a short because of BKE_object_obdata_texspace_get(). */
+ short texflag;
+ char _pad0[2];
+ short twist_mode;
+ float twist_smooth, smallcaps_scale;
+
+ int pathlen;
+ short bevresol, totcol;
+ int flag;
+ float width, ext1, ext2;
+
+ /* default */
+ short resolu, resolv;
+ short resolu_ren, resolv_ren;
+
+ /* edit, index in nurb list */
+ int actnu;
+ /* edit, index in active nurb (BPoint or BezTriple) */
+ int actvert;
+
+ char overflow;
+ char spacemode, align_y;
+ char _pad[3];
+
+ /* font part */
+ short lines;
+ float spacing, linedist, shear, fsize, wordspace, ulpos, ulheight;
+ float xof, yof;
+ float linewidth;
+
+ /* copy of EditFont vars (wchar_t aligned),
+ * warning! don't use in editmode (storage only) */
+ int pos;
+ int selstart, selend;
+
+ /* text data */
+ /** Number of characters (strinfo). */
+ int len_wchar;
+ /** Number of bytes (str - utf8). */
+ int len;
+ char *str;
+ struct EditFont *editfont;
+
+ char family[64];
+ struct VFont *vfont;
+ struct VFont *vfontb;
+ struct VFont *vfonti;
+ struct VFont *vfontbi;
+
+ struct TextBox *tb;
+ int totbox, actbox;
+
+ struct CharInfo *strinfo;
+ struct CharInfo curinfo;
+ /* font part end */
+
+ /** Current evaltime - for use by Objects parented to curves. */
+ float ctime;
+ float bevfac1, bevfac2;
+ char bevfac1_mapping, bevfac2_mapping;
+
+ char _pad2[6];
+ float fsize_realtime;
+
+ void *batch_cache;
} Curve;
-#define CURVE_VFONT_ANY(cu) \
- ((cu)->vfont), ((cu)->vfontb), ((cu)->vfonti), ((cu)->vfontbi)
+#define CURVE_VFONT_ANY(cu) ((cu)->vfont), ((cu)->vfontb), ((cu)->vfonti), ((cu)->vfontbi)
/* **************** CURVE ********************* */
/* Curve.texflag */
enum {
- CU_AUTOSPACE = 1,
+ CU_AUTOSPACE = 1,
};
#if 0 /* Moved to overlay options in 2.8 */
/* Curve.drawflag */
enum {
- CU_HIDE_HANDLES = 1 << 0,
- CU_HIDE_NORMALS = 1 << 1,
+ CU_HIDE_HANDLES = 1 << 0,
+ CU_HIDE_NORMALS = 1 << 1,
};
#endif
/* Curve.flag */
enum {
- CU_3D = 1 << 0,
- CU_FRONT = 1 << 1,
- CU_BACK = 1 << 2,
- CU_PATH = 1 << 3,
- CU_FOLLOW = 1 << 4,
- CU_UV_ORCO = 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,
- /** fill 2d curve after deformation */
- CU_DEFORM_FILL = 1 << 13,
- /** fill bevel caps */
- CU_FILL_CAPS = 1 << 14,
- /** map taper object to beveled area */
- CU_MAP_TAPER = 1 << 15,
+ CU_3D = 1 << 0,
+ CU_FRONT = 1 << 1,
+ CU_BACK = 1 << 2,
+ CU_PATH = 1 << 3,
+ CU_FOLLOW = 1 << 4,
+ CU_UV_ORCO = 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,
+ /** fill 2d curve after deformation */
+ CU_DEFORM_FILL = 1 << 13,
+ /** fill bevel caps */
+ CU_FILL_CAPS = 1 << 14,
+ /** map taper object to beveled area */
+ CU_MAP_TAPER = 1 << 15,
};
/* Curve.twist_mode */
enum {
- 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,
+ 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 {
- CU_BEVFAC_MAP_RESOLU = 0,
- CU_BEVFAC_MAP_SEGMENT = 1,
- CU_BEVFAC_MAP_SPLINE = 2,
+ CU_BEVFAC_MAP_RESOLU = 0,
+ CU_BEVFAC_MAP_SEGMENT = 1,
+ CU_BEVFAC_MAP_SPLINE = 2,
};
/* Curve.spacemode */
enum {
- 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,
+ 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 {
- 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,
+ 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.overflow. */
enum {
- CU_OVERFLOW_NONE = 0,
- CU_OVERFLOW_SCALE = 1,
- CU_OVERFLOW_TRUNCATE = 2,
+ CU_OVERFLOW_NONE = 0,
+ CU_OVERFLOW_SCALE = 1,
+ CU_OVERFLOW_TRUNCATE = 2,
};
/* Nurb.flag */
enum {
- CU_SMOOTH = 1 << 0,
- CU_2D = 1 << 3, /* moved from type since 2.4x */
+ CU_SMOOTH = 1 << 0,
+ CU_2D = 1 << 3, /* moved from type since 2.4x */
};
/* Nurb.type */
enum {
- CU_POLY = 0,
- CU_BEZIER = 1,
- CU_BSPLINE = 2,
- CU_CARDINAL = 3,
- CU_NURBS = 4,
- CU_TYPE = (CU_POLY | CU_BEZIER | CU_BSPLINE | CU_CARDINAL | 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,
+ CU_POLY = 0,
+ CU_BEZIER = 1,
+ CU_BSPLINE = 2,
+ CU_CARDINAL = 3,
+ CU_NURBS = 4,
+ CU_TYPE = (CU_POLY | CU_BEZIER | CU_BSPLINE | CU_CARDINAL | 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 {
- CU_NURB_CYCLIC = 1 << 0,
- CU_NURB_ENDPOINT = 1 << 1,
- CU_NURB_BEZIER = 1 << 2,
+ CU_NURB_CYCLIC = 1 << 0,
+ CU_NURB_ENDPOINT = 1 << 1,
+ CU_NURB_BEZIER = 1 << 2,
};
-#define CU_ACT_NONE -1
+#define CU_ACT_NONE -1
/* *************** BEZTRIPLE **************** */
/* BezTriple.f1,2,3 */
typedef enum eBezTriple_Flag {
- /* SELECT */
- BEZT_FLAG_TEMP_TAG = (1 << 1), /* always clear. */
+ /* SELECT */
+ BEZT_FLAG_TEMP_TAG = (1 << 1), /* always clear. */
} eBezTriple_Flag;
/* h1 h2 (beztriple) */
typedef enum eBezTriple_Handle {
- 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 */
+ 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 */
} eBezTriple_Handle;
/* f5 (beztriple) */
typedef enum eBezTriple_Auto_Type {
- HD_AUTOTYPE_NORMAL = 0,
- HD_AUTOTYPE_SPECIAL = 1,
+ HD_AUTOTYPE_NORMAL = 0,
+ HD_AUTOTYPE_SPECIAL = 1,
} eBezTriple_Auto_Type;
/* interpolation modes (used only for BezTriple->ipo) */
typedef enum eBezTriple_Interpolation {
- /* 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,
+ /* 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,
} eBezTriple_Interpolation;
/* easing modes (used only for Keyframes - BezTriple->easing) */
typedef enum eBezTriple_Easing {
- BEZT_IPO_EASE_AUTO = 0,
+ BEZT_IPO_EASE_AUTO = 0,
- BEZT_IPO_EASE_IN = 1,
- BEZT_IPO_EASE_OUT = 2,
- BEZT_IPO_EASE_IN_OUT = 3,
+ BEZT_IPO_EASE_IN = 1,
+ BEZT_IPO_EASE_OUT = 2,
+ BEZT_IPO_EASE_IN_OUT = 3,
} eBezTriple_Easing;
/* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
typedef enum eBezTriple_KeyframeType {
- 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' */
+ 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' */
} eBezTriple_KeyframeType;
/* checks if the given BezTriple is selected */
#define BEZT_ISSEL_ANY(bezt) \
- (((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT))
+ (((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT))
#define BEZT_ISSEL_ALL(bezt) \
- (((bezt)->f2 & SELECT) && ((bezt)->f1 & SELECT) && ((bezt)->f3 & SELECT))
+ (((bezt)->f2 & SELECT) && ((bezt)->f1 & SELECT) && ((bezt)->f3 & SELECT))
#define BEZT_ISSEL_ALL_HIDDENHANDLES(v3d, bezt) \
- ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? (bezt)->f2 & SELECT : BEZT_ISSEL_ALL(bezt))
+ ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? \
+ (bezt)->f2 & SELECT : \
+ BEZT_ISSEL_ALL(bezt))
#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) \
- ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? (bezt)->f2 & SELECT : BEZT_ISSEL_ANY(bezt))
-
-#define BEZT_SEL_ALL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } ((void)0)
-#define BEZT_DESEL_ALL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } ((void)0)
-
-#define BEZT_IS_AUTOH(bezt) (ELEM((bezt)->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM((bezt)->h2, HD_AUTO, HD_AUTO_ANIM))
+ ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? \
+ (bezt)->f2 & SELECT : \
+ BEZT_ISSEL_ANY(bezt))
+
+#define BEZT_SEL_ALL(bezt) \
+ { \
+ (bezt)->f1 |= SELECT; \
+ (bezt)->f2 |= SELECT; \
+ (bezt)->f3 |= SELECT; \
+ } \
+ ((void)0)
+#define BEZT_DESEL_ALL(bezt) \
+ { \
+ (bezt)->f1 &= ~SELECT; \
+ (bezt)->f2 &= ~SELECT; \
+ (bezt)->f3 &= ~SELECT; \
+ } \
+ ((void)0)
+
+#define BEZT_IS_AUTOH(bezt) \
+ (ELEM((bezt)->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM((bezt)->h2, HD_AUTO, HD_AUTO_ANIM))
/* *************** CHARINFO **************** */
/* CharInfo.flag */
enum {
- /* note: CU_CHINFO_WRAP, CU_CHINFO_SMALLCAPS_TEST and CU_CHINFO_TRUNCATE are set dynamically */
- CU_CHINFO_BOLD = 1 << 0,
- CU_CHINFO_ITALIC = 1 << 1,
- CU_CHINFO_UNDERLINE = 1 << 2,
- /** wordwrap occurred here */
- CU_CHINFO_WRAP = 1 << 3,
- CU_CHINFO_SMALLCAPS = 1 << 4,
- /** set at runtime, checks if case switching is needed */
- CU_CHINFO_SMALLCAPS_CHECK = 1 << 5,
- /** Set at runtime, indicates char that doesn't fit in text boxes. */
- CU_CHINFO_OVERFLOW = 1 << 6,
+ /* note: CU_CHINFO_WRAP, CU_CHINFO_SMALLCAPS_TEST and CU_CHINFO_TRUNCATE are set dynamically */
+ CU_CHINFO_BOLD = 1 << 0,
+ CU_CHINFO_ITALIC = 1 << 1,
+ CU_CHINFO_UNDERLINE = 1 << 2,
+ /** wordwrap occurred here */
+ CU_CHINFO_WRAP = 1 << 3,
+ CU_CHINFO_SMALLCAPS = 1 << 4,
+ /** set at runtime, checks if case switching is needed */
+ CU_CHINFO_SMALLCAPS_CHECK = 1 << 5,
+ /** Set at runtime, indicates char that doesn't fit in text boxes. */
+ CU_CHINFO_OVERFLOW = 1 << 6,
};
/* mixed with KEY_LINEAR but define here since only curve supports */
-#define KEY_CU_EASE 3
+#define KEY_CU_EASE 3
/* indicates point has been seen during surface duplication */
-#define SURF_SEEN 4
+#define SURF_SEEN 4
#endif
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 10d18684413..c38222a3eb3 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -32,194 +32,192 @@ extern "C" {
/** descriptor and storage for a custom data layer */
typedef struct CustomDataLayer {
- /** Type of data in layer. */
- int type;
- /** In editmode, offset of layer in block. */
- int offset;
- /** General purpose flag. */
- int flag;
- /** Number of the active layer of this type. */
- int active;
- /** Number of the layer to rende.r*/
- int active_rnd;
- /** Number of the layer to rende.r*/
- int active_clone;
- /** Number of the layer to rende.r*/
- int active_mask;
- /** Shape keyblock unique id referenc.e*/
- int uid;
- /** Layer name, MAX_CUSTOMDATA_LAYER_NAME. */
- char name[64];
- /** Layer data. */
- void *data;
+ /** Type of data in layer. */
+ int type;
+ /** In editmode, offset of layer in block. */
+ int offset;
+ /** General purpose flag. */
+ int flag;
+ /** Number of the active layer of this type. */
+ int active;
+ /** Number of the layer to rende.r*/
+ int active_rnd;
+ /** Number of the layer to rende.r*/
+ int active_clone;
+ /** Number of the layer to rende.r*/
+ int active_mask;
+ /** Shape keyblock unique id referenc.e*/
+ int uid;
+ /** Layer name, MAX_CUSTOMDATA_LAYER_NAME. */
+ char name[64];
+ /** Layer data. */
+ void *data;
} CustomDataLayer;
#define MAX_CUSTOMDATA_LAYER_NAME 64
typedef struct CustomDataExternal {
- /** FILE_MAX. */
- char filename[1024];
+ /** FILE_MAX. */
+ char filename[1024];
} CustomDataExternal;
/** structure which stores custom element data associated with mesh elements
* (vertices, edges or faces). The custom data is organized into a series of
* layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */
typedef struct CustomData {
- /** CustomDataLayers, ordered by type. */
- CustomDataLayer *layers;
- /**
- * runtime only! - maps types to indices of first layer of that type,
- * MUST be >= CD_NUMTYPES, but we cant use a define here.
- * Correct size is ensured in CustomData_update_typemap assert().
- */
- int typemap[42];
- char _pad0[4];
- /** Number of layers, size of layers array. */
- int totlayer, maxlayer;
- /** In editmode, total size of all data layers. */
- int totsize;
- /** (BMesh Only): Memory pool for allocation of blocks. */
- struct BLI_mempool *pool;
- /** External file storing customdata layers. */
- CustomDataExternal *external;
+ /** CustomDataLayers, ordered by type. */
+ CustomDataLayer *layers;
+ /**
+ * runtime only! - maps types to indices of first layer of that type,
+ * MUST be >= CD_NUMTYPES, but we cant use a define here.
+ * Correct size is ensured in CustomData_update_typemap assert().
+ */
+ int typemap[42];
+ char _pad0[4];
+ /** Number of layers, size of layers array. */
+ int totlayer, maxlayer;
+ /** In editmode, total size of all data layers. */
+ int totsize;
+ /** (BMesh Only): Memory pool for allocation of blocks. */
+ struct BLI_mempool *pool;
+ /** External file storing customdata layers. */
+ CustomDataExternal *external;
} CustomData;
/* CustomData.type */
typedef enum CustomDataType {
- /* Used by GLSL attributes in the cases when we need a delayed CD type
- * assignment (in the cases when we don't know in advance which layer
- * we are addressing).
- */
- CD_AUTO_FROM_NAME = -1,
+ /* Used by GLSL attributes in the cases when we need a delayed CD type
+ * assignment (in the cases when we don't know in advance which layer
+ * we are addressing).
+ */
+ CD_AUTO_FROM_NAME = -1,
- CD_MVERT = 0,
+ CD_MVERT = 0,
#ifdef DNA_DEPRECATED
- CD_MSTICKY = 1, /* DEPRECATED */
+ CD_MSTICKY = 1, /* DEPRECATED */
#endif
- CD_MDEFORMVERT = 2,
- CD_MEDGE = 3,
- CD_MFACE = 4,
- CD_MTFACE = 5,
- CD_MCOL = 6,
- CD_ORIGINDEX = 7,
- CD_NORMAL = 8,
- CD_FACEMAP = 9, /* exclusive face group, each face can only be part of one */
- CD_PROP_FLT = 10,
- CD_PROP_INT = 11,
- CD_PROP_STR = 12,
- CD_ORIGSPACE = 13, /* for modifier stack face location mapping */
- CD_ORCO = 14, /* undeformed vertex coordinates, normalized to 0..1 range */
-/* CD_MTEXPOLY = 15, */ /* deprecated */
- CD_MLOOPUV = 16,
- CD_MLOOPCOL = 17,
- CD_TANGENT = 18,
- CD_MDISPS = 19,
- CD_PREVIEW_MCOL = 20, /* for displaying weightpaint colors */
-/* CD_ID_MCOL = 21, */
- CD_TEXTURE_MLOOPCOL = 22,
- CD_CLOTH_ORCO = 23,
- CD_RECAST = 24,
-
-/* BMESH ONLY START */
- CD_MPOLY = 25,
- CD_MLOOP = 26,
- CD_SHAPE_KEYINDEX = 27,
- CD_SHAPEKEY = 28,
- CD_BWEIGHT = 29,
- CD_CREASE = 30,
- CD_ORIGSPACE_MLOOP = 31,
- CD_PREVIEW_MLOOPCOL = 32,
- CD_BM_ELEM_PYPTR = 33,
-/* BMESH ONLY END */
-
- CD_PAINT_MASK = 34,
- CD_GRID_PAINT_MASK = 35,
- CD_MVERT_SKIN = 36,
- CD_FREESTYLE_EDGE = 37,
- CD_FREESTYLE_FACE = 38,
- CD_MLOOPTANGENT = 39,
- CD_TESSLOOPNORMAL = 40,
- CD_CUSTOMLOOPNORMAL = 41,
-
- CD_NUMTYPES = 42,
+ CD_MDEFORMVERT = 2,
+ CD_MEDGE = 3,
+ CD_MFACE = 4,
+ CD_MTFACE = 5,
+ CD_MCOL = 6,
+ CD_ORIGINDEX = 7,
+ CD_NORMAL = 8,
+ CD_FACEMAP = 9, /* exclusive face group, each face can only be part of one */
+ CD_PROP_FLT = 10,
+ CD_PROP_INT = 11,
+ CD_PROP_STR = 12,
+ CD_ORIGSPACE = 13, /* for modifier stack face location mapping */
+ CD_ORCO = 14, /* undeformed vertex coordinates, normalized to 0..1 range */
+ /* CD_MTEXPOLY = 15, */ /* deprecated */
+ CD_MLOOPUV = 16,
+ CD_MLOOPCOL = 17,
+ CD_TANGENT = 18,
+ CD_MDISPS = 19,
+ CD_PREVIEW_MCOL = 20, /* for displaying weightpaint colors */
+ /* CD_ID_MCOL = 21, */
+ CD_TEXTURE_MLOOPCOL = 22,
+ CD_CLOTH_ORCO = 23,
+ CD_RECAST = 24,
+
+ /* BMESH ONLY START */
+ CD_MPOLY = 25,
+ CD_MLOOP = 26,
+ CD_SHAPE_KEYINDEX = 27,
+ CD_SHAPEKEY = 28,
+ CD_BWEIGHT = 29,
+ CD_CREASE = 30,
+ CD_ORIGSPACE_MLOOP = 31,
+ CD_PREVIEW_MLOOPCOL = 32,
+ CD_BM_ELEM_PYPTR = 33,
+ /* BMESH ONLY END */
+
+ CD_PAINT_MASK = 34,
+ CD_GRID_PAINT_MASK = 35,
+ CD_MVERT_SKIN = 36,
+ CD_FREESTYLE_EDGE = 37,
+ CD_FREESTYLE_FACE = 38,
+ CD_MLOOPTANGENT = 39,
+ CD_TESSLOOPNORMAL = 40,
+ CD_CUSTOMLOOPNORMAL = 41,
+
+ CD_NUMTYPES = 42,
} CustomDataType;
/* Bits for CustomDataMask */
-#define CD_MASK_MVERT (1 << CD_MVERT)
-// #define CD_MASK_MSTICKY (1 << CD_MSTICKY) /* DEPRECATED */
-#define CD_MASK_MDEFORMVERT (1 << CD_MDEFORMVERT)
-#define CD_MASK_MEDGE (1 << CD_MEDGE)
-#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_FACEMAP (1 << CD_FACEMAP)
-#define CD_MASK_PROP_FLT (1 << CD_PROP_FLT)
-#define CD_MASK_PROP_INT (1 << CD_PROP_INT)
-#define CD_MASK_PROP_STR (1 << CD_PROP_STR)
-#define CD_MASK_ORIGSPACE (1 << CD_ORIGSPACE)
-#define CD_MASK_ORCO (1 << CD_ORCO)
-// #define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY) /* DEPRECATED */
-#define CD_MASK_MLOOPUV (1 << CD_MLOOPUV)
-#define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL)
-#define CD_MASK_TANGENT (1 << CD_TANGENT)
-#define CD_MASK_MDISPS (1 << CD_MDISPS)
-#define CD_MASK_PREVIEW_MCOL (1 << CD_PREVIEW_MCOL)
-#define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO)
-#define CD_MASK_RECAST (1 << CD_RECAST)
+#define CD_MASK_MVERT (1 << CD_MVERT)
+// #define CD_MASK_MSTICKY (1 << CD_MSTICKY) /* DEPRECATED */
+#define CD_MASK_MDEFORMVERT (1 << CD_MDEFORMVERT)
+#define CD_MASK_MEDGE (1 << CD_MEDGE)
+#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_FACEMAP (1 << CD_FACEMAP)
+#define CD_MASK_PROP_FLT (1 << CD_PROP_FLT)
+#define CD_MASK_PROP_INT (1 << CD_PROP_INT)
+#define CD_MASK_PROP_STR (1 << CD_PROP_STR)
+#define CD_MASK_ORIGSPACE (1 << CD_ORIGSPACE)
+#define CD_MASK_ORCO (1 << CD_ORCO)
+// #define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY) /* DEPRECATED */
+#define CD_MASK_MLOOPUV (1 << CD_MLOOPUV)
+#define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL)
+#define CD_MASK_TANGENT (1 << CD_TANGENT)
+#define CD_MASK_MDISPS (1 << CD_MDISPS)
+#define CD_MASK_PREVIEW_MCOL (1 << CD_PREVIEW_MCOL)
+#define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO)
+#define CD_MASK_RECAST (1 << CD_RECAST)
/* BMESH ONLY START */
-#define CD_MASK_MPOLY (1 << CD_MPOLY)
-#define CD_MASK_MLOOP (1 << CD_MLOOP)
-#define CD_MASK_SHAPE_KEYINDEX (1 << CD_SHAPE_KEYINDEX)
-#define CD_MASK_SHAPEKEY (1 << CD_SHAPEKEY)
-#define CD_MASK_BWEIGHT (1 << CD_BWEIGHT)
-#define CD_MASK_CREASE (1 << CD_CREASE)
-#define CD_MASK_ORIGSPACE_MLOOP (1LL << CD_ORIGSPACE_MLOOP)
+#define CD_MASK_MPOLY (1 << CD_MPOLY)
+#define CD_MASK_MLOOP (1 << CD_MLOOP)
+#define CD_MASK_SHAPE_KEYINDEX (1 << CD_SHAPE_KEYINDEX)
+#define CD_MASK_SHAPEKEY (1 << CD_SHAPEKEY)
+#define CD_MASK_BWEIGHT (1 << CD_BWEIGHT)
+#define CD_MASK_CREASE (1 << CD_CREASE)
+#define CD_MASK_ORIGSPACE_MLOOP (1LL << CD_ORIGSPACE_MLOOP)
#define CD_MASK_PREVIEW_MLOOPCOL (1LL << CD_PREVIEW_MLOOPCOL)
#define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR)
/* BMESH ONLY END */
-#define CD_MASK_PAINT_MASK (1LL << CD_PAINT_MASK)
-#define CD_MASK_GRID_PAINT_MASK (1LL << CD_GRID_PAINT_MASK)
-#define CD_MASK_MVERT_SKIN (1LL << CD_MVERT_SKIN)
-#define CD_MASK_FREESTYLE_EDGE (1LL << CD_FREESTYLE_EDGE)
-#define CD_MASK_FREESTYLE_FACE (1LL << CD_FREESTYLE_FACE)
-#define CD_MASK_MLOOPTANGENT (1LL << CD_MLOOPTANGENT)
-#define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL)
+#define CD_MASK_PAINT_MASK (1LL << CD_PAINT_MASK)
+#define CD_MASK_GRID_PAINT_MASK (1LL << CD_GRID_PAINT_MASK)
+#define CD_MASK_MVERT_SKIN (1LL << CD_MVERT_SKIN)
+#define CD_MASK_FREESTYLE_EDGE (1LL << CD_FREESTYLE_EDGE)
+#define CD_MASK_FREESTYLE_FACE (1LL << CD_FREESTYLE_FACE)
+#define CD_MASK_MLOOPTANGENT (1LL << CD_MLOOPTANGENT)
+#define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL)
#define CD_MASK_CUSTOMLOOPNORMAL (1LL << CD_CUSTOMLOOPNORMAL)
/** Data types that may be defined for all mesh elements types. */
#define CD_MASK_GENERIC_DATA (CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR)
-
typedef struct CustomData_MeshMasks {
- uint64_t vmask;
- uint64_t emask;
- uint64_t fmask;
- uint64_t pmask;
- uint64_t lmask;
+ uint64_t vmask;
+ uint64_t emask;
+ uint64_t fmask;
+ uint64_t pmask;
+ uint64_t lmask;
} CustomData_MeshMasks;
-
/* CustomData.flag */
enum {
- /* Indicates layer should not be copied by CustomData_from_template or CustomData_copy_data */
- CD_FLAG_NOCOPY = (1 << 0),
- /* Indicates layer should not be freed (for layers backed by external data) */
- CD_FLAG_NOFREE = (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),
+ /* Indicates layer should not be copied by CustomData_from_template or CustomData_copy_data */
+ CD_FLAG_NOCOPY = (1 << 0),
+ /* Indicates layer should not be freed (for layers backed by external data) */
+ CD_FLAG_NOFREE = (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),
};
/* Limits */
-#define MAX_MTFACE 8
-#define MAX_MCOL 8
+#define MAX_MTFACE 8
+#define MAX_MCOL 8
#define DYNTOPO_NODE_NONE -1
@@ -229,4 +227,4 @@ enum {
}
#endif
-#endif /* __DNA_CUSTOMDATA_TYPES_H__ */
+#endif /* __DNA_CUSTOMDATA_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index 958909987f0..092dd9d3bcc 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -25,31 +25,30 @@
/* makesdna ignores */
#ifdef DNA_DEPRECATED_ALLOW
- /* allow use of deprecated items */
+/* allow use of deprecated items */
# define DNA_DEPRECATED
#else
# ifndef DNA_DEPRECATED
# ifdef __GNUC__
-# define DNA_DEPRECATED __attribute__ ((deprecated))
+# define DNA_DEPRECATED __attribute__((deprecated))
# else
- /* TODO, msvc & others */
+/* TODO, msvc & others */
# define DNA_DEPRECATED
# endif
# endif
#endif
#ifdef __GNUC__
-# define DNA_PRIVATE_ATTR __attribute__ ((deprecated))
+# 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 */
+/* enable the pragma if we can */
# ifdef __GNUC__
# define DNA_DEPRECATED_GCC_POISON 1
# else
@@ -57,7 +56,6 @@
# endif
#endif
-
/* hrmf, we need a better include then this */
#include "../blenlib/BLI_sys_types.h" /* needed for int64_t only! */
diff --git a/source/blender/makesdna/DNA_documentation.h b/source/blender/makesdna/DNA_documentation.h
index 3f5bbec35bf..be11b3d9040 100644
--- a/source/blender/makesdna/DNA_documentation.h
+++ b/source/blender/makesdna/DNA_documentation.h
@@ -79,5 +79,4 @@
* (ton)
*/
-
/* This file has intentionally no definitions or implementation. */
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index 15b270538ef..1afb462aaa7 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -26,259 +26,258 @@ struct PaintSurfaceData;
/* surface format */
enum {
- MOD_DPAINT_SURFACE_F_PTEX = 0,
- MOD_DPAINT_SURFACE_F_VERTEX = 1,
- MOD_DPAINT_SURFACE_F_IMAGESEQ = 2,
+ MOD_DPAINT_SURFACE_F_PTEX = 0,
+ MOD_DPAINT_SURFACE_F_VERTEX = 1,
+ MOD_DPAINT_SURFACE_F_IMAGESEQ = 2,
};
/* surface type */
enum {
- MOD_DPAINT_SURFACE_T_PAINT = 0,
- MOD_DPAINT_SURFACE_T_DISPLACE = 1,
- MOD_DPAINT_SURFACE_T_WEIGHT = 2,
- MOD_DPAINT_SURFACE_T_WAVE = 3,
+ 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 {
- MOD_DPAINT_ACTIVE = 1 << 0, /* Is surface enabled */
+ MOD_DPAINT_ACTIVE = 1 << 0, /* Is surface enabled */
- MOD_DPAINT_ANTIALIAS = 1 << 1, /* do antialiasing */
- 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_PREVIEW = 1 << 6, /* preview this surface on viewport*/
+ MOD_DPAINT_ANTIALIAS = 1 << 1, /* do antialiasing */
+ 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_PREVIEW = 1 << 6, /* preview this surface on viewport*/
- 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_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 */
+ MOD_DPAINT_OUT1 = 1 << 10, /* output primary surface */
+ MOD_DPAINT_OUT2 = 1 << 11, /* output secondary surface */
};
/* image_fileformat */
enum {
- MOD_DPAINT_IMGFORMAT_PNG = 0,
- MOD_DPAINT_IMGFORMAT_OPENEXR = 1,
+ MOD_DPAINT_IMGFORMAT_PNG = 0,
+ MOD_DPAINT_IMGFORMAT_OPENEXR = 1,
};
/* disp_format */
enum {
- MOD_DPAINT_DISP_DISPLACE = 0, /* displacement output displace map */
- MOD_DPAINT_DISP_DEPTH = 1, /* displacement output depth data */
+ MOD_DPAINT_DISP_DISPLACE = 0, /* displacement output displace map */
+ MOD_DPAINT_DISP_DEPTH = 1, /* displacement output depth data */
};
/* effect */
enum {
- 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 */
+ 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 */
};
/* preview_id */
enum {
- MOD_DPAINT_SURFACE_PREV_PAINT = 0,
- MOD_DPAINT_SURFACE_PREV_WETMAP = 1,
+ MOD_DPAINT_SURFACE_PREV_PAINT = 0,
+ MOD_DPAINT_SURFACE_PREV_WETMAP = 1,
};
/* init_color_type */
enum {
- MOD_DPAINT_INITIAL_NONE = 0,
- MOD_DPAINT_INITIAL_COLOR = 1,
- MOD_DPAINT_INITIAL_TEXTURE = 2,
- MOD_DPAINT_INITIAL_VERTEXCOLOR = 3,
+ MOD_DPAINT_INITIAL_NONE = 0,
+ MOD_DPAINT_INITIAL_COLOR = 1,
+ MOD_DPAINT_INITIAL_TEXTURE = 2,
+ MOD_DPAINT_INITIAL_VERTEXCOLOR = 3,
};
/* Is stored in ModifierData.runtime. */
#
#
typedef struct DynamicPaintRuntime {
- struct Mesh *canvas_mesh;
- struct Mesh *brush_mesh;
+ struct Mesh *canvas_mesh;
+ struct Mesh *brush_mesh;
} DynamicPaintRuntime;
typedef struct DynamicPaintSurface {
- struct DynamicPaintSurface *next, *prev;
- /** For fast RNA access. */
- struct DynamicPaintCanvasSettings *canvas;
- struct PaintSurfaceData *data;
-
- struct Collection *brush_group;
- struct EffectorWeights *effector_weights;
-
- /* cache */
- struct PointCache *pointcache;
- struct ListBase ptcaches;
- int current_frame;
-
- /* surface */
- char name[64];
- short format, type;
- short disp_type, image_fileformat;
- /** Ui selection box. */
- short effect_ui;
- /** Surface output id to preview. */
- short preview_id;
- short init_color_type;
- char _pad0[2];
- int flags, effect;
-
- int image_resolution, substeps;
- int start_frame, end_frame;
- char _pad[4];
-
- /* initial color */
- float init_color[4];
- struct Tex *init_texture;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char init_layername[64];
-
- int dry_speed, diss_speed;
- float color_dry_threshold;
- float depth_clamp, disp_factor;
-
- float spread_speed, color_spread_speed, shrink_speed;
- float drip_vel, drip_acc;
-
- /* per surface brush settings */
- float influence_scale, radius_scale;
-
- /* wave settings */
- float wave_damping, wave_speed, wave_timescale, wave_spring, wave_smoothness;
- char _pad2[4];
-
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- /** 1024 = FILE_MAX. */
- char image_output_path[1024];
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char output_name[64];
- /** MAX_CUSTOMDATA_LAYER_NAME */ /* some surfaces have 2 outputs. */
- char output_name2[64];
+ struct DynamicPaintSurface *next, *prev;
+ /** For fast RNA access. */
+ struct DynamicPaintCanvasSettings *canvas;
+ struct PaintSurfaceData *data;
+
+ struct Collection *brush_group;
+ struct EffectorWeights *effector_weights;
+
+ /* cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
+ int current_frame;
+
+ /* surface */
+ char name[64];
+ short format, type;
+ short disp_type, image_fileformat;
+ /** Ui selection box. */
+ short effect_ui;
+ /** Surface output id to preview. */
+ short preview_id;
+ short init_color_type;
+ char _pad0[2];
+ int flags, effect;
+
+ int image_resolution, substeps;
+ int start_frame, end_frame;
+ char _pad[4];
+
+ /* initial color */
+ float init_color[4];
+ struct Tex *init_texture;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char init_layername[64];
+
+ int dry_speed, diss_speed;
+ float color_dry_threshold;
+ float depth_clamp, disp_factor;
+
+ float spread_speed, color_spread_speed, shrink_speed;
+ float drip_vel, drip_acc;
+
+ /* per surface brush settings */
+ float influence_scale, radius_scale;
+
+ /* wave settings */
+ float wave_damping, wave_speed, wave_timescale, wave_spring, wave_smoothness;
+ char _pad2[4];
+
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ /** 1024 = FILE_MAX. */
+ char image_output_path[1024];
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char output_name[64];
+ /** MAX_CUSTOMDATA_LAYER_NAME */ /* some surfaces have 2 outputs. */
+ char output_name2[64];
} DynamicPaintSurface;
/* canvas flags */
enum {
- /* This should not be needed, having a valid WEIGHT_MCOL layer should be enough.
- * And if not, should be a general flag. But seems unnecessary for now... */
+/* This should not be needed, having a valid WEIGHT_MCOL layer should be enough.
+ * And if not, should be a general flag. But seems unnecessary for now... */
#if 0
- /** if viewport preview is ready */
- MOD_DPAINT_PREVIEW_READY = 1 << 0,
+ /** if viewport preview is ready */
+ MOD_DPAINT_PREVIEW_READY = 1 << 0,
#endif
- /** surface is already baking, so it wont get updated (loop) */
- MOD_DPAINT_BAKING = 1 << 1,
+ /** surface is already baking, so it wont get updated (loop) */
+ MOD_DPAINT_BAKING = 1 << 1,
};
/* Canvas settings */
typedef struct DynamicPaintCanvasSettings {
- /** For fast RNA access. */
- struct DynamicPaintModifierData *pmd;
+ /** For fast RNA access. */
+ struct DynamicPaintModifierData *pmd;
- struct ListBase surfaces;
- short active_sur, flags;
- char _pad[4];
+ struct ListBase surfaces;
+ short active_sur, flags;
+ char _pad[4];
- /** Bake error description. */
- char error[64];
+ /** Bake error description. */
+ char error[64];
} DynamicPaintCanvasSettings;
-
/* flags */
enum {
- /** 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),
+ /** 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),
};
/* collision type */
enum {
- 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 */
+ 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 {
- MOD_DPAINT_PRFALL_CONSTANT = 0, /* no-falloff */
- MOD_DPAINT_PRFALL_SMOOTH = 1, /* smooth, linear falloff */
- MOD_DPAINT_PRFALL_RAMP = 2, /* use color ramp */
+ 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 {
- 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 */
+ 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 {
- MOD_DPAINT_RAY_CANVAS = 0,
- MOD_DPAINT_RAY_BRUSH_AVG = 1,
- MOD_DPAINT_RAY_ZPLUS = 2,
+ MOD_DPAINT_RAY_CANVAS = 0,
+ MOD_DPAINT_RAY_BRUSH_AVG = 1,
+ MOD_DPAINT_RAY_ZPLUS = 2,
};
/* Brush settings */
typedef struct DynamicPaintBrushSettings {
- /** For fast RNA access. */
- struct DynamicPaintModifierData *pmd;
- struct ParticleSystem *psys;
+ /** For fast RNA access. */
+ struct DynamicPaintModifierData *pmd;
+ struct ParticleSystem *psys;
- int flags;
- int collision;
+ int flags;
+ int collision;
- float r, g, b, alpha;
- float wetness;
+ float r, g, b, alpha;
+ float wetness;
- float particle_radius, particle_smooth;
- float paint_distance;
+ float particle_radius, particle_smooth;
+ float paint_distance;
- /* color ramps */
- /** Proximity paint falloff. */
- struct ColorBand *paint_ramp;
- /** Velocity paint ramp. */
- struct ColorBand *vel_ramp;
+ /* color ramps */
+ /** Proximity paint falloff. */
+ struct ColorBand *paint_ramp;
+ /** Velocity paint ramp. */
+ struct ColorBand *vel_ramp;
- short proximity_falloff;
- short wave_type;
- short ray_dir;
- char _pad[2];
+ short proximity_falloff;
+ short wave_type;
+ short ray_dir;
+ char _pad[2];
- float wave_factor, wave_clamp;
- float max_velocity, smudge_strength;
+ float wave_factor, wave_clamp;
+ float max_velocity, smudge_strength;
} DynamicPaintBrushSettings;
#endif
diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h
index e9260f54237..c34b146064e 100644
--- a/source/blender/makesdna/DNA_effect_types.h
+++ b/source/blender/makesdna/DNA_effect_types.h
@@ -26,110 +26,108 @@
/* don't forget, new effects also in writefile.c for dna!!! */
-#define PAF_MAXMULT 4
+#define PAF_MAXMULT 4
/* paf->flag (keep bit 0 free for compatibility) */
-#define PAF_BSPLINE 2
-#define PAF_STATIC 4
-#define PAF_FACE 8
-#define PAF_ANIMATED 16
- /* show particles before they're emitted*/
-#define PAF_UNBORN 32
- /* emit only from faces*/
-#define PAF_OFACE 64
- /* show emitter (don't hide actual mesh)*/
-#define PAF_SHOWE 128
- /* true random emit from faces (not just ordered jitter)*/
-#define PAF_TRAND 256
- /* even distribution in face emission based on face areas*/
-#define PAF_EDISTR 512
- /*show particles after they've died*/
-#define PAF_DIED 2048
-
+#define PAF_BSPLINE 2
+#define PAF_STATIC 4
+#define PAF_FACE 8
+#define PAF_ANIMATED 16
+/* show particles before they're emitted*/
+#define PAF_UNBORN 32
+/* emit only from faces*/
+#define PAF_OFACE 64
+/* show emitter (don't hide actual mesh)*/
+#define PAF_SHOWE 128
+/* true random emit from faces (not just ordered jitter)*/
+#define PAF_TRAND 256
+/* even distribution in face emission based on face areas*/
+#define PAF_EDISTR 512
+/*show particles after they've died*/
+#define PAF_DIED 2048
/*paf->flag2 for pos/neg paf->flag2neg*/
-#define PAF_TEXTIME 1 /*texture timing*/
+#define PAF_TEXTIME 1 /*texture timing*/
- /* eff->type */
-#define EFF_BUILD 0
-#define EFF_PARTICLE 1
-#define EFF_WAVE 2
+/* eff->type */
+#define EFF_BUILD 0
+#define EFF_PARTICLE 1
+#define EFF_WAVE 2
- /* eff->flag */
-#define EFF_SELECT 1
+/* eff->flag */
+#define EFF_SELECT 1
- /* paf->stype */
-#define PAF_NORMAL 0
-#define PAF_VECT 1
+/* paf->stype */
+#define PAF_NORMAL 0
+#define PAF_VECT 1
- /* paf->texmap */
-#define PAF_TEXINT 0
-#define PAF_TEXRGB 1
-#define PAF_TEXGRAD 2
+/* paf->texmap */
+#define PAF_TEXINT 0
+#define PAF_TEXRGB 1
+#define PAF_TEXGRAD 2
typedef struct Effect {
- struct Effect *next, *prev;
- short type, flag, buttype, rt;
+ struct Effect *next, *prev;
+ short type, flag, buttype, rt;
} Effect;
typedef struct BuildEff {
- struct BuildEff *next, *prev;
- short type, flag, buttype, rt;
+ struct BuildEff *next, *prev;
+ short type, flag, buttype, rt;
- float len, sfra;
+ float len, sfra;
} BuildEff;
#
#
typedef struct Particle {
- float co[3], no[3];
- float time, lifetime;
- short mat_nr, rt;
+ float co[3], no[3];
+ float time, lifetime;
+ short mat_nr, rt;
} Particle;
struct Collection;
typedef struct PartEff {
- struct PartEff *next, *prev;
- short type, flag, buttype, stype, vertgroup, userjit;
+ struct PartEff *next, *prev;
+ short type, flag, buttype, stype, vertgroup, userjit;
- float sta, end, lifetime;
- int totpart, totkey, seed;
+ float sta, end, lifetime;
+ int totpart, totkey, seed;
- float normfac, obfac, randfac, texfac, randlife;
- float force[3];
- float damp;
+ float normfac, obfac, randfac, texfac, randlife;
+ float force[3];
+ float damp;
- float nabla, vectsize, maxlen, defvec[3];
- char _pad[4];
+ float nabla, vectsize, maxlen, defvec[3];
+ char _pad[4];
- float mult[4], life[4];
- short child[4], mat[4];
- short texmap, curmult;
- short staticstep, omat, timetex, speedtex, flag2, flag2neg;
- short disp, vertgroup_v;
+ float mult[4], life[4];
+ short child[4], mat[4];
+ short texmap, curmult;
+ short staticstep, omat, timetex, speedtex, flag2, flag2neg;
+ short disp, vertgroup_v;
- /** MAX_VGROUP_NAME. */
- char vgroupname[64], vgroupname_v[64];
- /** Inverse matrix of parent Object. */
- float imat[4][4];
+ /** MAX_VGROUP_NAME. */
+ char vgroupname[64], vgroupname_v[64];
+ /** Inverse matrix of parent Object. */
+ float imat[4][4];
- Particle *keys;
- struct Collection *group;
+ Particle *keys;
+ struct Collection *group;
} PartEff;
-
typedef struct WaveEff {
- struct WaveEff *next, *prev;
- short type, flag, buttype, stype;
+ struct WaveEff *next, *prev;
+ short type, flag, buttype, stype;
- float startx, starty, height, width;
- float narrow, speed, minfac, damp;
+ float startx, starty, height, width;
+ float narrow, speed, minfac, damp;
- float timeoffs, lifetime;
+ float timeoffs, lifetime;
} WaveEff;
diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h
index 6daa0f5aeb3..66f185282a9 100644
--- a/source/blender/makesdna/DNA_fileglobal_types.h
+++ b/source/blender/makesdna/DNA_fileglobal_types.h
@@ -29,32 +29,30 @@
* the moment of saving, and the file-specific settings.
*/
typedef struct FileGlobal {
- /** Needs to be here, for human fileformat recognition (keep first!). */
- char subvstr[4];
-
- short subversion;
- short minversion, minsubversion;
- char _pad[6];
- struct bScreen *curscreen;
- struct Scene *curscene;
- struct ViewLayer *cur_view_layer;
- void *_pad1;
-
- int fileflags;
- int globalf;
- /** Commit timestamp from buildinfo. */
- uint64_t build_commit_timestamp;
- /** Hash from buildinfo. */
- char build_hash[16];
- /** File path where this was saved, for recover (1024 = FILE_MAX). */
- char filename[1024];
+ /** Needs to be here, for human fileformat recognition (keep first!). */
+ char subvstr[4];
+
+ short subversion;
+ short minversion, minsubversion;
+ char _pad[6];
+ struct bScreen *curscreen;
+ struct Scene *curscene;
+ struct ViewLayer *cur_view_layer;
+ void *_pad1;
+
+ int fileflags;
+ int globalf;
+ /** Commit timestamp from buildinfo. */
+ uint64_t build_commit_timestamp;
+ /** Hash from buildinfo. */
+ char build_hash[16];
+ /** File path where this was saved, for recover (1024 = FILE_MAX). */
+ char filename[1024];
} FileGlobal;
-
/* 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) */
-
#endif
diff --git a/source/blender/makesdna/DNA_freestyle_types.h b/source/blender/makesdna/DNA_freestyle_types.h
index 731bc590117..77cf95f4fb8 100644
--- a/source/blender/makesdna/DNA_freestyle_types.h
+++ b/source/blender/makesdna/DNA_freestyle_types.h
@@ -37,118 +37,118 @@ struct Text;
/* FreestyleConfig::flags */
enum {
- 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,
- FREESTYLE_CULLING = 1 << 5,
- FREESTYLE_VIEW_MAP_CACHE = 1 << 6,
+ 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,
+ FREESTYLE_CULLING = 1 << 5,
+ FREESTYLE_VIEW_MAP_CACHE = 1 << 6,
};
/* FreestyleConfig::mode */
enum {
- FREESTYLE_CONTROL_SCRIPT_MODE = 1,
- FREESTYLE_CONTROL_EDITOR_MODE = 2,
+ FREESTYLE_CONTROL_SCRIPT_MODE = 1,
+ FREESTYLE_CONTROL_EDITOR_MODE = 2,
};
/* FreestyleLineSet::flags */
enum {
- 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,
+ 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,
};
/* FreestyleLineSet::selection */
enum {
- 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,
+ 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,
};
/* FreestyleLineSet::edge_types, exclude_edge_types */
enum {
- 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,
+ 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,
};
/* FreestyleLineSet::qi */
enum {
- FREESTYLE_QI_VISIBLE = 1,
- FREESTYLE_QI_HIDDEN = 2,
- FREESTYLE_QI_RANGE = 3,
+ FREESTYLE_QI_VISIBLE = 1,
+ FREESTYLE_QI_HIDDEN = 2,
+ FREESTYLE_QI_RANGE = 3,
};
/* FreestyleConfig::raycasting_algorithm */
/* Defines should be replaced with ViewMapBuilder::visibility_algo */
enum {
- 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,
+ 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,
};
typedef struct FreestyleLineSet {
- struct FreestyleLineSet *next, *prev;
-
- /** Line set name, MAX_NAME. */
- char name[64];
- int flags;
-
- /** Selection criteria. */
- int selection;
- /** Quantitative invisibility. */
- short qi;
- char _pad1[2];
- int qi_start, qi_end;
- /** Feature edge types. */
- int edge_types, exclude_edge_types;
- char _pad2[4];
- /** Group of target objects. */
- struct Collection *group;
-
- struct FreestyleLineStyle *linestyle;
+ struct FreestyleLineSet *next, *prev;
+
+ /** Line set name, MAX_NAME. */
+ char name[64];
+ int flags;
+
+ /** Selection criteria. */
+ int selection;
+ /** Quantitative invisibility. */
+ short qi;
+ char _pad1[2];
+ int qi_start, qi_end;
+ /** Feature edge types. */
+ int edge_types, exclude_edge_types;
+ char _pad2[4];
+ /** Group of target objects. */
+ struct Collection *group;
+
+ struct FreestyleLineStyle *linestyle;
} FreestyleLineSet;
typedef struct FreestyleModuleConfig {
- struct FreestyleModuleConfig *next, *prev;
+ struct FreestyleModuleConfig *next, *prev;
- struct Text *script;
- short is_displayed;
- char _pad[6];
+ struct Text *script;
+ short is_displayed;
+ char _pad[6];
} FreestyleModuleConfig;
typedef struct FreestyleConfig {
- ListBase modules;
-
- /** Scripting, editor. */
- int mode;
- int raycasting_algorithm DNA_DEPRECATED;
- /** Suggestive contours, ridges/valleys, material boundaries. */
- int flags;
- float sphere_radius;
- float dkr_epsilon;
- /** In radians!. */
- float crease_angle;
-
- ListBase linesets;
+ ListBase modules;
+
+ /** Scripting, editor. */
+ int mode;
+ int raycasting_algorithm DNA_DEPRECATED;
+ /** Suggestive contours, ridges/valleys, material boundaries. */
+ int flags;
+ float sphere_radius;
+ float dkr_epsilon;
+ /** In radians!. */
+ float crease_angle;
+
+ ListBase linesets;
} FreestyleConfig;
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h
index d9fc14d9393..6a9d50ecc2d 100644
--- a/source/blender/makesdna/DNA_genfile.h
+++ b/source/blender/makesdna/DNA_genfile.h
@@ -46,69 +46,78 @@ extern const int DNAlen;
* hard-coded values against those from old files.
*/
typedef 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_VOID = 9 */
+ 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_VOID = 9 */
/* define so switch statements don't complain */
#define SDNA_TYPE_VOID 9
- SDNA_TYPE_INT64 = 10,
- SDNA_TYPE_UINT64 = 11,
+ SDNA_TYPE_INT64 = 10,
+ SDNA_TYPE_UINT64 = 11,
} eSDNA_Type;
/**
* 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 after any necessary endian conversion) */
- SDNA_CMP_EQUAL = 1,
- /* Struct is different in some way
- * (needs to be copied/converted field by field) */
- SDNA_CMP_NOT_EQUAL = 2,
+ /* 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 after any necessary endian conversion) */
+ SDNA_CMP_EQUAL = 1,
+ /* Struct is different in some way
+ * (needs to be copied/converted field by field) */
+ SDNA_CMP_NOT_EQUAL = 2,
};
-struct SDNA *DNA_sdna_from_data(
- const void *data, const int data_len,
- bool do_endian_swap, bool data_alloc,
- const char **r_error_message);
+struct SDNA *DNA_sdna_from_data(const void *data,
+ const int data_len,
+ bool do_endian_swap,
+ bool data_alloc,
+ const char **r_error_message);
void DNA_sdna_free(struct SDNA *sdna);
/* Access for current Blender versions SDNA*/
-void DNA_sdna_current_init(void);
+void DNA_sdna_current_init(void);
/* borrowed reference */
const struct SDNA *DNA_sdna_current_get(void);
-void DNA_sdna_current_free(void);
+void DNA_sdna_current_free(void);
int DNA_struct_find_nr_ex(const struct SDNA *sdna, const char *str, unsigned int *index_last);
int DNA_struct_find_nr(const struct SDNA *sdna, const char *str);
void DNA_struct_switch_endian(const struct SDNA *oldsdna, int oldSDNAnr, char *data);
const char *DNA_struct_get_compareflags(const struct SDNA *sdna, const struct SDNA *newsdna);
-void *DNA_struct_reconstruct(
- const struct SDNA *newsdna, const struct SDNA *oldsdna,
- const char *compflags, int oldSDNAnr, int blocks, const void *data);
+void *DNA_struct_reconstruct(const struct SDNA *newsdna,
+ const struct SDNA *oldsdna,
+ const char *compflags,
+ int oldSDNAnr,
+ int blocks,
+ const void *data);
int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name);
bool DNA_struct_find(const struct SDNA *sdna, const char *stype);
-bool DNA_struct_elem_find(const struct SDNA *sdna, const char *stype, const char *vartype, const char *name);
-
+bool DNA_struct_elem_find(const struct SDNA *sdna,
+ const char *stype,
+ const char *vartype,
+ const char *name);
int DNA_elem_type_size(const eSDNA_Type elem_nr);
-bool DNA_sdna_patch_struct(
- struct SDNA *sdna, const char *struct_name_old, const char *struct_name_new);
-bool DNA_sdna_patch_struct_member(
- struct SDNA *sdna, const char *struct_name, const char *elem_old, const char *elem_new);
+bool DNA_sdna_patch_struct(struct SDNA *sdna,
+ const char *struct_name_old,
+ const char *struct_name_new);
+bool DNA_sdna_patch_struct_member(struct SDNA *sdna,
+ const char *struct_name,
+ const char *elem_old,
+ const char *elem_new);
void DNA_sdna_alias_data_ensure(struct SDNA *sdna);
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index cbaae451756..c28eff95fbc 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -31,565 +31,564 @@
struct RNG;
typedef enum GpencilModifierType {
- eGpencilModifierType_None = 0,
- eGpencilModifierType_Noise = 1,
- eGpencilModifierType_Subdiv = 2,
- eGpencilModifierType_Thick = 3,
- eGpencilModifierType_Tint = 4,
- eGpencilModifierType_Array = 5,
- eGpencilModifierType_Build = 6,
- eGpencilModifierType_Opacity = 7,
- eGpencilModifierType_Color = 8,
- eGpencilModifierType_Lattice = 9,
- eGpencilModifierType_Simplify = 10,
- eGpencilModifierType_Smooth = 11,
- eGpencilModifierType_Hook = 12,
- eGpencilModifierType_Offset = 13,
- eGpencilModifierType_Mirror = 14,
- eGpencilModifierType_Armature = 15,
- eGpencilModifierType_Time = 16,
- NUM_GREASEPENCIL_MODIFIER_TYPES,
+ eGpencilModifierType_None = 0,
+ eGpencilModifierType_Noise = 1,
+ eGpencilModifierType_Subdiv = 2,
+ eGpencilModifierType_Thick = 3,
+ eGpencilModifierType_Tint = 4,
+ eGpencilModifierType_Array = 5,
+ eGpencilModifierType_Build = 6,
+ eGpencilModifierType_Opacity = 7,
+ eGpencilModifierType_Color = 8,
+ eGpencilModifierType_Lattice = 9,
+ eGpencilModifierType_Simplify = 10,
+ eGpencilModifierType_Smooth = 11,
+ eGpencilModifierType_Hook = 12,
+ eGpencilModifierType_Offset = 13,
+ eGpencilModifierType_Mirror = 14,
+ eGpencilModifierType_Armature = 15,
+ eGpencilModifierType_Time = 16,
+ NUM_GREASEPENCIL_MODIFIER_TYPES,
} GpencilModifierType;
typedef enum GpencilModifierMode {
- eGpencilModifierMode_Realtime = (1 << 0),
- eGpencilModifierMode_Render = (1 << 1),
- eGpencilModifierMode_Editmode = (1 << 2),
- eGpencilModifierMode_Expanded = (1 << 3),
+ eGpencilModifierMode_Realtime = (1 << 0),
+ eGpencilModifierMode_Render = (1 << 1),
+ eGpencilModifierMode_Editmode = (1 << 2),
+ eGpencilModifierMode_Expanded = (1 << 3),
} GpencilModifierMode;
typedef enum {
- /* This modifier has been inserted in local override, and hence can be fully edited. */
- eGpencilModifierFlag_StaticOverride_Local = (1 << 0),
+ /* This modifier has been inserted in local override, and hence can be fully edited. */
+ eGpencilModifierFlag_StaticOverride_Local = (1 << 0),
} GpencilModifierFlag;
typedef struct GpencilModifierData {
- struct GpencilModifierData *next, *prev;
+ struct GpencilModifierData *next, *prev;
- int type, mode;
- int stackindex;
- short flag;
- short _pad;
- /** MAX_NAME. */
- char name[64];
+ int type, mode;
+ int stackindex;
+ short flag;
+ short _pad;
+ /** MAX_NAME. */
+ char name[64];
- char *error;
+ char *error;
} GpencilModifierData;
typedef struct NoiseGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Several flags. */
- int flag;
- /** Factor of noise. */
- float factor;
- /** How many frames before recalculate randoms. */
- int step;
- /** Last gp frame used. */
- int gp_frame;
- /** Last scene frame used. */
- int scene_frame;
- /** Random values. */
- float vrand1, vrand2;
- struct RNG *rng;
- /** Custom index for passes. */
- int layer_pass;
- char _pad[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Several flags. */
+ int flag;
+ /** Factor of noise. */
+ float factor;
+ /** How many frames before recalculate randoms. */
+ int step;
+ /** Last gp frame used. */
+ int gp_frame;
+ /** Last scene frame used. */
+ int scene_frame;
+ /** Random values. */
+ float vrand1, vrand2;
+ struct RNG *rng;
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad[4];
} NoiseGpencilModifierData;
typedef enum eNoiseGpencil_Flag {
- GP_NOISE_USE_RANDOM = (1 << 0),
- GP_NOISE_MOD_LOCATION = (1 << 1),
- GP_NOISE_MOD_STRENGTH = (1 << 2),
- GP_NOISE_MOD_THICKNESS = (1 << 3),
- GP_NOISE_FULL_STROKE = (1 << 4),
- GP_NOISE_MOVE_EXTREME = (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),
- GP_NOISE_INVERT_LAYERPASS = (1 << 10),
+ GP_NOISE_USE_RANDOM = (1 << 0),
+ GP_NOISE_MOD_LOCATION = (1 << 1),
+ GP_NOISE_MOD_STRENGTH = (1 << 2),
+ GP_NOISE_MOD_THICKNESS = (1 << 3),
+ GP_NOISE_FULL_STROKE = (1 << 4),
+ GP_NOISE_MOVE_EXTREME = (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),
+ GP_NOISE_INVERT_LAYERPASS = (1 << 10),
} eNoiseGpencil_Flag;
typedef struct SubdivGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Factor of subdivision. */
- int level;
- /** Custom index for passes. */
- int layer_pass;
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Factor of subdivision. */
+ int level;
+ /** Custom index for passes. */
+ int layer_pass;
} SubdivGpencilModifierData;
typedef enum eSubdivGpencil_Flag {
- GP_SUBDIV_SIMPLE = (1 << 0),
- GP_SUBDIV_INVERT_LAYER = (1 << 1),
- GP_SUBDIV_INVERT_PASS = (1 << 2),
- GP_SUBDIV_INVERT_LAYERPASS = (1 << 3),
+ GP_SUBDIV_SIMPLE = (1 << 0),
+ GP_SUBDIV_INVERT_LAYER = (1 << 1),
+ GP_SUBDIV_INVERT_PASS = (1 << 2),
+ GP_SUBDIV_INVERT_LAYERPASS = (1 << 3),
} eSubdivGpencil_Flag;
typedef struct ThickGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Thickness change. */
- int thickness;
- /** Custom index for passes. */
- int layer_pass;
- struct CurveMapping *curve_thickness;
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Thickness change. */
+ int thickness;
+ /** Custom index for passes. */
+ int layer_pass;
+ struct CurveMapping *curve_thickness;
} ThickGpencilModifierData;
typedef enum eThickGpencil_Flag {
- GP_THICK_INVERT_LAYER = (1 << 0),
- GP_THICK_INVERT_PASS = (1 << 1),
- GP_THICK_INVERT_VGROUP = (1 << 2),
- GP_THICK_CUSTOM_CURVE = (1 << 3),
- GP_THICK_NORMALIZE = (1 << 4),
- GP_THICK_INVERT_LAYERPASS = (1 << 5),
+ GP_THICK_INVERT_LAYER = (1 << 0),
+ GP_THICK_INVERT_PASS = (1 << 1),
+ GP_THICK_INVERT_VGROUP = (1 << 2),
+ GP_THICK_CUSTOM_CURVE = (1 << 3),
+ GP_THICK_NORMALIZE = (1 << 4),
+ GP_THICK_INVERT_LAYERPASS = (1 << 5),
} eThickGpencil_Flag;
typedef struct TimeGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Custom index for passes. */
- int layer_pass;
- /** Flags. */
- int flag;
- int offset;
- /** Animation scale. */
- float frame_scale;
- int mode;
- /** Start and end frame for custom range. */
- int sfra, efra;
- char _pad[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int layer_pass;
+ /** Flags. */
+ int flag;
+ int offset;
+ /** Animation scale. */
+ float frame_scale;
+ int mode;
+ /** Start and end frame for custom range. */
+ int sfra, efra;
+ char _pad[4];
} TimeGpencilModifierData;
typedef enum eTimeGpencil_Flag {
- GP_TIME_INVERT_LAYER = (1 << 0),
- GP_TIME_KEEP_LOOP = (1 << 1),
- GP_TIME_INVERT_LAYERPASS = (1 << 2),
- GP_TIME_CUSTOM_RANGE = (1 << 3),
+ GP_TIME_INVERT_LAYER = (1 << 0),
+ GP_TIME_KEEP_LOOP = (1 << 1),
+ GP_TIME_INVERT_LAYERPASS = (1 << 2),
+ GP_TIME_CUSTOM_RANGE = (1 << 3),
} eTimeGpencil_Flag;
typedef enum eTimeGpencil_Mode {
- GP_TIME_MODE_NORMAL = 0,
- GP_TIME_MODE_REVERSE = 1,
- GP_TIME_MODE_FIX = 2,
+ GP_TIME_MODE_NORMAL = 0,
+ GP_TIME_MODE_REVERSE = 1,
+ GP_TIME_MODE_FIX = 2,
} eTimeGpencil_Mode;
-
typedef enum eModifyColorGpencil_Flag {
- GP_MODIFY_COLOR_BOTH = 0,
- GP_MODIFY_COLOR_STROKE = 1,
- GP_MODIFY_COLOR_FILL = 2,
+ GP_MODIFY_COLOR_BOTH = 0,
+ GP_MODIFY_COLOR_STROKE = 1,
+ GP_MODIFY_COLOR_FILL = 2,
} eModifyColorGpencil_Flag;
typedef struct TintGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Tint color. */
- float rgb[3];
- /** Mix factor. */
- float factor;
- /** Modify stroke, fill or both. */
- char modify_color;
- char _pad[7];
- /** Custom index for passes. */
- int layer_pass;
- char _pad1[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Tint color. */
+ float rgb[3];
+ /** Mix factor. */
+ float factor;
+ /** Modify stroke, fill or both. */
+ char modify_color;
+ char _pad[7];
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad1[4];
} TintGpencilModifierData;
typedef enum eTintGpencil_Flag {
- GP_TINT_CREATE_COLORS = (1 << 0),
- GP_TINT_INVERT_LAYER = (1 << 1),
- GP_TINT_INVERT_PASS = (1 << 2),
- GP_TINT_INVERT_LAYERPASS = (1 << 3),
+ GP_TINT_CREATE_COLORS = (1 << 0),
+ GP_TINT_INVERT_LAYER = (1 << 1),
+ GP_TINT_INVERT_PASS = (1 << 2),
+ GP_TINT_INVERT_LAYERPASS = (1 << 3),
} eTintGpencil_Flag;
typedef struct ColorGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Hsv factors. */
- float hsv[3];
- /** Modify stroke, fill or both. */
- char modify_color;
- char _pad[3];
- /** Custom index for passes. */
- int layer_pass;
- char _pad1[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Hsv factors. */
+ float hsv[3];
+ /** Modify stroke, fill or both. */
+ char modify_color;
+ char _pad[3];
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad1[4];
} ColorGpencilModifierData;
typedef enum eColorGpencil_Flag {
- GP_COLOR_CREATE_COLORS = (1 << 0),
- GP_COLOR_INVERT_LAYER = (1 << 1),
- GP_COLOR_INVERT_PASS = (1 << 2),
- GP_COLOR_INVERT_LAYERPASS = (1 << 3),
+ GP_COLOR_CREATE_COLORS = (1 << 0),
+ GP_COLOR_INVERT_LAYER = (1 << 1),
+ GP_COLOR_INVERT_PASS = (1 << 2),
+ GP_COLOR_INVERT_LAYERPASS = (1 << 3),
} eColorGpencil_Flag;
typedef struct OpacityGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Main Opacity factor. */
- float factor;
- /** Modify stroke, fill or both. */
- char modify_color;
- char _pad[3];
- /** Custom index for passes. */
- int layer_pass;
- char _pad1[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Main Opacity factor. */
+ float factor;
+ /** Modify stroke, fill or both. */
+ char modify_color;
+ char _pad[3];
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad1[4];
} OpacityGpencilModifierData;
typedef enum eOpacityGpencil_Flag {
- GP_OPACITY_INVERT_LAYER = (1 << 0),
- GP_OPACITY_INVERT_PASS = (1 << 1),
- GP_OPACITY_INVERT_VGROUP = (1 << 2),
- GP_OPACITY_CREATE_COLORS = (1 << 3),
- GP_OPACITY_INVERT_LAYERPASS = (1 << 4),
+ GP_OPACITY_INVERT_LAYER = (1 << 0),
+ GP_OPACITY_INVERT_PASS = (1 << 1),
+ GP_OPACITY_INVERT_VGROUP = (1 << 2),
+ GP_OPACITY_CREATE_COLORS = (1 << 3),
+ GP_OPACITY_INVERT_LAYERPASS = (1 << 4),
} eOpacityGpencil_Flag;
typedef struct ArrayGpencilModifierData {
- GpencilModifierData modifier;
- struct Object *object;
- /** Number of elements in array. */
- int count;
- /** Several flags. */
- int flag;
- /** Location increments. */
- float offset[3];
- /** Shift increment. */
- float shift[3];
- /** Random size factor. */
- float rnd_size;
- /** Random size factor. */
- float rnd_rot;
- /** Rotation changes. */
- float rot[3];
- /** Scale changes. */
- float scale[3];
- /** (first element is the index) random values. */
- float rnd[20];
- char _pad[4];
-
- /** Custom index for passes. */
- int pass_index;
- /** Layer name. */
- char layername[64];
- /** Material replace (0 keep default). */
- int mat_rpl;
- /** Custom index for passes. */
- int layer_pass;
+ GpencilModifierData modifier;
+ struct Object *object;
+ /** Number of elements in array. */
+ int count;
+ /** Several flags. */
+ int flag;
+ /** Location increments. */
+ float offset[3];
+ /** Shift increment. */
+ float shift[3];
+ /** Random size factor. */
+ float rnd_size;
+ /** Random size factor. */
+ float rnd_rot;
+ /** Rotation changes. */
+ float rot[3];
+ /** Scale changes. */
+ float scale[3];
+ /** (first element is the index) random values. */
+ float rnd[20];
+ char _pad[4];
+
+ /** Custom index for passes. */
+ int pass_index;
+ /** Layer name. */
+ char layername[64];
+ /** Material replace (0 keep default). */
+ int mat_rpl;
+ /** Custom index for passes. */
+ int layer_pass;
} ArrayGpencilModifierData;
typedef enum eArrayGpencil_Flag {
- GP_ARRAY_RANDOM_SIZE = (1 << 0),
- GP_ARRAY_RANDOM_ROT = (1 << 1),
- GP_ARRAY_INVERT_LAYER = (1 << 2),
- GP_ARRAY_INVERT_PASS = (1 << 3),
- GP_ARRAY_KEEP_ONTOP = (1 << 4),
- GP_ARRAY_INVERT_LAYERPASS = (1 << 5),
+ GP_ARRAY_RANDOM_SIZE = (1 << 0),
+ GP_ARRAY_RANDOM_ROT = (1 << 1),
+ GP_ARRAY_INVERT_LAYER = (1 << 2),
+ GP_ARRAY_INVERT_PASS = (1 << 3),
+ GP_ARRAY_KEEP_ONTOP = (1 << 4),
+ GP_ARRAY_INVERT_LAYERPASS = (1 << 5),
} eArrayGpencil_Flag;
typedef struct BuildGpencilModifierData {
- GpencilModifierData modifier;
-
- /** If set, restrict modifier to operating on this layer. */
- char layername[64];
- int pass_index;
-
- /** Custom index for passes. */
- int layer_pass;
-
- /**
- * If GP_BUILD_RESTRICT_TIME is set,
- * the defines the frame range where GP frames are considered.
- */
- float start_frame;
- float end_frame;
-
- /** For each pair of gp keys, number of frames before strokes start appearing. */
- float start_delay;
- /** For each pair of gp keys, number of frames that build effect must be completed within. */
- float length;
-
- /** (eGpencilBuild_Flag) Options for controlling modifier behavior. */
- short flag;
-
- /** (eGpencilBuild_Mode) How are strokes ordered. */
- short mode;
- /** (eGpencilBuild_Transition) In what order do stroke points appear/disappear. */
- short transition;
-
- /**
- * (eGpencilBuild_TimeAlignment)
- * For the "Concurrent" mode, when should "shorter" strips start/end.
- */
- short time_alignment;
+ GpencilModifierData modifier;
+
+ /** If set, restrict modifier to operating on this layer. */
+ char layername[64];
+ int pass_index;
+
+ /** Custom index for passes. */
+ int layer_pass;
+
+ /**
+ * If GP_BUILD_RESTRICT_TIME is set,
+ * the defines the frame range where GP frames are considered.
+ */
+ float start_frame;
+ float end_frame;
+
+ /** For each pair of gp keys, number of frames before strokes start appearing. */
+ float start_delay;
+ /** For each pair of gp keys, number of frames that build effect must be completed within. */
+ float length;
+
+ /** (eGpencilBuild_Flag) Options for controlling modifier behavior. */
+ short flag;
+
+ /** (eGpencilBuild_Mode) How are strokes ordered. */
+ short mode;
+ /** (eGpencilBuild_Transition) In what order do stroke points appear/disappear. */
+ short transition;
+
+ /**
+ * (eGpencilBuild_TimeAlignment)
+ * For the "Concurrent" mode, when should "shorter" strips start/end.
+ */
+ short time_alignment;
} BuildGpencilModifierData;
typedef enum eBuildGpencil_Mode {
- /* Strokes are shown one by one until all have appeared */
- GP_BUILD_MODE_SEQUENTIAL = 0,
- /* All strokes start at the same time */
- GP_BUILD_MODE_CONCURRENT = 1,
+ /* Strokes are shown one by one until all have appeared */
+ GP_BUILD_MODE_SEQUENTIAL = 0,
+ /* All strokes start at the same time */
+ GP_BUILD_MODE_CONCURRENT = 1,
} eBuildGpencil_Mode;
typedef enum eBuildGpencil_Transition {
- /* Show in forward order */
- GP_BUILD_TRANSITION_GROW = 0,
- /* Hide in reverse order */
- GP_BUILD_TRANSITION_SHRINK = 1,
- /* Hide in forward order */
- GP_BUILD_TRANSITION_FADE = 2,
+ /* Show in forward order */
+ GP_BUILD_TRANSITION_GROW = 0,
+ /* Hide in reverse order */
+ GP_BUILD_TRANSITION_SHRINK = 1,
+ /* Hide in forward order */
+ GP_BUILD_TRANSITION_FADE = 2,
} eBuildGpencil_Transition;
typedef enum eBuildGpencil_TimeAlignment {
- /* All strokes start at same time */
- GP_BUILD_TIMEALIGN_START = 0,
- /* All strokes end at same time */
- GP_BUILD_TIMEALIGN_END = 1,
+ /* All strokes start at same time */
+ GP_BUILD_TIMEALIGN_START = 0,
+ /* All strokes end at same time */
+ GP_BUILD_TIMEALIGN_END = 1,
- /* TODO: Random Offsets, Stretch-to-Fill */
+ /* TODO: Random Offsets, Stretch-to-Fill */
} eBuildGpencil_TimeAlignment;
typedef enum eBuildGpencil_Flag {
- /* Restrict modifier to particular layer/passes? */
- GP_BUILD_INVERT_LAYER = (1 << 0),
- GP_BUILD_INVERT_PASS = (1 << 1),
+ /* Restrict modifier to particular layer/passes? */
+ GP_BUILD_INVERT_LAYER = (1 << 0),
+ GP_BUILD_INVERT_PASS = (1 << 1),
- /* Restrict modifier to only operating between the nominated frames */
- GP_BUILD_RESTRICT_TIME = (1 << 2),
- GP_BUILD_INVERT_LAYERPASS = (1 << 3),
+ /* Restrict modifier to only operating between the nominated frames */
+ GP_BUILD_RESTRICT_TIME = (1 << 2),
+ GP_BUILD_INVERT_LAYERPASS = (1 << 3),
} eBuildGpencil_Flag;
typedef struct LatticeGpencilModifierData {
- GpencilModifierData modifier;
- struct Object *object;
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- float strength;
- /** Custom index for passes. */
- int layer_pass;
- /** Runtime only (LatticeDeformData). */
- void *cache_data;
+ GpencilModifierData modifier;
+ struct Object *object;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ float strength;
+ /** Custom index for passes. */
+ int layer_pass;
+ /** Runtime only (LatticeDeformData). */
+ void *cache_data;
} LatticeGpencilModifierData;
typedef enum eLatticeGpencil_Flag {
- GP_LATTICE_INVERT_LAYER = (1 << 0),
- GP_LATTICE_INVERT_PASS = (1 << 1),
- GP_LATTICE_INVERT_VGROUP = (1 << 2),
- GP_LATTICE_INVERT_LAYERPASS = (1 << 3),
+ GP_LATTICE_INVERT_LAYER = (1 << 0),
+ GP_LATTICE_INVERT_PASS = (1 << 1),
+ GP_LATTICE_INVERT_VGROUP = (1 << 2),
+ GP_LATTICE_INVERT_LAYERPASS = (1 << 3),
} eLatticeGpencil_Flag;
typedef struct MirrorGpencilModifierData {
- GpencilModifierData modifier;
- struct Object *object;
- /** Layer name. */
- char layername[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Custom index for passes. */
- int layer_pass;
- char _pad[4];
+ GpencilModifierData modifier;
+ struct Object *object;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad[4];
} MirrorGpencilModifierData;
typedef enum eMirrorGpencil_Flag {
- GP_MIRROR_INVERT_LAYER = (1 << 0),
- GP_MIRROR_INVERT_PASS = (1 << 1),
- GP_MIRROR_CLIPPING = (1 << 2),
- GP_MIRROR_AXIS_X = (1 << 3),
- GP_MIRROR_AXIS_Y = (1 << 4),
- GP_MIRROR_AXIS_Z = (1 << 5),
- GP_MIRROR_INVERT_LAYERPASS = (1 << 6),
+ GP_MIRROR_INVERT_LAYER = (1 << 0),
+ GP_MIRROR_INVERT_PASS = (1 << 1),
+ GP_MIRROR_CLIPPING = (1 << 2),
+ GP_MIRROR_AXIS_X = (1 << 3),
+ GP_MIRROR_AXIS_Y = (1 << 4),
+ GP_MIRROR_AXIS_Z = (1 << 5),
+ GP_MIRROR_INVERT_LAYERPASS = (1 << 6),
} eMirrorGpencil_Flag;
typedef struct HookGpencilModifierData {
- GpencilModifierData modifier;
-
- struct Object *object;
- /** Optional name of bone target, MAX_ID_NAME-2. */
- char subtarget[64];
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Custom index for passes. */
- int layer_pass;
- char _pad[4];
-
- int flag;
- /** Use enums from WarpGpencilModifier (exact same functionality). */
- char falloff_type;
- char _pad1[3];
- /** Matrix making current transform unmodified. */
- float parentinv[4][4];
- /** Visualization of hook. */
- float cent[3];
- /** If not zero, falloff is distance where influence zero. */
- float falloff;
- float force;
- struct CurveMapping *curfalloff;
+ GpencilModifierData modifier;
+
+ struct Object *object;
+ /** Optional name of bone target, MAX_ID_NAME-2. */
+ char subtarget[64];
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad[4];
+
+ int flag;
+ /** Use enums from WarpGpencilModifier (exact same functionality). */
+ char falloff_type;
+ char _pad1[3];
+ /** Matrix making current transform unmodified. */
+ float parentinv[4][4];
+ /** Visualization of hook. */
+ float cent[3];
+ /** If not zero, falloff is distance where influence zero. */
+ float falloff;
+ float force;
+ struct CurveMapping *curfalloff;
} HookGpencilModifierData;
typedef enum eHookGpencil_Flag {
- GP_HOOK_INVERT_LAYER = (1 << 0),
- GP_HOOK_INVERT_PASS = (1 << 1),
- GP_HOOK_INVERT_VGROUP = (1 << 2),
- GP_HOOK_UNIFORM_SPACE = (1 << 3),
- GP_HOOK_INVERT_LAYERPASS = (1 << 4),
+ GP_HOOK_INVERT_LAYER = (1 << 0),
+ GP_HOOK_INVERT_PASS = (1 << 1),
+ GP_HOOK_INVERT_VGROUP = (1 << 2),
+ GP_HOOK_UNIFORM_SPACE = (1 << 3),
+ GP_HOOK_INVERT_LAYERPASS = (1 << 4),
} eHookGpencil_Flag;
typedef enum eHookGpencil_Falloff {
- eGPHook_Falloff_None = 0,
- eGPHook_Falloff_Curve = 1,
- eGPHook_Falloff_Sharp = 2,
- eGPHook_Falloff_Smooth = 3,
- eGPHook_Falloff_Root = 4,
- eGPHook_Falloff_Linear = 5,
- eGPHook_Falloff_Const = 6,
- eGPHook_Falloff_Sphere = 7,
- eGPHook_Falloff_InvSquare = 8,
+ eGPHook_Falloff_None = 0,
+ eGPHook_Falloff_Curve = 1,
+ eGPHook_Falloff_Sharp = 2,
+ eGPHook_Falloff_Smooth = 3,
+ eGPHook_Falloff_Root = 4,
+ eGPHook_Falloff_Linear = 5,
+ eGPHook_Falloff_Const = 6,
+ eGPHook_Falloff_Sphere = 7,
+ eGPHook_Falloff_InvSquare = 8,
} eHookGpencil_Falloff;
typedef struct SimplifyGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- /** Factor of simplify. */
- float factor;
- /** Type of simplify. */
- short mode;
- /** Every n vertex to keep. */
- short step;
- /** Custom index for passes. */
- int layer_pass;
- char _pad[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Factor of simplify. */
+ float factor;
+ /** Type of simplify. */
+ short mode;
+ /** Every n vertex to keep. */
+ short step;
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad[4];
} SimplifyGpencilModifierData;
typedef enum eSimplifyGpencil_Flag {
- GP_SIMPLIFY_INVERT_LAYER = (1 << 0),
- GP_SIMPLIFY_INVERT_PASS = (1 << 1),
- GP_SIMPLIFY_INVERT_LAYERPASS = (1 << 2),
+ GP_SIMPLIFY_INVERT_LAYER = (1 << 0),
+ GP_SIMPLIFY_INVERT_PASS = (1 << 1),
+ GP_SIMPLIFY_INVERT_LAYERPASS = (1 << 2),
} eSimplifyGpencil_Flag;
typedef enum eSimplifyGpencil_Mode {
- /* Keep only one vertex every n vertices */
- GP_SIMPLIFY_FIXED = 0,
- /* Use RDP algorithm */
- GP_SIMPLIFY_ADAPTIVE = 1,
+ /* Keep only one vertex every n vertices */
+ GP_SIMPLIFY_FIXED = 0,
+ /* Use RDP algorithm */
+ GP_SIMPLIFY_ADAPTIVE = 1,
} eSimplifyGpencil_Mode;
typedef struct OffsetGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Flags. */
- int flag;
- float loc[3];
- float rot[3];
- float scale[3];
- /** Custom index for passes. */
- int layer_pass;
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ float loc[3];
+ float rot[3];
+ float scale[3];
+ /** Custom index for passes. */
+ int layer_pass;
} OffsetGpencilModifierData;
typedef enum eOffsetGpencil_Flag {
- GP_OFFSET_INVERT_LAYER = (1 << 0),
- GP_OFFSET_INVERT_PASS = (1 << 1),
- GP_OFFSET_INVERT_VGROUP = (1 << 2),
- GP_OFFSET_INVERT_LAYERPASS = (1 << 3),
+ GP_OFFSET_INVERT_LAYER = (1 << 0),
+ GP_OFFSET_INVERT_PASS = (1 << 1),
+ GP_OFFSET_INVERT_VGROUP = (1 << 2),
+ GP_OFFSET_INVERT_LAYERPASS = (1 << 3),
} eOffsetGpencil_Flag;
typedef struct SmoothGpencilModifierData {
- GpencilModifierData modifier;
- /** Layer name. */
- char layername[64];
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgname[64];
- /** Custom index for passes. */
- int pass_index;
- /** Several flags. */
- int flag;
- /** Factor of noise. */
- float factor;
- /** How many times apply smooth. */
- int step;
- /** Custom index for passes. */
- int layer_pass;
- char _pad[4];
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Several flags. */
+ int flag;
+ /** Factor of noise. */
+ float factor;
+ /** How many times apply smooth. */
+ int step;
+ /** Custom index for passes. */
+ int layer_pass;
+ char _pad[4];
} SmoothGpencilModifierData;
typedef enum eSmoothGpencil_Flag {
- GP_SMOOTH_MOD_LOCATION = (1 << 0),
- GP_SMOOTH_MOD_STRENGTH = (1 << 1),
- GP_SMOOTH_MOD_THICKNESS = (1 << 2),
- GP_SMOOTH_INVERT_LAYER = (1 << 3),
- GP_SMOOTH_INVERT_PASS = (1 << 4),
- GP_SMOOTH_INVERT_VGROUP = (1 << 5),
- GP_SMOOTH_MOD_UV = (1 << 6),
- GP_SMOOTH_INVERT_LAYERPASS = (1 << 7),
+ GP_SMOOTH_MOD_LOCATION = (1 << 0),
+ GP_SMOOTH_MOD_STRENGTH = (1 << 1),
+ GP_SMOOTH_MOD_THICKNESS = (1 << 2),
+ GP_SMOOTH_INVERT_LAYER = (1 << 3),
+ GP_SMOOTH_INVERT_PASS = (1 << 4),
+ GP_SMOOTH_INVERT_VGROUP = (1 << 5),
+ GP_SMOOTH_MOD_UV = (1 << 6),
+ GP_SMOOTH_INVERT_LAYERPASS = (1 << 7),
} eSmoothGpencil_Flag;
typedef struct ArmatureGpencilModifierData {
- GpencilModifierData modifier;
- /** Deformflag replaces armature->deformflag. */
- short deformflag, multi;
- int _pad;
- struct Object *object;
- /** Stored input of previous modifier, for vertexgroup blending. */
- float *prevCos;
- /** MAX_VGROUP_NAME. */
- char vgname[64];
+ GpencilModifierData modifier;
+ /** Deformflag replaces armature->deformflag. */
+ short deformflag, multi;
+ int _pad;
+ struct Object *object;
+ /** Stored input of previous modifier, for vertexgroup blending. */
+ float *prevCos;
+ /** MAX_VGROUP_NAME. */
+ char vgname[64];
} ArmatureGpencilModifierData;
-#endif /* __DNA_GPENCIL_MODIFIER_TYPES_H__ */
+#endif /* __DNA_GPENCIL_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 6ac48c72505..f39676f53ad 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -43,12 +43,12 @@ struct MDeformVert;
/* 'Control Point' data for primitives and curves */
typedef struct bGPDcontrolpoint {
- /** X and y coordinates of control point. */
- float x, y, z;
- /** Point color. */
- float color[4];
- /** Radius. */
- int size;
+ /** X and y coordinates of control point. */
+ float x, y, z;
+ /** Point color. */
+ float color[4];
+ /** Radius. */
+ int size;
} bGPDcontrolpoint;
/* Grease-Pencil Annotations - 'Stroke Point'
@@ -57,32 +57,32 @@ typedef struct bGPDcontrolpoint {
* This assumes that the bottom-left corner is (0,0)
*/
typedef struct bGPDspoint {
- /** Co-ordinates of point (usually 2d, but can be 3d as well). */
- float x, y, z;
- /** Pressure of input device (from 0 to 1) at this point. */
- float pressure;
- /** Color strength (used for alpha factor). */
- float strength;
- /** Seconds since start of stroke. */
- float time;
- /** Additional options. */
- int flag;
-
- /** Factor of uv along the stroke. */
- float uv_fac;
- /** Uv rotation for dot mode. */
- float uv_rot;
+ /** Co-ordinates of point (usually 2d, but can be 3d as well). */
+ float x, y, z;
+ /** Pressure of input device (from 0 to 1) at this point. */
+ float pressure;
+ /** Color strength (used for alpha factor). */
+ float strength;
+ /** Seconds since start of stroke. */
+ float time;
+ /** Additional options. */
+ int flag;
+
+ /** Factor of uv along the stroke. */
+ float uv_fac;
+ /** Uv rotation for dot mode. */
+ float uv_rot;
} bGPDspoint;
/* bGPDspoint->flag */
typedef enum eGPDspoint_Flag {
- /* stroke point is selected (for editing) */
- GP_SPOINT_SELECT = (1 << 0),
+ /* stroke point is selected (for editing) */
+ GP_SPOINT_SELECT = (1 << 0),
- /* stroke point is tagged (for some editing operation) */
- GP_SPOINT_TAG = (1 << 1),
- /* stroke point is temp tagged (for some editing operation) */
- GP_SPOINT_TEMP_TAG = (1 << 2),
+ /* stroke point is tagged (for some editing operation) */
+ GP_SPOINT_TAG = (1 << 1),
+ /* stroke point is temp tagged (for some editing operation) */
+ GP_SPOINT_TEMP_TAG = (1 << 2),
} eGPSPoint_Flag;
/* ***************************************** */
@@ -93,10 +93,10 @@ typedef enum eGPDspoint_Flag {
* This is only used if high quality fill is enabled
*/
typedef struct bGPDtriangle {
- /* indices for tessellated triangle used for GP Fill */
- unsigned int verts[3];
- /* texture coordinates for verts */
- float uv[3][2];
+ /* indices for tessellated triangle used for GP Fill */
+ unsigned int verts[3];
+ /* texture coordinates for verts */
+ float uv[3][2];
} bGPDtriangle;
/* ***************************************** */
@@ -106,49 +106,50 @@ typedef struct bGPDtriangle {
/* color of palettes */
typedef struct bGPDpalettecolor {
- struct bGPDpalettecolor *next, *prev;
- /** 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. */
- short flag;
- /** Padding for compiler alignment error. */
- char _pad[6];
+ struct bGPDpalettecolor *next, *prev;
+ /** 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. */
+ short flag;
+ /** Padding for compiler alignment error. */
+ char _pad[6];
} bGPDpalettecolor;
/* bGPDpalettecolor->flag */
typedef enum eGPDpalettecolor_Flag {
- /* color is active */
- PC_COLOR_ACTIVE = (1 << 0),
- /* 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),
+ /* color is active */
+ PC_COLOR_ACTIVE = (1 << 0),
+ /* 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),
} eGPDpalettecolor_Flag;
/* palette of colors */
typedef struct bGPDpalette {
- struct bGPDpalette *next, *prev;
+ struct bGPDpalette *next, *prev;
- /** Pointer to individual colours. */
- ListBase colors;
- /** Palette name. Must be unique. */
- char info[64];
+ /** Pointer to individual colours. */
+ ListBase colors;
+ /** Palette name. Must be unique. */
+ char info[64];
- short flag;
- char _pad[6];
+ short flag;
+ char _pad[6];
} bGPDpalette;
/* bGPDpalette->flag */
typedef enum eGPDpalette_Flag {
- /* palette is active */
-A, PL_PALETTE_ACTIVE = (1 << 0)
+ /* palette is active */
+ A,
+ PL_PALETTE_ACTIVE = (1 << 0)
} eGPDpalette_Flag;
/* ***************************************** */
@@ -156,15 +157,15 @@ A, PL_PALETTE_ACTIVE = (1 << 0)
/* Runtime temp data for bGPDstroke */
typedef struct bGPDstroke_Runtime {
- /* runtime final colors (result of original colors and modifiers) */
- float tmp_stroke_rgba[4];
- float tmp_fill_rgba[4];
+ /* runtime final colors (result of original colors and modifiers) */
+ float tmp_stroke_rgba[4];
+ float tmp_fill_rgba[4];
- /* temporary layer name only used during copy/paste to put the stroke in the original layer */
- char tmp_layerinfo[128];
+ /* 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;
+ /** Runtime falloff factor (only for transform). */
+ float multi_frame_falloff;
} bGPDstroke_Runtime;
/* Grease-Pencil Annotations - 'Stroke'
@@ -172,76 +173,76 @@ typedef struct bGPDstroke_Runtime {
* drawn by the user in one 'mousedown'->'mouseup' operation
*/
typedef struct bGPDstroke {
- struct bGPDstroke *next, *prev;
-
- /** Array of data-points for stroke. */
- bGPDspoint *points;
- /** Tessellated triangles for GP Fill. */
- bGPDtriangle *triangles;
- /** Number of data-points in array. */
- int totpoints;
- /** Number of triangles in array. */
- int tot_triangles;
-
- /** Thickness of stroke. */
- short thickness;
- /** Various settings about this stroke. */
- short flag, _pad[2];
-
- /** Init time of stroke. */
- double inittime;
-
- /** Color name. */
- char colorname[128] DNA_DEPRECATED;
-
- /** Material index. */
- int mat_nr;
- /** Caps mode for each stroke extreme */
- short caps[2];
-
- /** gradient control along y for color */
- float gradient_f;
- /** factor xy of shape for dots gradients */
- float gradient_s[2];
- char _pad_3[4];
-
- /** Vertex weight data. */
- struct MDeformVert *dvert;
- void *_pad3;
-
- bGPDstroke_Runtime runtime;
- char _pad2[4];
+ struct bGPDstroke *next, *prev;
+
+ /** Array of data-points for stroke. */
+ bGPDspoint *points;
+ /** Tessellated triangles for GP Fill. */
+ bGPDtriangle *triangles;
+ /** Number of data-points in array. */
+ int totpoints;
+ /** Number of triangles in array. */
+ int tot_triangles;
+
+ /** Thickness of stroke. */
+ short thickness;
+ /** Various settings about this stroke. */
+ short flag, _pad[2];
+
+ /** Init time of stroke. */
+ double inittime;
+
+ /** Color name. */
+ char colorname[128] DNA_DEPRECATED;
+
+ /** Material index. */
+ int mat_nr;
+ /** Caps mode for each stroke extreme */
+ short caps[2];
+
+ /** gradient control along y for color */
+ float gradient_f;
+ /** factor xy of shape for dots gradients */
+ float gradient_s[2];
+ char _pad_3[4];
+
+ /** Vertex weight data. */
+ struct MDeformVert *dvert;
+ void *_pad3;
+
+ bGPDstroke_Runtime runtime;
+ char _pad2[4];
} bGPDstroke;
/* bGPDstroke->flag */
typedef enum eGPDstroke_Flag {
- /* 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),
- /* Recalculate geometry data (triangulation, UVs, Bound Box,...
- * (when true, force a new recalc) */
- GP_STROKE_RECALC_GEOMETRY = (1 << 4),
- /* 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),
- /* only for use with stroke-buffer (while drawing eraser) */
- GP_STROKE_ERASER = (1 << 15),
+ /* 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),
+ /* Recalculate geometry data (triangulation, UVs, Bound Box,...
+ * (when true, force a new recalc) */
+ GP_STROKE_RECALC_GEOMETRY = (1 << 4),
+ /* 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),
+ /* only for use with stroke-buffer (while drawing eraser) */
+ GP_STROKE_ERASER = (1 << 15),
} eGPDstroke_Flag;
/* bGPDstroke->caps */
typedef enum eGPDstroke_Caps {
- /* type of extreme */
- GP_STROKE_CAP_ROUND = 0,
- GP_STROKE_CAP_FLAT = 1,
+ /* type of extreme */
+ GP_STROKE_CAP_ROUND = 0,
+ GP_STROKE_CAP_FLAT = 1,
- GP_STROKE_CAP_MAX,
+ GP_STROKE_CAP_MAX,
} GPDstroke_Caps;
/* ***************************************** */
@@ -249,36 +250,36 @@ typedef enum eGPDstroke_Caps {
/* Runtime temp data for bGPDframe */
typedef struct bGPDframe_Runtime {
- /** Parent matrix for drawing. */
- float viewmatrix[4][4];
+ /** Parent matrix for drawing. */
+ float viewmatrix[4][4];
} bGPDframe_Runtime;
/* Grease-Pencil Annotations - 'Frame'
* -> Acts as storage for the 'image' formed by strokes
*/
typedef struct bGPDframe {
- struct bGPDframe *next, *prev;
+ struct bGPDframe *next, *prev;
- /** List of the simplified 'strokes' that make up the frame's data. */
- ListBase strokes;
+ /** List of the simplified 'strokes' that make up the frame's data. */
+ ListBase strokes;
- /** Frame number of this frame. */
- int framenum;
+ /** Frame number of this frame. */
+ int framenum;
- /** Temp settings. */
- short flag;
- /** Keyframe type (eBezTriple_KeyframeType). */
- short key_type;
+ /** Temp settings. */
+ short flag;
+ /** Keyframe type (eBezTriple_KeyframeType). */
+ short key_type;
- bGPDframe_Runtime runtime;
+ bGPDframe_Runtime runtime;
} bGPDframe;
/* bGPDframe->flag */
typedef enum eGPDframe_Flag {
- /* frame is being painted on */
- GP_FRAME_PAINT = (1 << 0),
- /* for editing in Action Editor */
- GP_FRAME_SELECT = (1 << 1),
+ /* frame is being painted on */
+ GP_FRAME_PAINT = (1 << 0),
+ /* for editing in Action Editor */
+ GP_FRAME_SELECT = (1 << 1),
} eGPDframe_Flag;
/* ***************************************** */
@@ -286,122 +287,122 @@ typedef enum eGPDframe_Flag {
/* Runtime temp data for bGPDlayer */
typedef struct bGPDlayer_Runtime {
- /** Id for dynamic icon used to show annotation color preview for layer. */
- int icon_id;
- char _pad[4];
+ /** Id for dynamic icon used to show annotation color preview for layer. */
+ int icon_id;
+ char _pad[4];
} bGPDlayer_Runtime;
/* Grease-Pencil Annotations - 'Layer' */
typedef struct bGPDlayer {
- struct bGPDlayer *next, *prev;
-
- /** List of annotations to display for frames (bGPDframe list). */
- ListBase frames;
- /** Active frame (should be the frame that is currently being displayed). */
- bGPDframe *actframe;
-
- /** Settings for layer. */
- short flag;
- /** Per-layer onion-skinning flags (eGPDlayer_OnionFlag). */
- short 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;
- /** Used to filter groups of layers in modifiers. */
- short pass_index;
-
- /** Parent object. */
- struct Object *parent;
- /** Inverse matrix (only used if parented). */
- float inverse[4][4];
- /** String describing subobject info, MAX_ID_NAME-2. */
- char parsubstr[64];
- short partype;
-
- /** Thickness adjustment. */
- short line_change;
- /** Color used to tint layer, alpha value is used as factor. */
- float tintcolor[4];
- /** Opacity of the layer. */
- float opacity;
- /** Name of the layer used to filter render output. */
- char viewlayername[64];
-
- /** Blend modes. */
- int blend_mode;
- char _pad[4];
-
- /* 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;
- /**
- * Ghosts After: max number of ghost frames to show after
- * active frame and the following it (0 = only the ghost itself).
- */
- short gstep_next;
-
- /** Color for ghosts before the active frame. */
- float gcolor_prev[3];
- /** Color for ghosts after the active frame. */
- float gcolor_next[3];
- char _pad1[4];
-
- bGPDlayer_Runtime runtime;
+ struct bGPDlayer *next, *prev;
+
+ /** List of annotations to display for frames (bGPDframe list). */
+ ListBase frames;
+ /** Active frame (should be the frame that is currently being displayed). */
+ bGPDframe *actframe;
+
+ /** Settings for layer. */
+ short flag;
+ /** Per-layer onion-skinning flags (eGPDlayer_OnionFlag). */
+ short 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;
+ /** Used to filter groups of layers in modifiers. */
+ short pass_index;
+
+ /** Parent object. */
+ struct Object *parent;
+ /** Inverse matrix (only used if parented). */
+ float inverse[4][4];
+ /** String describing subobject info, MAX_ID_NAME-2. */
+ char parsubstr[64];
+ short partype;
+
+ /** Thickness adjustment. */
+ short line_change;
+ /** Color used to tint layer, alpha value is used as factor. */
+ float tintcolor[4];
+ /** Opacity of the layer. */
+ float opacity;
+ /** Name of the layer used to filter render output. */
+ char viewlayername[64];
+
+ /** Blend modes. */
+ int blend_mode;
+ char _pad[4];
+
+ /* 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;
+ /**
+ * Ghosts After: max number of ghost frames to show after
+ * active frame and the following it (0 = only the ghost itself).
+ */
+ short gstep_next;
+
+ /** Color for ghosts before the active frame. */
+ float gcolor_prev[3];
+ /** Color for ghosts after the active frame. */
+ float gcolor_next[3];
+ char _pad1[4];
+
+ bGPDlayer_Runtime runtime;
} bGPDlayer;
/* bGPDlayer->flag */
typedef enum eGPDlayer_Flag {
- /* 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),
- /* 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 xray (which is default) */
- GP_LAYER_NO_XRAY = (1 << 7),
- /* "volumetric" strokes */
- GP_LAYER_VOLUMETRIC = (1 << 10),
- /* Unlock color */
- GP_LAYER_UNLOCK_COLOR = (1 << 12),
- /* Mask Layer */
- GP_LAYER_USE_MASK = (1 << 13),
- /* Flag used to display in Paint mode only layers with keyframe */
- GP_LAYER_SOLO_MODE = (1 << 4),
+ /* 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),
+ /* 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 xray (which is default) */
+ GP_LAYER_NO_XRAY = (1 << 7),
+ /* "volumetric" strokes */
+ GP_LAYER_VOLUMETRIC = (1 << 10),
+ /* Unlock color */
+ GP_LAYER_UNLOCK_COLOR = (1 << 12),
+ /* Mask Layer */
+ GP_LAYER_USE_MASK = (1 << 13),
+ /* Flag used to display in Paint mode only layers with keyframe */
+ GP_LAYER_SOLO_MODE = (1 << 4),
} eGPDlayer_Flag;
/* bGPDlayer->onion_flag */
typedef enum eGPDlayer_OnionFlag {
- /* do onion skinning */
- GP_LAYER_ONIONSKIN = (1 << 0),
+ /* do onion skinning */
+ GP_LAYER_ONIONSKIN = (1 << 0),
} eGPDlayer_OnionFlag;
/* layer blend_mode */
typedef enum eGPLayerBlendModes {
- eGplBlendMode_Normal = 0,
- eGplBlendMode_Overlay = 1,
- eGplBlendMode_Add = 2,
- eGplBlendMode_Subtract = 3,
- eGplBlendMode_Multiply = 4,
- eGplBlendMode_Divide = 5,
+ eGplBlendMode_Normal = 0,
+ eGplBlendMode_Overlay = 1,
+ eGplBlendMode_Add = 2,
+ eGplBlendMode_Subtract = 3,
+ eGplBlendMode_Multiply = 4,
+ eGplBlendMode_Divide = 5,
} eGPLayerBlendModes;
/* ***************************************** */
@@ -409,119 +410,119 @@ typedef enum eGPLayerBlendModes {
/* Runtime temp data for bGPdata */
typedef struct bGPdata_Runtime {
- /** Last region where drawing was originated. */
- struct ARegion *ar;
- /** Stroke buffer (can hold GP_STROKE_BUFFER_MAX). */
- void *sbuffer;
-
- /* GP Object drawing */
- /** Buffer stroke color. */
- float scolor[4];
- /** Buffer fill color. */
- float sfill[4];
- /** Settings for color. */
- short mode;
- /** Buffer style for drawing strokes (used to select shader type). */
- short bstroke_style;
- /** Buffer style for filling areas (used to select shader type). */
- short bfill_style;
-
- /* Stroke Buffer data (only used during paint-session)
- * - buffer must be initialized before use, but freed after
- * whole paint operation is over
- */
- /** Number of elements currently in cache. */
- short sbuffer_size;
- /** Flags for stroke that cache represents. */
- short sbuffer_sflag;
- char _pad[6];
-
- /** Number of control-points for stroke. */
- int tot_cp_points;
- char _pad1_[4];
- /** Array of control-points for stroke. */
- bGPDcontrolpoint *cp_points;
+ /** Last region where drawing was originated. */
+ struct ARegion *ar;
+ /** Stroke buffer (can hold GP_STROKE_BUFFER_MAX). */
+ void *sbuffer;
+
+ /* GP Object drawing */
+ /** Buffer stroke color. */
+ float scolor[4];
+ /** Buffer fill color. */
+ float sfill[4];
+ /** Settings for color. */
+ short mode;
+ /** Buffer style for drawing strokes (used to select shader type). */
+ short bstroke_style;
+ /** Buffer style for filling areas (used to select shader type). */
+ short bfill_style;
+
+ /* Stroke Buffer data (only used during paint-session)
+ * - buffer must be initialized before use, but freed after
+ * whole paint operation is over
+ */
+ /** Number of elements currently in cache. */
+ short sbuffer_size;
+ /** Flags for stroke that cache represents. */
+ short sbuffer_sflag;
+ char _pad[6];
+
+ /** Number of control-points for stroke. */
+ int tot_cp_points;
+ char _pad1_[4];
+ /** Array of control-points for stroke. */
+ bGPDcontrolpoint *cp_points;
} bGPdata_Runtime;
/* grid configuration */
typedef struct bGPgrid {
- float color[3];
- float scale[2];
- float offset[2];
- char _pad1[4];
+ float color[3];
+ float scale[2];
+ float offset[2];
+ char _pad1[4];
- int lines;
- char _pad[4];
+ int lines;
+ char _pad[4];
} bGPgrid;
/* Grease-Pencil Annotations - 'DataBlock' */
typedef struct bGPdata {
- /** Grease Pencil data is a datablock. */
- ID id;
- /** Animation data - for animating draw settings. */
- struct AnimData *adt;
-
- /* Grease-Pencil data */
- /** BGPDlayers. */
- ListBase layers;
- /** Settings for this datablock. */
- int flag;
-
- char _pad1[4];
-
- /* Palettes */
- /** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */
- ListBase palettes DNA_DEPRECATED;
-
- /* 3D Viewport/Appearance Settings */
- /** Factor to define pixel size conversion. */
- float pixfactor;
- /** Color for edit line. */
- float line_color[4];
-
- /* Onion skinning */
- /** Onion alpha factor change. */
- float onion_factor;
- /** Onion skinning range (eGP_OnionModes). */
- int onion_mode;
- /** Onion skinning flags (eGPD_OnionFlag). */
- int 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;
- /** Ghosts After: max number of ghost frames to show after
- * active frame and the following it (0 = only the ghost itself).
- */
- short gstep_next;
-
- /** 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;
- /** Materials array. */
- struct Material **mat;
- /** Total materials. */
- short totcol;
-
- /* stats */
- short totlayer;
- short totframe;
- char _pad2[6];
- int totstroke;
- int totpoint;
-
- /** Draw mode for strokes (eGP_DrawMode). */
- short draw_mode;
- char _pad3[2];
-
- bGPgrid grid;
-
- bGPdata_Runtime runtime;
+ /** Grease Pencil data is a datablock. */
+ ID id;
+ /** Animation data - for animating draw settings. */
+ struct AnimData *adt;
+
+ /* Grease-Pencil data */
+ /** BGPDlayers. */
+ ListBase layers;
+ /** Settings for this datablock. */
+ int flag;
+
+ char _pad1[4];
+
+ /* Palettes */
+ /** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */
+ ListBase palettes DNA_DEPRECATED;
+
+ /* 3D Viewport/Appearance Settings */
+ /** Factor to define pixel size conversion. */
+ float pixfactor;
+ /** Color for edit line. */
+ float line_color[4];
+
+ /* Onion skinning */
+ /** Onion alpha factor change. */
+ float onion_factor;
+ /** Onion skinning range (eGP_OnionModes). */
+ int onion_mode;
+ /** Onion skinning flags (eGPD_OnionFlag). */
+ int 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;
+ /** Ghosts After: max number of ghost frames to show after
+ * active frame and the following it (0 = only the ghost itself).
+ */
+ short gstep_next;
+
+ /** 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;
+ /** Materials array. */
+ struct Material **mat;
+ /** Total materials. */
+ short totcol;
+
+ /* stats */
+ short totlayer;
+ short totframe;
+ char _pad2[6];
+ int totstroke;
+ int totpoint;
+
+ /** Draw mode for strokes (eGP_DrawMode). */
+ short draw_mode;
+ char _pad3[2];
+
+ bGPgrid grid;
+
+ bGPdata_Runtime runtime;
} bGPdata;
/* bGPdata->flag */
@@ -530,103 +531,103 @@ typedef struct bGPdata {
* changes made during the porting process.
*/
typedef enum eGPdata_Flag {
- /* datablock 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 datablocks 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),
- /* Draw a green and red point to indicate start and end of the stroke */
- GP_DATA_SHOW_DIRECTION = (1 << 10),
-
- /* 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),
-
- /* Force fill recalc if use deformation modifiers.
- * this is required if the stroke is deformed and the triangulation data is
- * not valid.
- */
- GP_DATA_STROKE_FORCE_RECALC = (1 << 17),
- /* Special mode drawing polygons */
- GP_DATA_STROKE_POLYGON = (1 << 18),
- /* Use adaptive UV scales */
- GP_DATA_UV_ADAPTIVE = (1 << 19),
- /* Autolock not active layers */
- GP_DATA_AUTOLOCK_LAYERS = (1 << 20),
- /* Internal flag for python update */
- GP_DATA_PYTHON_UPDATED = (1 << 21),
+ /* datablock 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 datablocks 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),
+ /* Draw a green and red point to indicate start and end of the stroke */
+ GP_DATA_SHOW_DIRECTION = (1 << 10),
+
+ /* 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),
+
+ /* Force fill recalc if use deformation modifiers.
+ * this is required if the stroke is deformed and the triangulation data is
+ * not valid.
+ */
+ GP_DATA_STROKE_FORCE_RECALC = (1 << 17),
+ /* Special mode drawing polygons */
+ GP_DATA_STROKE_POLYGON = (1 << 18),
+ /* Use adaptive UV scales */
+ GP_DATA_UV_ADAPTIVE = (1 << 19),
+ /* Autolock not active layers */
+ GP_DATA_AUTOLOCK_LAYERS = (1 << 20),
+ /* Internal flag for python update */
+ GP_DATA_PYTHON_UPDATED = (1 << 21),
} eGPdata_Flag;
/* gpd->onion_flag */
typedef enum eGPD_OnionFlag {
- /* 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),
+ /* 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),
} eGPD_OnionFlag;
/* gpd->onion_mode */
typedef enum eGP_OnionModes {
- GP_ONION_MODE_ABSOLUTE = 0,
- GP_ONION_MODE_RELATIVE = 1,
- GP_ONION_MODE_SELECTED = 2,
+ GP_ONION_MODE_ABSOLUTE = 0,
+ GP_ONION_MODE_RELATIVE = 1,
+ GP_ONION_MODE_SELECTED = 2,
} eGP_OnionModes;
/* xray modes (Depth Ordering) */
typedef enum eGP_DepthOrdering {
- GP_XRAY_FRONT = 0,
- GP_XRAY_3DSPACE = 1,
+ GP_XRAY_FRONT = 0,
+ GP_XRAY_3DSPACE = 1,
} eGP_DepthOrdering;
/* draw modes (Use 2D or 3D position) */
typedef enum eGP_DrawMode {
- GP_DRAWMODE_2D = 0,
- GP_DRAWMODE_3D = 1,
+ GP_DRAWMODE_2D = 0,
+ GP_DRAWMODE_3D = 1,
} eGP_DrawMode;
/* ***************************************** */
@@ -634,27 +635,27 @@ typedef enum eGP_DrawMode {
/* Check if 'multiedit sessions' is enabled */
#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) \
- ((gpd) && (gpd->flag & \
- (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) && \
- (gpd->flag & GP_DATA_STROKE_MULTIEDIT))
+ ((gpd) && \
+ (gpd->flag & \
+ (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) && \
+ (gpd->flag & GP_DATA_STROKE_MULTIEDIT))
/* Macros to check grease pencil modes */
#define GPENCIL_ANY_MODE(gpd) \
- ((gpd) && (gpd->flag & \
- (GP_DATA_STROKE_PAINTMODE | GP_DATA_STROKE_EDITMODE | \
- GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
-#define GPENCIL_EDIT_MODE(gpd) \
- ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE))
+ ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE | GP_DATA_STROKE_EDITMODE | \
+ GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
+#define GPENCIL_EDIT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE))
#define GPENCIL_ANY_EDIT_MODE(gpd) \
- ((gpd) && (gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
-#define GPENCIL_PAINT_MODE(gpd) \
- ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE)))
+ ((gpd) && (gpd->flag & \
+ (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
+#define GPENCIL_PAINT_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE)))
#define GPENCIL_SCULPT_OR_WEIGHT_MODE(gpd) \
- ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
+ ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
#define GPENCIL_NONE_EDIT_MODE(gpd) \
- ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) == 0))
+ ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | \
+ GP_DATA_STROKE_WEIGHTMODE)) == 0))
#define GPENCIL_LAZY_MODE(brush, shift) \
- (((brush) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) && (shift == 0))) || \
- (((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && (shift == 1)))
+ (((brush) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) && (shift == 0))) || \
+ (((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && (shift == 1)))
#endif /* __DNA_GPENCIL_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index da5abf0a0eb..8cab90b0a46 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -26,40 +26,40 @@
/** Properties for dof effect. */
typedef struct GPUDOFSettings {
- /** Focal distance for depth of field. */
- float focus_distance;
- float fstop;
- float focal_length;
- float sensor;
- float rotation;
- float ratio;
- int num_blades;
- int high_quality;
+ /** Focal distance for depth of field. */
+ float focus_distance;
+ float fstop;
+ float focal_length;
+ float sensor;
+ float rotation;
+ float ratio;
+ int num_blades;
+ int high_quality;
} GPUDOFSettings;
/** Properties for SSAO effect. */
typedef struct GPUSSAOSettings {
- float factor;
- float color[3];
- float distance_max;
- float attenuation;
- /** Ray samples, we use presets here for easy control instead of. */
- int samples;
- char _pad[4];
+ float factor;
+ float color[3];
+ float distance_max;
+ float attenuation;
+ /** Ray samples, we use presets here for easy control instead of. */
+ int samples;
+ char _pad[4];
} GPUSSAOSettings;
typedef struct GPUFXSettings {
- GPUDOFSettings *dof;
- GPUSSAOSettings *ssao;
- /** #eGPUFXFlags. */
- char fx_flag;
- char _pad[7];
+ GPUDOFSettings *dof;
+ GPUSSAOSettings *ssao;
+ /** #eGPUFXFlags. */
+ char fx_flag;
+ char _pad[7];
} GPUFXSettings;
/* shaderfx enables */
typedef enum eGPUFXFlags {
- GPU_FX_FLAG_DOF = (1 << 0),
- GPU_FX_FLAG_SSAO = (1 << 1),
+ GPU_FX_FLAG_DOF = (1 << 0),
+ GPU_FX_FLAG_SSAO = (1 << 1),
} eGPUFXFlags;
-#endif /* __DNA_GPU_TYPES_H__ */
+#endif /* __DNA_GPU_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index e411e5f304e..fec5f96b4f3 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -26,7 +26,7 @@
#include "DNA_defs.h"
#include "DNA_ID.h"
-#include "DNA_color_types.h" /* for color management */
+#include "DNA_color_types.h" /* for color management */
struct GPUTexture;
struct MovieCache;
@@ -38,176 +38,175 @@ struct anim;
/* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
/* should be used in conjunction with an ID * to Image. */
typedef struct ImageUser {
- /** To retrieve render result. */
- struct Scene *scene;
-
- /** Movies, sequences: current to display. */
- int framenr;
- /** Total amount of frames to use. */
- int frames;
- /** Offset within movie, start frame in global time. */
- int offset, sfra;
- /** Cyclic flag. */
- char _pad0, cycl;
- char ok;
-
- /** Multiview current eye - for internal use of drawing routines. */
- char multiview_eye;
- short pass;
- char _pad1[2];
-
- /** Listbase indices, for menu browsing or retrieve buffer. */
- short multi_index, view, layer;
- short flag;
+ /** To retrieve render result. */
+ struct Scene *scene;
+
+ /** Movies, sequences: current to display. */
+ int framenr;
+ /** Total amount of frames to use. */
+ int frames;
+ /** Offset within movie, start frame in global time. */
+ int offset, sfra;
+ /** Cyclic flag. */
+ char _pad0, cycl;
+ char ok;
+
+ /** Multiview current eye - for internal use of drawing routines. */
+ char multiview_eye;
+ short pass;
+ char _pad1[2];
+
+ /** Listbase indices, for menu browsing or retrieve buffer. */
+ short multi_index, view, layer;
+ short flag;
} ImageUser;
typedef struct ImageAnim {
- struct ImageAnim *next, *prev;
- struct anim *anim;
+ struct ImageAnim *next, *prev;
+ struct anim *anim;
} ImageAnim;
typedef struct ImageView {
- struct ImageView *next, *prev;
- /** MAX_NAME. */
- char name[64];
- /** 1024 = FILE_MAX. */
- char filepath[1024];
+ struct ImageView *next, *prev;
+ /** MAX_NAME. */
+ char name[64];
+ /** 1024 = FILE_MAX. */
+ char filepath[1024];
} ImageView;
typedef struct ImagePackedFile {
- struct ImagePackedFile *next, *prev;
- struct PackedFile *packedfile;
- /** 1024 = FILE_MAX. */
- char filepath[1024];
+ struct ImagePackedFile *next, *prev;
+ struct PackedFile *packedfile;
+ /** 1024 = FILE_MAX. */
+ char filepath[1024];
} ImagePackedFile;
typedef struct RenderSlot {
- struct RenderSlot *next, *prev;
- /** 64 = MAX_NAME. */
- char name[64];
- struct RenderResult *render;
+ struct RenderSlot *next, *prev;
+ /** 64 = MAX_NAME. */
+ char name[64];
+ struct RenderResult *render;
} RenderSlot;
/* iuser->flag */
-#define IMA_ANIM_ALWAYS (1 << 0)
+#define IMA_ANIM_ALWAYS (1 << 0)
/* #define IMA_UNUSED_1 (1 << 1) */
/* #define IMA_UNUSED_2 (1 << 2) */
-#define IMA_NEED_FRAME_RECALC (1 << 3)
-#define IMA_SHOW_STEREO (1 << 4)
+#define IMA_NEED_FRAME_RECALC (1 << 3)
+#define IMA_SHOW_STEREO (1 << 4)
enum {
- TEXTARGET_TEXTURE_2D = 0,
- TEXTARGET_TEXTURE_CUBE_MAP = 1,
- TEXTARGET_COUNT = 2,
+ TEXTARGET_TEXTURE_2D = 0,
+ TEXTARGET_TEXTURE_CUBE_MAP = 1,
+ TEXTARGET_COUNT = 2,
};
typedef struct Image {
- ID id;
-
- /** File path, 1024 = FILE_MAX. */
- char name[1024];
-
- /** Not written in file. */
- struct MovieCache *cache;
- /** Not written in file 2 = TEXTARGET_COUNT. */
- struct GPUTexture *gputexture[2];
-
- /* sources from: */
- ListBase anims;
- struct RenderResult *rr;
-
- ListBase renderslots;
- short render_slot, last_render_slot;
-
- int flag;
- short source, type;
- int lastframe;
-
- /* GPU texture flag. */
- short gpuflag;
- char _pad2[6];
-
- /** Deprecated. */
- struct PackedFile *packedfile DNA_DEPRECATED;
- struct ListBase packedfiles;
- struct PreviewImage *preview;
-
- int lastused;
- short ok;
- char _pad4[6];
-
- /* for generated images */
- int gen_x, gen_y;
- char gen_type, gen_flag;
- short gen_depth;
- float gen_color[4];
-
- /* display aspect - for UV editing images resized for faster openGL display */
- float aspx, aspy;
-
- /* color management */
- ColorManagedColorspaceSettings colorspace_settings;
- char alpha_mode;
-
- char _pad[5];
-
- /* Multiview */
- /** For viewer node stereoscopy. */
- char eye;
- char views_format;
- /** ImageView. */
- ListBase views;
- struct Stereo3dFormat *stereo3d_format;
+ ID id;
+
+ /** File path, 1024 = FILE_MAX. */
+ char name[1024];
+
+ /** Not written in file. */
+ struct MovieCache *cache;
+ /** Not written in file 2 = TEXTARGET_COUNT. */
+ struct GPUTexture *gputexture[2];
+
+ /* sources from: */
+ ListBase anims;
+ struct RenderResult *rr;
+
+ ListBase renderslots;
+ short render_slot, last_render_slot;
+
+ int flag;
+ short source, type;
+ int lastframe;
+
+ /* GPU texture flag. */
+ short gpuflag;
+ char _pad2[6];
+
+ /** Deprecated. */
+ struct PackedFile *packedfile DNA_DEPRECATED;
+ struct ListBase packedfiles;
+ struct PreviewImage *preview;
+
+ int lastused;
+ short ok;
+ char _pad4[6];
+
+ /* for generated images */
+ int gen_x, gen_y;
+ char gen_type, gen_flag;
+ short gen_depth;
+ float gen_color[4];
+
+ /* display aspect - for UV editing images resized for faster openGL display */
+ float aspx, aspy;
+
+ /* color management */
+ ColorManagedColorspaceSettings colorspace_settings;
+ char alpha_mode;
+
+ char _pad[5];
+
+ /* Multiview */
+ /** For viewer node stereoscopy. */
+ char eye;
+ char views_format;
+ /** ImageView. */
+ ListBase views;
+ struct Stereo3dFormat *stereo3d_format;
} Image;
-
/* **************** IMAGE ********************* */
/* Image.flag */
enum {
- IMA_FLAG_UNUSED_0 = (1 << 0), /* cleared */
- IMA_FLAG_UNUSED_1 = (1 << 1), /* cleared */
+ IMA_FLAG_UNUSED_0 = (1 << 0), /* cleared */
+ IMA_FLAG_UNUSED_1 = (1 << 1), /* cleared */
#ifdef DNA_DEPRECATED
- IMA_DO_PREMUL = (1 << 2),
+ 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_IGNORE_ALPHA = (1 << 12),
- IMA_DEINTERLACE = (1 << 13),
- IMA_USE_VIEWS = (1 << 14),
- IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */
- IMA_FLAG_UNUSED_16 = (1 << 16), /* cleared */
+ 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_IGNORE_ALPHA = (1 << 12),
+ IMA_DEINTERLACE = (1 << 13),
+ IMA_USE_VIEWS = (1 << 14),
+ IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */
+ IMA_FLAG_UNUSED_16 = (1 << 16), /* cleared */
};
/* Image.gpuflag */
enum {
- /** GPU texture needs to be refreshed. */
- IMA_GPU_REFRESH = (1 << 0),
- /** All mipmap levels in OpenGL texture set? */
- IMA_GPU_MIPMAP_COMPLETE = (1 << 1),
- /** OpenGL image texture bound as non-color data. */
- IMA_GPU_IS_DATA = (1 << 2),
+ /** GPU texture needs to be refreshed. */
+ IMA_GPU_REFRESH = (1 << 0),
+ /** All mipmap levels in OpenGL texture set? */
+ IMA_GPU_MIPMAP_COMPLETE = (1 << 1),
+ /** OpenGL image texture bound as non-color data. */
+ IMA_GPU_IS_DATA = (1 << 2),
};
/* ima->type and ima->source moved to BKE_image.h, for API */
/* render */
-#define IMA_MAX_RENDER_TEXT (1 << 9)
+#define IMA_MAX_RENDER_TEXT (1 << 9)
/* gen_flag */
-#define IMA_GEN_FLOAT 1
+#define IMA_GEN_FLOAT 1
/* alpha_mode */
enum {
- IMA_ALPHA_STRAIGHT = 0,
- IMA_ALPHA_PREMUL = 1,
+ IMA_ALPHA_STRAIGHT = 0,
+ IMA_ALPHA_PREMUL = 1,
};
#endif
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index 9be5448a327..5c9c845005c 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -38,486 +38,483 @@
/* -------------------------- Type Defines --------------------------- */
-
/* --- IPO Curve Driver --- */
/* IPO Curve Driver */
typedef struct IpoDriver {
- /** Target/driver ob. */
- struct Object *ob;
- /** Sub-channel to use. */
- short blocktype, adrcode;
-
- /** Driver settings. */
- short type, flag;
- /** Bone, or python expression here. */
- char name[128];
+ /** Target/driver ob. */
+ struct Object *ob;
+ /** Sub-channel to use. */
+ short blocktype, adrcode;
+
+ /** Driver settings. */
+ short type, flag;
+ /** Bone, or python expression here. */
+ char name[128];
} IpoDriver;
/* --- IPO Curve --- */
/* IPO Curve */
typedef struct IpoCurve {
- struct IpoCurve *next, *prev;
-
- /** Array of BPoints (sizeof(BPoint) * totvert) - i.e. baked/imported data. */
- struct BPoint *bp;
- /** Array of BezTriples (sizeof(BezTriple) * totvert) - i.e. user-editable keyframes . */
- struct BezTriple *bezt;
-
- /** Bounding boxes. */
- rctf maxrct, totrct;
-
- /** Blocktype= ipo-blocktype; adrcode= type of ipo-curve; vartype= 'format' of data. */
- short blocktype, adrcode, vartype;
- /** Total number of BezTriples (i.e. keyframes) on curve. */
- short totvert;
- /** Interpolation and extrapolation modes . */
- short ipo, extrap;
- /** Flag= settings; rt= ???. */
- short flag, rt;
- /** Minimum/maximum y-extents for curve. */
- float ymin, ymax;
- /** ???. */
- unsigned int bitmask;
-
- /** Minimum/maximum values for sliders (in action editor). */
- float slide_min, slide_max;
- /** Value of ipo-curve for current frame. */
- float curval;
-
- /** Pointer to ipo-driver for this curve. */
- IpoDriver *driver;
+ struct IpoCurve *next, *prev;
+
+ /** Array of BPoints (sizeof(BPoint) * totvert) - i.e. baked/imported data. */
+ struct BPoint *bp;
+ /** Array of BezTriples (sizeof(BezTriple) * totvert) - i.e. user-editable keyframes . */
+ struct BezTriple *bezt;
+
+ /** Bounding boxes. */
+ rctf maxrct, totrct;
+
+ /** Blocktype= ipo-blocktype; adrcode= type of ipo-curve; vartype= 'format' of data. */
+ short blocktype, adrcode, vartype;
+ /** Total number of BezTriples (i.e. keyframes) on curve. */
+ short totvert;
+ /** Interpolation and extrapolation modes . */
+ short ipo, extrap;
+ /** Flag= settings; rt= ???. */
+ short flag, rt;
+ /** Minimum/maximum y-extents for curve. */
+ float ymin, ymax;
+ /** ???. */
+ unsigned int bitmask;
+
+ /** Minimum/maximum values for sliders (in action editor). */
+ float slide_min, slide_max;
+ /** Value of ipo-curve for current frame. */
+ float curval;
+
+ /** Pointer to ipo-driver for this curve. */
+ IpoDriver *driver;
} IpoCurve;
/* --- ID-Datablock --- */
/* IPO Data-Block */
typedef struct Ipo {
- ID id;
-
- /** A list of IpoCurve structs in a linked list. */
- ListBase curve;
- /** Rect defining extents of keyframes?. */
- rctf cur;
-
- /** Blocktype: self-explanatory; showkey: either 0 or 1
- * (show vertical yellow lines for editing). */
- short blocktype, showkey;
- /** Muteipo: either 0 or 1 (whether ipo block is muted). */
- short muteipo;
- char _pad[2];
+ ID id;
+
+ /** A list of IpoCurve structs in a linked list. */
+ ListBase curve;
+ /** Rect defining extents of keyframes?. */
+ rctf cur;
+
+ /** Blocktype: self-explanatory; showkey: either 0 or 1
+ * (show vertical yellow lines for editing). */
+ short blocktype, showkey;
+ /** Muteipo: either 0 or 1 (whether ipo block is muted). */
+ short muteipo;
+ char _pad[2];
} Ipo;
/* ----------- adrcodes (for matching ipo-curves to data) ------------- */
/* defines: are these duped or new? */
-#define IPOBUTY 17
+#define IPOBUTY 17
-#define TOB_IPO 1
-#define TOB_IPODROT 2
+#define TOB_IPO 1
+#define TOB_IPODROT 2
/* disptype */
-#define IPO_DISPDEGR 1
-#define IPO_DISPBITS 2
-#define IPO_DISPTIME 3
+#define IPO_DISPDEGR 1
+#define IPO_DISPBITS 2
+#define IPO_DISPTIME 3
/* ********** Object (ID_OB) ********** */
-#define OB_TOTIPO 30
-#define OB_TOTNAM 30
-
-#define OB_LOC_X 1
-#define OB_LOC_Y 2
-#define OB_LOC_Z 3
-#define OB_DLOC_X 4
-#define OB_DLOC_Y 5
-#define OB_DLOC_Z 6
-
-#define OB_ROT_X 7
-#define OB_ROT_Y 8
-#define OB_ROT_Z 9
-#define OB_DROT_X 10
-#define OB_DROT_Y 11
-#define OB_DROT_Z 12
-
-#define OB_SIZE_X 13
-#define OB_SIZE_Y 14
-#define OB_SIZE_Z 15
-#define OB_DSIZE_X 16
-#define OB_DSIZE_Y 17
-#define OB_DSIZE_Z 18
-
-#define OB_LAY 19
-
-#define OB_TIME 20
-
-#define OB_COL_R 21
-#define OB_COL_G 22
-#define OB_COL_B 23
-#define OB_COL_A 24
-
-#define OB_PD_FSTR 25
-#define OB_PD_FFALL 26
-#define OB_PD_SDAMP 27
-#define OB_PD_RDAMP 28
-#define OB_PD_PERM 29
-#define OB_PD_FMAXD 30
+#define OB_TOTIPO 30
+#define OB_TOTNAM 30
+
+#define OB_LOC_X 1
+#define OB_LOC_Y 2
+#define OB_LOC_Z 3
+#define OB_DLOC_X 4
+#define OB_DLOC_Y 5
+#define OB_DLOC_Z 6
+
+#define OB_ROT_X 7
+#define OB_ROT_Y 8
+#define OB_ROT_Z 9
+#define OB_DROT_X 10
+#define OB_DROT_Y 11
+#define OB_DROT_Z 12
+
+#define OB_SIZE_X 13
+#define OB_SIZE_Y 14
+#define OB_SIZE_Z 15
+#define OB_DSIZE_X 16
+#define OB_DSIZE_Y 17
+#define OB_DSIZE_Z 18
+
+#define OB_LAY 19
+
+#define OB_TIME 20
+
+#define OB_COL_R 21
+#define OB_COL_G 22
+#define OB_COL_B 23
+#define OB_COL_A 24
+
+#define OB_PD_FSTR 25
+#define OB_PD_FFALL 26
+#define OB_PD_SDAMP 27
+#define OB_PD_RDAMP 28
+#define OB_PD_PERM 29
+#define OB_PD_FMAXD 30
/* exception: driver channel, for bone driver only */
-#define OB_ROT_DIFF 100
-
+#define OB_ROT_DIFF 100
/* ********** Material (ID_MA) ********** */
-#define MA_TOTIPO 40
-#define MA_TOTNAM 26
-
-#define MA_COL_R 1
-#define MA_COL_G 2
-#define MA_COL_B 3
-#define MA_SPEC_R 4
-#define MA_SPEC_G 5
-#define MA_SPEC_B 6
-#define MA_MIR_R 7
-#define MA_MIR_G 8
-#define MA_MIR_B 9
-#define MA_REF 10
-#define MA_ALPHA 11
-#define MA_EMIT 12
-#define MA_AMB 13
-#define MA_SPEC 14
-#define MA_HARD 15
-#define MA_SPTR 16
-#define MA_IOR 17
-#define MA_MODE 18
-#define MA_HASIZE 19
-#define MA_TRANSLU 20
-#define MA_RAYM 21
-#define MA_FRESMIR 22
-#define MA_FRESMIRI 23
-#define MA_FRESTRA 24
-#define MA_FRESTRAI 25
-#define MA_ADD 26
-
-#define MA_MAP1 (1 << 5)
-#define MA_MAP2 (1 << 6)
-#define MA_MAP3 (1 << 7)
-#define MA_MAP4 (1 << 8)
-#define MA_MAP5 (1 << 9)
-#define MA_MAP6 (1 << 10)
-#define MA_MAP7 (1 << 11)
-#define MA_MAP8 (1 << 12)
-#define MA_MAP9 (1 << 13)
-#define MA_MAP10 (1 << 14)
-#define MA_MAP11 (1 << 15)
-#define MA_MAP12 (1 << 16)
-#define MA_MAP13 (1 << 17)
-#define MA_MAP14 (1 << 18)
-#define MA_MAP15 (1 << 19)
-#define MA_MAP16 (1 << 20)
-#define MA_MAP17 (1 << 21)
-#define MA_MAP18 (1 << 22)
+#define MA_TOTIPO 40
+#define MA_TOTNAM 26
+
+#define MA_COL_R 1
+#define MA_COL_G 2
+#define MA_COL_B 3
+#define MA_SPEC_R 4
+#define MA_SPEC_G 5
+#define MA_SPEC_B 6
+#define MA_MIR_R 7
+#define MA_MIR_G 8
+#define MA_MIR_B 9
+#define MA_REF 10
+#define MA_ALPHA 11
+#define MA_EMIT 12
+#define MA_AMB 13
+#define MA_SPEC 14
+#define MA_HARD 15
+#define MA_SPTR 16
+#define MA_IOR 17
+#define MA_MODE 18
+#define MA_HASIZE 19
+#define MA_TRANSLU 20
+#define MA_RAYM 21
+#define MA_FRESMIR 22
+#define MA_FRESMIRI 23
+#define MA_FRESTRA 24
+#define MA_FRESTRAI 25
+#define MA_ADD 26
+
+#define MA_MAP1 (1 << 5)
+#define MA_MAP2 (1 << 6)
+#define MA_MAP3 (1 << 7)
+#define MA_MAP4 (1 << 8)
+#define MA_MAP5 (1 << 9)
+#define MA_MAP6 (1 << 10)
+#define MA_MAP7 (1 << 11)
+#define MA_MAP8 (1 << 12)
+#define MA_MAP9 (1 << 13)
+#define MA_MAP10 (1 << 14)
+#define MA_MAP11 (1 << 15)
+#define MA_MAP12 (1 << 16)
+#define MA_MAP13 (1 << 17)
+#define MA_MAP14 (1 << 18)
+#define MA_MAP15 (1 << 19)
+#define MA_MAP16 (1 << 20)
+#define MA_MAP17 (1 << 21)
+#define MA_MAP18 (1 << 22)
/* ********** Texture Slots (MTex) ********** */
-#define TEX_TOTNAM 14
+#define TEX_TOTNAM 14
-#define MAP_OFS_X 1
-#define MAP_OFS_Y 2
-#define MAP_OFS_Z 3
-#define MAP_SIZE_X 4
-#define MAP_SIZE_Y 5
-#define MAP_SIZE_Z 6
-#define MAP_R 7
-#define MAP_G 8
-#define MAP_B 9
+#define MAP_OFS_X 1
+#define MAP_OFS_Y 2
+#define MAP_OFS_Z 3
+#define MAP_SIZE_X 4
+#define MAP_SIZE_Y 5
+#define MAP_SIZE_Z 6
+#define MAP_R 7
+#define MAP_G 8
+#define MAP_B 9
-#define MAP_DVAR 10
-#define MAP_COLF 11
-#define MAP_NORF 12
-#define MAP_VARF 13
-#define MAP_DISP 14
+#define MAP_DVAR 10
+#define MAP_COLF 11
+#define MAP_NORF 12
+#define MAP_VARF 13
+#define MAP_DISP 14
/* ********** Texture (ID_TE) ********** */
-#define TE_TOTIPO 26
-#define TE_TOTNAM 26
-
-#define TE_NSIZE 1
-#define TE_NDEPTH 2
-#define TE_NTYPE 3
-#define TE_TURB 4
-
-#define TE_VNW1 5
-#define TE_VNW2 6
-#define TE_VNW3 7
-#define TE_VNW4 8
-#define TE_VNMEXP 9
-#define TE_VN_DISTM 10
-#define TE_VN_COLT 11
-
-#define TE_ISCA 12
-#define TE_DISTA 13
-
-#define TE_MG_TYP 14
-#define TE_MGH 15
-#define TE_MG_LAC 16
-#define TE_MG_OCT 17
-#define TE_MG_OFF 18
-#define TE_MG_GAIN 19
-
-#define TE_N_BAS1 20
-#define TE_N_BAS2 21
-
-#define TE_COL_R 22
-#define TE_COL_G 23
-#define TE_COL_B 24
-#define TE_BRIGHT 25
-#define TE_CONTRA 26
+#define TE_TOTIPO 26
+#define TE_TOTNAM 26
+
+#define TE_NSIZE 1
+#define TE_NDEPTH 2
+#define TE_NTYPE 3
+#define TE_TURB 4
+
+#define TE_VNW1 5
+#define TE_VNW2 6
+#define TE_VNW3 7
+#define TE_VNW4 8
+#define TE_VNMEXP 9
+#define TE_VN_DISTM 10
+#define TE_VN_COLT 11
+
+#define TE_ISCA 12
+#define TE_DISTA 13
+
+#define TE_MG_TYP 14
+#define TE_MGH 15
+#define TE_MG_LAC 16
+#define TE_MG_OCT 17
+#define TE_MG_OFF 18
+#define TE_MG_GAIN 19
+
+#define TE_N_BAS1 20
+#define TE_N_BAS2 21
+
+#define TE_COL_R 22
+#define TE_COL_G 23
+#define TE_COL_B 24
+#define TE_BRIGHT 25
+#define TE_CONTRA 26
/* ******** Sequence (ID_SEQ) ********** */
-#define SEQ_TOTIPO 1
-#define SEQ_TOTNAM 1
+#define SEQ_TOTIPO 1
+#define SEQ_TOTNAM 1
-#define SEQ_FAC1 1
-#define SEQ_FAC_SPEED 2
+#define SEQ_FAC1 1
+#define SEQ_FAC_SPEED 2
#define SEQ_FAC_OPACITY 3
/* ********* Curve (ID_CU) *********** */
-#define CU_TOTIPO 1
-#define CU_TOTNAM 1
+#define CU_TOTIPO 1
+#define CU_TOTNAM 1
-#define CU_SPEED 1
+#define CU_SPEED 1
/* ********* ShapeKey (ID_KE) *********** */
-#define KEY_TOTIPO 64
-#define KEY_TOTNAM 64
+#define KEY_TOTIPO 64
+#define KEY_TOTNAM 64
-#define KEY_SPEED 0
-#define KEY_NR 1
+#define KEY_SPEED 0
+#define KEY_NR 1
/* ********* World (ID_WO) *********** */
-#define WO_TOTIPO 29
-#define WO_TOTNAM 16
+#define WO_TOTIPO 29
+#define WO_TOTNAM 16
-#define WO_HOR_R 1
-#define WO_HOR_G 2
-#define WO_HOR_B 3
-#define WO_ZEN_R 4
-#define WO_ZEN_G 5
-#define WO_ZEN_B 6
+#define WO_HOR_R 1
+#define WO_HOR_G 2
+#define WO_HOR_B 3
+#define WO_ZEN_R 4
+#define WO_ZEN_G 5
+#define WO_ZEN_B 6
-#define WO_EXPOS 7
+#define WO_EXPOS 7
-#define WO_MISI 8
-#define WO_MISTDI 9
-#define WO_MISTSTA 10
-#define WO_MISTHI 11
+#define WO_MISI 8
+#define WO_MISTDI 9
+#define WO_MISTSTA 10
+#define WO_MISTHI 11
/* Stars are deprecated */
-#define WO_STAR_R 12
-#define WO_STAR_G 13
-#define WO_STAR_B 14
-#define WO_STARDIST 15
-#define WO_STARSIZE 16
+#define WO_STAR_R 12
+#define WO_STAR_G 13
+#define WO_STAR_B 14
+#define WO_STARDIST 15
+#define WO_STARSIZE 16
/* ********** Light (ID_LA) ********** */
-#define LA_TOTIPO 21
-#define LA_TOTNAM 10
+#define LA_TOTIPO 21
+#define LA_TOTNAM 10
-#define LA_ENERGY 1
-#define LA_COL_R 2
-#define LA_COL_G 3
-#define LA_COL_B 4
-#define LA_DIST 5
-#define LA_SPOTSI 6
-#define LA_SPOTBL 7
-#define LA_QUAD1 8
-#define LA_QUAD2 9
-#define LA_HALOINT 10
+#define LA_ENERGY 1
+#define LA_COL_R 2
+#define LA_COL_G 3
+#define LA_COL_B 4
+#define LA_DIST 5
+#define LA_SPOTSI 6
+#define LA_SPOTBL 7
+#define LA_QUAD1 8
+#define LA_QUAD2 9
+#define LA_HALOINT 10
/* ********* Camera (ID_CA) ************ */
-#define CAM_TOTIPO 7
-#define CAM_TOTNAM 7
+#define CAM_TOTIPO 7
+#define CAM_TOTNAM 7
-#define CAM_LENS 1
-#define CAM_STA 2
-#define CAM_END 3
+#define CAM_LENS 1
+#define CAM_STA 2
+#define CAM_END 3
/* yafray aperture & focal distance curves */
-#define CAM_YF_APERT 4
-#define CAM_YF_FDIST 5
+#define CAM_YF_APERT 4
+#define CAM_YF_FDIST 5
-#define CAM_SHIFT_X 6
-#define CAM_SHIFT_Y 7
+#define CAM_SHIFT_X 6
+#define CAM_SHIFT_Y 7
/* ********* Sound (ID_SO) *********** */
-#define SND_TOTIPO 4
-#define SND_TOTNAM 4
+#define SND_TOTIPO 4
+#define SND_TOTNAM 4
-#define SND_VOLUME 1
-#define SND_PITCH 2
-#define SND_PANNING 3
-#define SND_ATTEN 4
+#define SND_VOLUME 1
+#define SND_PITCH 2
+#define SND_PANNING 3
+#define SND_ATTEN 4
/* ******* PoseChannel (ID_PO) ********* */
-#define AC_TOTIPO 13
-#define AC_TOTNAM 13
+#define AC_TOTIPO 13
+#define AC_TOTNAM 13
-#define AC_LOC_X 1
-#define AC_LOC_Y 2
-#define AC_LOC_Z 3
+#define AC_LOC_X 1
+#define AC_LOC_Y 2
+#define AC_LOC_Z 3
-#define AC_SIZE_X 13
-#define AC_SIZE_Y 14
-#define AC_SIZE_Z 15
+#define AC_SIZE_X 13
+#define AC_SIZE_Y 14
+#define AC_SIZE_Z 15
-#define AC_EUL_X 16
-#define AC_EUL_Y 17
-#define AC_EUL_Z 18
+#define AC_EUL_X 16
+#define AC_EUL_Y 17
+#define AC_EUL_Z 18
-#define AC_QUAT_W 25
-#define AC_QUAT_X 26
-#define AC_QUAT_Y 27
-#define AC_QUAT_Z 28
+#define AC_QUAT_W 25
+#define AC_QUAT_X 26
+#define AC_QUAT_Y 27
+#define AC_QUAT_Z 28
/* ******** Constraint (ID_CO) ********** */
-#define CO_TOTIPO 2
-#define CO_TOTNAM 2
+#define CO_TOTIPO 2
+#define CO_TOTNAM 2
-#define CO_ENFORCE 1
-#define CO_HEADTAIL 2
+#define CO_ENFORCE 1
+#define CO_HEADTAIL 2
/* ****** FluidSim (ID_FLUIDSIM) ****** */
-#define FLUIDSIM_TOTIPO 13
-#define FLUIDSIM_TOTNAM 13
+#define FLUIDSIM_TOTIPO 13
+#define FLUIDSIM_TOTNAM 13
-#define FLUIDSIM_VISC 1
-#define FLUIDSIM_TIME 2
+#define FLUIDSIM_VISC 1
+#define FLUIDSIM_TIME 2
#define FLUIDSIM_GRAV_X 3
#define FLUIDSIM_GRAV_Y 4
#define FLUIDSIM_GRAV_Z 5
-#define FLUIDSIM_VEL_X 6
-#define FLUIDSIM_VEL_Y 7
-#define FLUIDSIM_VEL_Z 8
+#define FLUIDSIM_VEL_X 6
+#define FLUIDSIM_VEL_Y 7
+#define FLUIDSIM_VEL_Z 8
#define FLUIDSIM_ACTIVE 9
-#define FLUIDSIM_ATTR_FORCE_STR 10
-#define FLUIDSIM_ATTR_FORCE_RADIUS 11
-#define FLUIDSIM_VEL_FORCE_STR 12
-#define FLUIDSIM_VEL_FORCE_RADIUS 13
+#define FLUIDSIM_ATTR_FORCE_STR 10
+#define FLUIDSIM_ATTR_FORCE_RADIUS 11
+#define FLUIDSIM_VEL_FORCE_STR 12
+#define FLUIDSIM_VEL_FORCE_RADIUS 13
/* ******************** */
/* particle ipos */
/* ******* Particle (ID_PA) ******** */
-#define PART_TOTIPO 25
-#define PART_TOTNAM 25
-
-#define PART_EMIT_FREQ 1
-/* #define PART_EMIT_LIFE 2 */ /*UNUSED*/
-#define PART_EMIT_VEL 3
-#define PART_EMIT_AVE 4
-/* #define PART_EMIT_SIZE 5 */ /*UNUSED*/
+#define PART_TOTIPO 25
+#define PART_TOTNAM 25
-#define PART_AVE 6
-#define PART_SIZE 7
-#define PART_DRAG 8
-#define PART_BROWN 9
-#define PART_DAMP 10
-#define PART_LENGTH 11
-#define PART_CLUMP 12
+#define PART_EMIT_FREQ 1
+/* #define PART_EMIT_LIFE 2 */ /*UNUSED*/
+#define PART_EMIT_VEL 3
+#define PART_EMIT_AVE 4
+/* #define PART_EMIT_SIZE 5 */ /*UNUSED*/
-#define PART_GRAV_X 13
-#define PART_GRAV_Y 14
-#define PART_GRAV_Z 15
+#define PART_AVE 6
+#define PART_SIZE 7
+#define PART_DRAG 8
+#define PART_BROWN 9
+#define PART_DAMP 10
+#define PART_LENGTH 11
+#define PART_CLUMP 12
-#define PART_KINK_AMP 16
-#define PART_KINK_FREQ 17
-#define PART_KINK_SHAPE 18
+#define PART_GRAV_X 13
+#define PART_GRAV_Y 14
+#define PART_GRAV_Z 15
-#define PART_BB_TILT 19
+#define PART_KINK_AMP 16
+#define PART_KINK_FREQ 17
+#define PART_KINK_SHAPE 18
-#define PART_PD_FSTR 20
-#define PART_PD_FFALL 21
-#define PART_PD_FMAXD 22
+#define PART_BB_TILT 19
-#define PART_PD2_FSTR 23
-#define PART_PD2_FFALL 24
-#define PART_PD2_FMAXD 25
+#define PART_PD_FSTR 20
+#define PART_PD_FFALL 21
+#define PART_PD_FMAXD 22
+#define PART_PD2_FSTR 23
+#define PART_PD2_FFALL 24
+#define PART_PD2_FMAXD 25
/* -------------------- Defines: Flags and Types ------------------ */
/* ----- IPO Curve Defines ------- */
/* icu->vartype */
-#define IPO_CHAR 0
-#define IPO_SHORT 1
-#define IPO_INT 2
-#define IPO_LONG 3
-#define IPO_FLOAT 4
-#define IPO_DOUBLE 5
-#define IPO_FLOAT_DEGR 6
-
- /* very special case, in keys */
-#define IPO_BEZTRIPLE 100
-#define IPO_BPOINT 101
+#define IPO_CHAR 0
+#define IPO_SHORT 1
+#define IPO_INT 2
+#define IPO_LONG 3
+#define IPO_FLOAT 4
+#define IPO_DOUBLE 5
+#define IPO_FLOAT_DEGR 6
+
+/* very special case, in keys */
+#define IPO_BEZTRIPLE 100
+#define IPO_BPOINT 101
/* icu->vartype */
-#define IPO_BITS 16
-#define IPO_CHAR_BIT 16
-#define IPO_SHORT_BIT 17
-#define IPO_INT_BIT 18
+#define IPO_BITS 16
+#define IPO_CHAR_BIT 16
+#define IPO_SHORT_BIT 17
+#define IPO_INT_BIT 18
/* icu->ipo: the type of curve */
-#define IPO_CONST 0
-#define IPO_LIN 1
-#define IPO_BEZ 2
- /* not used yet */
-#define IPO_MIXED 3
+#define IPO_CONST 0
+#define IPO_LIN 1
+#define IPO_BEZ 2
+/* not used yet */
+#define IPO_MIXED 3
/* icu->extrap */
-#define IPO_HORIZ 0
-#define IPO_DIR 1
-#define IPO_CYCL 2
-#define IPO_CYCLX 3
+#define IPO_HORIZ 0
+#define IPO_DIR 1
+#define IPO_CYCL 2
+#define IPO_CYCLX 3
/* icu->flag */
-#define IPO_VISIBLE 1
-#define IPO_SELECT 2
-#define IPO_EDIT 4
-#define IPO_LOCK 8
-#define IPO_AUTO_HORIZ 16
-#define IPO_ACTIVE 32
-#define IPO_PROTECT 64
-#define IPO_MUTE 128
+#define IPO_VISIBLE 1
+#define IPO_SELECT 2
+#define IPO_EDIT 4
+#define IPO_LOCK 8
+#define IPO_AUTO_HORIZ 16
+#define IPO_ACTIVE 32
+#define IPO_PROTECT 64
+#define IPO_MUTE 128
/* ---------- IPO Drivers ----------- */
/* offset in driver->name for finding second posechannel for rot-diff */
-#define DRIVER_NAME_OFFS 32
+#define DRIVER_NAME_OFFS 32
/* driver->type */
-#define IPO_DRIVER_TYPE_NORMAL 0
-#define IPO_DRIVER_TYPE_PYTHON 1
+#define IPO_DRIVER_TYPE_NORMAL 0
+#define IPO_DRIVER_TYPE_PYTHON 1
/* driver->flag */
- /* invalid flag: currently only used for buggy pydriver expressions */
-#define IPO_DRIVER_FLAG_INVALID (1 << 0)
+/* invalid flag: currently only used for buggy pydriver expressions */
+#define IPO_DRIVER_FLAG_INVALID (1 << 0)
#endif
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index d35ed7a755f..b57f88f39af 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -35,119 +35,118 @@ struct AnimData;
struct Ipo;
typedef struct KeyBlock {
- struct KeyBlock *next, *prev;
-
- /**
- * point in time (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;
- /** influence (typically [0 - 1] but can be more), (Key->type == KEY_RELATIVE) only.*/
- float curval;
-
- /** interpolation type (Key->type == KEY_NORMAL) only. */
- short type;
- char _pad1[2];
-
- /** relative == 0 means first key is reference, otherwise the index of Key->blocks */
- short relative;
- short flag;
-
- /** total number if items in the keyblock (compare with mesh/curve verts to check we match) */
- int totelem;
- /** for meshes only, match the unique number with the customdata layer */
- int uid;
-
- /** array of shape key values, size is (Key->elemsize * KeyBlock->totelem) */
- void *data;
- /** MAX_NAME (unique name, user assigned) */
- char name[64];
- /** MAX_VGROUP_NAME (optional vertex group), array gets allocated into 'weights' when set */
- char vgroup[64];
-
- /** ranges, for RNA and UI only to clamp 'curval' */
- float slidermin;
- float slidermax;
+ struct KeyBlock *next, *prev;
+
+ /**
+ * point in time (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;
+ /** influence (typically [0 - 1] but can be more), (Key->type == KEY_RELATIVE) only.*/
+ float curval;
+
+ /** interpolation type (Key->type == KEY_NORMAL) only. */
+ short type;
+ char _pad1[2];
+
+ /** relative == 0 means first key is reference, otherwise the index of Key->blocks */
+ short relative;
+ short flag;
+
+ /** total number if items in the keyblock (compare with mesh/curve verts to check we match) */
+ int totelem;
+ /** for meshes only, match the unique number with the customdata layer */
+ int uid;
+
+ /** array of shape key values, size is (Key->elemsize * KeyBlock->totelem) */
+ void *data;
+ /** MAX_NAME (unique name, user assigned) */
+ char name[64];
+ /** MAX_VGROUP_NAME (optional vertex group), array gets allocated into 'weights' when set */
+ char vgroup[64];
+
+ /** ranges, for RNA and UI only to clamp 'curval' */
+ float slidermin;
+ float slidermax;
} KeyBlock;
-
typedef struct Key {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- /**
- * 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;
-
- /**
- * 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;
- char _pad[4];
-
- /** list of KeyBlock's */
- ListBase block;
- /** old animation system, deprecated for 2.5 */
- struct Ipo *ipo DNA_DEPRECATED;
-
- ID *from;
-
- /** (totkey == BLI_listbase_count(&key->block)) */
- int totkey;
- short flag;
- /** absolute or relative shape key */
- char type;
- char _pad2;
-
- /** Only used when (Key->type == KEY_NORMAL), this value is used as a time slider,
- * rather then using the scenes time, this value can be animated to give greater control */
- float ctime;
-
- /**
- * Can never be 0, this is used for detecting old data.
- * current free uid for keyblocks
- */
- int uidgen;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ /**
+ * 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;
+
+ /**
+ * 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;
+ char _pad[4];
+
+ /** list of KeyBlock's */
+ ListBase block;
+ /** old animation system, deprecated for 2.5 */
+ struct Ipo *ipo DNA_DEPRECATED;
+
+ ID *from;
+
+ /** (totkey == BLI_listbase_count(&key->block)) */
+ int totkey;
+ short flag;
+ /** absolute or relative shape key */
+ char type;
+ char _pad2;
+
+ /** Only used when (Key->type == KEY_NORMAL), this value is used as a time slider,
+ * rather then using the scenes time, this value can be animated to give greater control */
+ float ctime;
+
+ /**
+ * Can never be 0, this is used for detecting old data.
+ * current free uid for keyblocks
+ */
+ int uidgen;
} Key;
/* **************** KEY ********************* */
/* Key->type: KeyBlocks are interpreted as... */
enum {
- /* Sequential positions over time (using KeyBlock->pos and Key->ctime) */
- KEY_NORMAL = 0,
+ /* Sequential positions over time (using KeyBlock->pos and Key->ctime) */
+ KEY_NORMAL = 0,
- /* States to blend between (default) */
- KEY_RELATIVE = 1,
+ /* States to blend between (default) */
+ KEY_RELATIVE = 1,
};
/* Key->flag */
enum {
- KEY_DS_EXPAND = 1,
+ KEY_DS_EXPAND = 1,
};
/* KeyBlock->type */
enum {
- KEY_LINEAR = 0,
- KEY_CARDINAL = 1,
- KEY_BSPLINE = 2,
- KEY_CATMULL_ROM = 3,
+ KEY_LINEAR = 0,
+ KEY_CARDINAL = 1,
+ KEY_BSPLINE = 2,
+ KEY_CATMULL_ROM = 3,
};
/* KeyBlock->flag */
enum {
- KEYBLOCK_MUTE = (1 << 0),
- KEYBLOCK_SEL = (1 << 1),
- KEYBLOCK_LOCKED = (1 << 2),
+ KEYBLOCK_MUTE = (1 << 0),
+ KEYBLOCK_SEL = (1 << 1),
+ KEYBLOCK_LOCKED = (1 << 2),
};
#define KEYELEM_FLOAT_LEN_COORD 3
diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h
index ca0136522c1..3864593158d 100644
--- a/source/blender/makesdna/DNA_lattice_types.h
+++ b/source/blender/makesdna/DNA_lattice_types.h
@@ -36,46 +36,46 @@ struct MDeformVert;
#
#
typedef struct EditLatt {
- struct Lattice *latt;
+ struct Lattice *latt;
- int shapenr;
+ int shapenr;
} EditLatt;
typedef struct Lattice {
- ID id;
- struct AnimData *adt;
+ ID id;
+ struct AnimData *adt;
- short pntsu, pntsv, pntsw, flag;
- short opntsu, opntsv, opntsw;
- char _pad2[3];
- char typeu, typev, typew;
- /** Active element index, unset with LT_ACTBP_NONE. */
- int actbp;
+ short pntsu, pntsv, pntsw, flag;
+ short opntsu, opntsv, opntsw;
+ char _pad2[3];
+ char typeu, typev, typew;
+ /** Active element index, unset with LT_ACTBP_NONE. */
+ int actbp;
- float fu, fv, fw, du, dv, dw;
+ float fu, fv, fw, du, dv, dw;
- struct BPoint *def;
+ struct BPoint *def;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- struct Key *key;
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ struct Key *key;
- struct MDeformVert *dvert;
- /** Multiply the influence, MAX_VGROUP_NAME. */
- char vgroup[64];
+ struct MDeformVert *dvert;
+ /** Multiply the influence, MAX_VGROUP_NAME. */
+ char vgroup[64];
- struct EditLatt *editlatt;
- void *batch_cache;
+ struct EditLatt *editlatt;
+ void *batch_cache;
} Lattice;
/* ***************** LATTICE ********************* */
/* flag */
-#define LT_GRID 1
-#define LT_OUTSIDE 2
+#define LT_GRID 1
+#define LT_OUTSIDE 2
-#define LT_DS_EXPAND 4
+#define LT_DS_EXPAND 4
-#define LT_ACTBP_NONE -1
+#define LT_ACTBP_NONE -1
#endif
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
index aa7ca2ca987..dd8adeaf153 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -29,124 +29,124 @@ extern "C" {
#include "DNA_listBase.h"
typedef struct Base {
- struct Base *next, *prev;
-
- /* Flags which are based on the collections flags evaluation, does not
- * include flags from object's restrictions. */
- short flag_from_collection;
-
- /* Final flags, including both accumulated collection flags and object's
- * restriction flags. */
- short flag;
-
- unsigned short local_view_bits;
- short sx, sy;
- char _pad1[6];
- struct Object *object;
- unsigned int lay DNA_DEPRECATED;
- int flag_legacy;
-
- /* 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;
- void *_pad;
+ struct Base *next, *prev;
+
+ /* Flags which are based on the collections flags evaluation, does not
+ * include flags from object's restrictions. */
+ short flag_from_collection;
+
+ /* Final flags, including both accumulated collection flags and object's
+ * restriction flags. */
+ short flag;
+
+ unsigned short local_view_bits;
+ short sx, sy;
+ char _pad1[6];
+ struct Object *object;
+ unsigned int lay DNA_DEPRECATED;
+ int flag_legacy;
+
+ /* 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;
+ void *_pad;
} Base;
typedef struct ViewLayerEngineData {
- struct ViewLayerEngineData *next, *prev;
- struct DrawEngineType *engine_type;
- void *storage;
- void (*free)(void *storage);
+ struct ViewLayerEngineData *next, *prev;
+ struct DrawEngineType *engine_type;
+ void *storage;
+ void (*free)(void *storage);
} ViewLayerEngineData;
typedef struct LayerCollection {
- struct LayerCollection *next, *prev;
- struct Collection *collection;
- struct SceneCollection *scene_collection DNA_DEPRECATED;
- short flag;
- short runtime_flag;
- char _pad[4];
- /** Synced with collection->children. */
- ListBase layer_collections;
+ struct LayerCollection *next, *prev;
+ struct Collection *collection;
+ struct SceneCollection *scene_collection DNA_DEPRECATED;
+ short flag;
+ short runtime_flag;
+ char _pad[4];
+ /** Synced with collection->children. */
+ ListBase layer_collections;
} LayerCollection;
typedef struct ViewLayer {
- struct ViewLayer *next, *prev;
- /** MAX_NAME. */
- char name[64];
- short flag;
- char _pad[6];
- /** ObjectBase. */
- ListBase object_bases;
- /** Default allocated now. */
- struct SceneStats *stats;
- struct Base *basact;
- /** LayerCollection. */
- ListBase layer_collections;
- LayerCollection *active_collection;
-
- /* Old SceneRenderLayer data. */
- int layflag;
- /** Pass_xor has to be after passflag. */
- int passflag;
- float pass_alpha_threshold;
- int samples;
-
- struct Material *mat_override;
- /** Equivalent to datablocks ID properties. */
- struct IDProperty *id_properties;
-
- struct FreestyleConfig freestyle_config;
-
- /* Runtime data */
- /** ViewLayerEngineData. */
- ListBase drawdata;
- struct Base **object_bases_array;
- struct GHash *object_bases_hash;
+ struct ViewLayer *next, *prev;
+ /** MAX_NAME. */
+ char name[64];
+ short flag;
+ char _pad[6];
+ /** ObjectBase. */
+ ListBase object_bases;
+ /** Default allocated now. */
+ struct SceneStats *stats;
+ struct Base *basact;
+ /** LayerCollection. */
+ ListBase layer_collections;
+ LayerCollection *active_collection;
+
+ /* Old SceneRenderLayer data. */
+ int layflag;
+ /** Pass_xor has to be after passflag. */
+ int passflag;
+ float pass_alpha_threshold;
+ int samples;
+
+ struct Material *mat_override;
+ /** Equivalent to datablocks ID properties. */
+ struct IDProperty *id_properties;
+
+ struct FreestyleConfig freestyle_config;
+
+ /* Runtime data */
+ /** ViewLayerEngineData. */
+ ListBase drawdata;
+ struct Base **object_bases_array;
+ struct GHash *object_bases_hash;
} ViewLayer;
/* Base->flag */
enum {
- /* User controlled flags. */
- BASE_SELECTED = (1 << 0), /* Object is selected. */
- BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
-
- /* Runtime evaluated flags. */
- BASE_VISIBLE = (1 << 1), /* Object is enabled and visible. */
- BASE_SELECTABLE = (1 << 2), /* Object can be selected. */
- BASE_FROM_DUPLI = (1 << 3), /* Object comes from duplicator. */
- /* BASE_DEPRECATED = (1 << 4), */
- BASE_FROM_SET = (1 << 5), /* Object comes from set. */
- BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */
- BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */
- /* BASE_DEPRECATED = (1 << 9), */
- BASE_HOLDOUT = (1 << 10), /* Object masked out from render */
- BASE_INDIRECT_ONLY = (1 << 11), /* Object only contributes indirectly to render */
+ /* User controlled flags. */
+ BASE_SELECTED = (1 << 0), /* Object is selected. */
+ BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
+
+ /* Runtime evaluated flags. */
+ BASE_VISIBLE = (1 << 1), /* Object is enabled and visible. */
+ BASE_SELECTABLE = (1 << 2), /* Object can be selected. */
+ BASE_FROM_DUPLI = (1 << 3), /* Object comes from duplicator. */
+ /* BASE_DEPRECATED = (1 << 4), */
+ BASE_FROM_SET = (1 << 5), /* Object comes from set. */
+ BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */
+ BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */
+ /* BASE_DEPRECATED = (1 << 9), */
+ BASE_HOLDOUT = (1 << 10), /* Object masked out from render */
+ BASE_INDIRECT_ONLY = (1 << 11), /* Object only contributes indirectly to render */
};
/* LayerCollection->flag */
enum {
- /* 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_RESTRICT_VIEW = (1 << 7),
+ /* 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_RESTRICT_VIEW = (1 << 7),
};
/* Layer Collection->runtime_flag */
enum {
- LAYER_COLLECTION_HAS_OBJECTS = (1 << 0),
- LAYER_COLLECTION_VISIBLE = (1 << 1),
+ LAYER_COLLECTION_HAS_OBJECTS = (1 << 0),
+ LAYER_COLLECTION_VISIBLE = (1 << 1),
};
/* ViewLayer->flag */
enum {
- VIEW_LAYER_RENDER = (1 << 0),
- /* VIEW_LAYER_DEPRECATED = (1 << 1), */
- VIEW_LAYER_FREESTYLE = (1 << 2),
+ VIEW_LAYER_RENDER = (1 << 0),
+ /* VIEW_LAYER_DEPRECATED = (1 << 1), */
+ VIEW_LAYER_FREESTYLE = (1 << 2),
};
/****************************** Deprecated ******************************/
@@ -156,22 +156,22 @@ enum {
#define USE_COLLECTION_COMPAT_28
typedef struct SceneCollection {
- struct SceneCollection *next, *prev;
- /** MAX_NAME. */
- char name[64];
- /** For UI. */
- int active_object_index;
- short flag;
- char type;
- char _pad;
- /** (Object *)LinkData->data. */
- ListBase objects;
- /** Nested collections. */
- ListBase scene_collections;
+ struct SceneCollection *next, *prev;
+ /** MAX_NAME. */
+ char name[64];
+ /** For UI. */
+ int active_object_index;
+ short flag;
+ char type;
+ char _pad;
+ /** (Object *)LinkData->data. */
+ ListBase objects;
+ /** Nested collections. */
+ ListBase scene_collections;
} SceneCollection;
#ifdef __cplusplus
}
#endif
-#endif /* __DNA_LAYER_TYPES_H__ */
+#endif /* __DNA_LAYER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_light_types.h b/source/blender/makesdna/DNA_light_types.h
index ec913aa2b48..d3c98f30352 100644
--- a/source/blender/makesdna/DNA_light_types.h
+++ b/source/blender/makesdna/DNA_light_types.h
@@ -28,7 +28,7 @@
#include "DNA_ID.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 18
+# define MAX_MTEX 18
#endif
struct AnimData;
@@ -38,114 +38,114 @@ struct MTex;
struct bNodeTree;
typedef struct Light {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
- short type, flag;
- int mode;
+ short type, flag;
+ int mode;
- float r, g, b, k;
- float shdwr, shdwg, shdwb, shdwpad;
+ float r, g, b, k;
+ float shdwr, shdwg, shdwb, shdwpad;
- float energy, dist, spotsize, spotblend;
+ float energy, dist, spotsize, spotblend;
- /** Quad1 and Quad2 attenuation. */
- float att1, att2;
- float coeff_const, coeff_lin, coeff_quad;
- char _pad0[4];
- struct CurveMapping *curfalloff;
- short falloff_type;
- char _pad2[2];
+ /** Quad1 and Quad2 attenuation. */
+ float att1, att2;
+ float coeff_const, coeff_lin, coeff_quad;
+ char _pad0[4];
+ struct CurveMapping *curfalloff;
+ short falloff_type;
+ char _pad2[2];
- float clipsta, clipend;
- float bias, soft, bleedbias, bleedexp;
- short bufsize, samp, buffers, filtertype;
- char bufflag, buftype;
+ float clipsta, clipend;
+ float bias, soft, bleedbias, bleedexp;
+ short bufsize, samp, buffers, filtertype;
+ char bufflag, buftype;
- short area_shape;
- float area_size, area_sizey, area_sizez;
+ short area_shape;
+ float area_size, area_sizey, area_sizez;
- /* texact is for buttons */
- short texact, shadhalostep;
+ /* texact is for buttons */
+ short texact, shadhalostep;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- short pr_texture, use_nodes;
- char _pad6[4];
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ short pr_texture, use_nodes;
+ char _pad6[4];
- /* Eevee */
- float cascade_max_dist;
- float cascade_exponent;
- float cascade_fade;
- int cascade_count;
+ /* Eevee */
+ float cascade_max_dist;
+ float cascade_exponent;
+ float cascade_fade;
+ int cascade_count;
- float contact_dist, contact_bias, contact_spread, contact_thickness;
+ float contact_dist, contact_bias, contact_spread, contact_thickness;
- float spec_fac, att_dist;
+ float spec_fac, att_dist;
- /* preview */
- struct PreviewImage *preview;
+ /* preview */
+ struct PreviewImage *preview;
- /* nodes */
- struct bNodeTree *nodetree;
+ /* nodes */
+ struct bNodeTree *nodetree;
} Light;
/* **************** LIGHT ********************* */
/* flag */
-#define LA_DS_EXPAND (1 << 0)
- /* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
- * otherwise anim-editors will not read correctly
- */
+#define LA_DS_EXPAND (1 << 0)
+/* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
+ * otherwise anim-editors will not read correctly
+ */
#define LA_DS_SHOW_TEXS (1 << 2)
/* type */
-#define LA_LOCAL 0
-#define LA_SUN 1
-#define LA_SPOT 2
-/* #define LA_HEMI 3 */ /* not used anymore */
-#define LA_AREA 4
+#define LA_LOCAL 0
+#define LA_SUN 1
+#define LA_SPOT 2
+/* #define LA_HEMI 3 */ /* not used anymore */
+#define LA_AREA 4
/* mode */
-#define LA_SHADOW (1 << 0)
-/* #define LA_HALO (1 << 1) */ /* not used anymore */
-/* #define LA_LAYER (1 << 2) */ /* not used anymore */
-/* #define LA_QUAD (1 << 3) */ /* not used anymore */
-/* #define LA_NEG (1 << 4) */ /* not used anymore */
+#define LA_SHADOW (1 << 0)
+/* #define LA_HALO (1 << 1) */ /* not used anymore */
+/* #define LA_LAYER (1 << 2) */ /* not used anymore */
+/* #define LA_QUAD (1 << 3) */ /* not used anymore */
+/* #define LA_NEG (1 << 4) */ /* not used anymore */
/* #define LA_ONLYSHADOW(1 << 5) */ /* not used anymore */
-/* #define LA_SPHERE (1 << 6) */ /* not used anymore */
-#define LA_SQUARE (1 << 7)
-/* #define LA_TEXTURE (1 << 8) */ /* not used anymore */
-/* #define LA_OSATEX (1 << 9) */ /* not used anymore */
-/* #define LA_DEEP_SHADOW (1 << 10) */ /* not used anywhere */
-/* #define LA_NO_DIFF (1 << 11) */ /* not used anywhere */
-/* #define LA_NO_SPEC (1 << 12) */ /* not used anywhere */
-/* #define LA_SHAD_RAY (1 << 13) */ /* not used anywhere - cleaned */
+/* #define LA_SPHERE (1 << 6) */ /* not used anymore */
+#define LA_SQUARE (1 << 7)
+/* #define LA_TEXTURE (1 << 8) */ /* not used anymore */
+/* #define LA_OSATEX (1 << 9) */ /* not used anymore */
+/* #define LA_DEEP_SHADOW (1 << 10) */ /* not used anywhere */
+/* #define LA_NO_DIFF (1 << 11) */ /* not used anywhere */
+/* #define LA_NO_SPEC (1 << 12) */ /* not used anywhere */
+/* #define LA_SHAD_RAY (1 << 13) */ /* not used anywhere - cleaned */
/* yafray: light shadowbuffer flag, softlight */
/* Since it is used with LOCAL light, can't use LA_SHAD */
-/* #define LA_YF_SOFT (1 << 14) */ /* not used anymore */
-/* #define LA_LAYER_SHADOW (1 << 15) */ /* not used anymore */
-/* #define LA_SHAD_TEX (1 << 16) */ /* not used anymore */
-#define LA_SHOW_CONE (1 << 17)
+/* #define LA_YF_SOFT (1 << 14) */ /* not used anymore */
+/* #define LA_LAYER_SHADOW (1 << 15) */ /* not used anymore */
+/* #define LA_SHAD_TEX (1 << 16) */ /* not used anymore */
+#define LA_SHOW_CONE (1 << 17)
/* #define LA_SHOW_SHADOW_BOX (1 << 18) */
#define LA_SHAD_CONTACT (1 << 19)
#define LA_CUSTOM_ATTENUATION (1 << 20)
/* falloff_type */
-#define LA_FALLOFF_CONSTANT 0
-#define LA_FALLOFF_INVLINEAR 1
-#define LA_FALLOFF_INVSQUARE 2
-#define LA_FALLOFF_CURVE 3
-#define LA_FALLOFF_SLIDERS 4
-#define LA_FALLOFF_INVCOEFFICIENTS 5
+#define LA_FALLOFF_CONSTANT 0
+#define LA_FALLOFF_INVLINEAR 1
+#define LA_FALLOFF_INVSQUARE 2
+#define LA_FALLOFF_CURVE 3
+#define LA_FALLOFF_SLIDERS 4
+#define LA_FALLOFF_INVCOEFFICIENTS 5
/* area shape */
-#define LA_AREA_SQUARE 0
-#define LA_AREA_RECT 1
+#define LA_AREA_SQUARE 0
+#define LA_AREA_RECT 1
/* #define LA_AREA_CUBE 2 */ /* UNUSED */
/* #define LA_AREA_BOX 3 */ /* UNUSED */
-#define LA_AREA_DISK 4
-#define LA_AREA_ELLIPSE 5
+#define LA_AREA_DISK 4
+#define LA_AREA_ELLIPSE 5
#endif /* __DNA_LIGHT_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
index f852b1f5a7f..92b343fbeb9 100644
--- a/source/blender/makesdna/DNA_lightprobe_types.h
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -33,82 +33,82 @@ struct AnimData;
struct Object;
typedef struct LightProbe {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- /** For realtime probe objects. */
- char type;
- /** General purpose flags for probes. */
- char flag;
- /** Attenuation type. */
- char attenuation_type;
- /** Parallax type. */
- char parallax_type;
-
- /** Influence Radius. */
- float distinf;
- /** Parallax Radius. */
- float distpar;
- /** Influence falloff. */
- float falloff;
-
- float clipsta, clipend;
-
- /** VSM visibility biases. */
- float vis_bias, vis_bleedbias;
- float vis_blur;
-
- /** Intensity multiplier. */
- float intensity;
-
- /** Irradiance grid resolution. */
- int grid_resolution_x;
- int grid_resolution_y;
- int grid_resolution_z;
- char _pad1[4];
-
- /** Object to use as a parallax origin. */
- struct Object *parallax_ob;
- /** Image to use on as lighting data. */
- struct Image *image;
- /** Object visibility group, inclusive or exclusive. */
- struct Collection *visibility_grp;
-
- /* Runtime display data */
- float distfalloff, distgridinf;
- char _pad[8];
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ /** For realtime probe objects. */
+ char type;
+ /** General purpose flags for probes. */
+ char flag;
+ /** Attenuation type. */
+ char attenuation_type;
+ /** Parallax type. */
+ char parallax_type;
+
+ /** Influence Radius. */
+ float distinf;
+ /** Parallax Radius. */
+ float distpar;
+ /** Influence falloff. */
+ float falloff;
+
+ float clipsta, clipend;
+
+ /** VSM visibility biases. */
+ float vis_bias, vis_bleedbias;
+ float vis_blur;
+
+ /** Intensity multiplier. */
+ float intensity;
+
+ /** Irradiance grid resolution. */
+ int grid_resolution_x;
+ int grid_resolution_y;
+ int grid_resolution_z;
+ char _pad1[4];
+
+ /** Object to use as a parallax origin. */
+ struct Object *parallax_ob;
+ /** Image to use on as lighting data. */
+ struct Image *image;
+ /** Object visibility group, inclusive or exclusive. */
+ struct Collection *visibility_grp;
+
+ /* Runtime display data */
+ float distfalloff, distgridinf;
+ char _pad[8];
} LightProbe;
/* Probe->type */
enum {
- LIGHTPROBE_TYPE_CUBE = 0,
- LIGHTPROBE_TYPE_PLANAR = 1,
- LIGHTPROBE_TYPE_GRID = 2,
+ LIGHTPROBE_TYPE_CUBE = 0,
+ LIGHTPROBE_TYPE_PLANAR = 1,
+ LIGHTPROBE_TYPE_GRID = 2,
};
/* Probe->flag */
enum {
- 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_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),
};
/* Probe->display */
enum {
- LIGHTPROBE_DISP_WIRE = 0,
- LIGHTPROBE_DISP_SHADED = 1,
- LIGHTPROBE_DISP_DIFFUSE = 2,
- LIGHTPROBE_DISP_REFLECTIVE = 3,
+ LIGHTPROBE_DISP_WIRE = 0,
+ LIGHTPROBE_DISP_SHADED = 1,
+ LIGHTPROBE_DISP_DIFFUSE = 2,
+ LIGHTPROBE_DISP_REFLECTIVE = 3,
};
/* Probe->parallax && Probe->attenuation_type*/
enum {
- LIGHTPROBE_SHAPE_ELIPSOID = 0,
- LIGHTPROBE_SHAPE_BOX = 1,
+ LIGHTPROBE_SHAPE_ELIPSOID = 0,
+ LIGHTPROBE_SHAPE_BOX = 1,
};
/* ------- Eevee LightProbes ------- */
@@ -120,80 +120,80 @@ enum {
/* Must match CubeData. */
typedef struct LightProbeCache {
- float position[3], parallax_type;
- float attenuation_fac;
- float attenuation_type;
- float _pad3[2];
- float attenuationmat[4][4];
- float parallaxmat[4][4];
+ float position[3], parallax_type;
+ float attenuation_fac;
+ float attenuation_type;
+ float _pad3[2];
+ float attenuationmat[4][4];
+ float parallaxmat[4][4];
} LightProbeCache;
/* Must match GridData. */
typedef struct LightGridCache {
- float mat[4][4];
- /** Offset to the first irradiance sample in the pool. */
- int resolution[3], offset;
- float corner[3], attenuation_scale;
- /** World space vector between 2 opposite cells. */
- float increment_x[3], attenuation_bias;
- float increment_y[3], level_bias;
- float increment_z[3], _pad4;
- float visibility_bias, visibility_bleed, visibility_range, _pad5;
+ float mat[4][4];
+ /** Offset to the first irradiance sample in the pool. */
+ int resolution[3], offset;
+ float corner[3], attenuation_scale;
+ /** World space vector between 2 opposite cells. */
+ float increment_x[3], attenuation_bias;
+ float increment_y[3], level_bias;
+ float increment_z[3], _pad4;
+ float visibility_bias, visibility_bleed, visibility_range, _pad5;
} LightGridCache;
/* ------ Eevee Lightcache ------- */
typedef struct LightCacheTexture {
- struct GPUTexture *tex;
- /* Copy of GPU datas to create GPUTextures on file read. */
- char *data;
- int tex_size[3];
- char data_type;
- char components;
- char _pad[2];
+ struct GPUTexture *tex;
+ /* Copy of GPU datas to create GPUTextures on file read. */
+ char *data;
+ int tex_size[3];
+ char data_type;
+ char components;
+ char _pad[2];
} LightCacheTexture;
typedef struct LightCache {
- int flag;
- /* only a single cache for now */
- /** Number of probes to use for rendering. */
- int cube_len, grid_len;
- /** Number of mipmap level to use. */
- int mips_len;
- /** Size of a visibility/reflection sample. */
- int vis_res, ref_res;
- 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 GPUTexture, only data. */
- LightCacheTexture *cube_mips;
- /* All lightprobes data contained in the cache. */
- LightProbeCache *cube_data;
- LightGridCache *grid_data;
+ int flag;
+ /* only a single cache for now */
+ /** Number of probes to use for rendering. */
+ int cube_len, grid_len;
+ /** Number of mipmap level to use. */
+ int mips_len;
+ /** Size of a visibility/reflection sample. */
+ int vis_res, ref_res;
+ 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 GPUTexture, only data. */
+ LightCacheTexture *cube_mips;
+ /* All lightprobes data contained in the cache. */
+ LightProbeCache *cube_data;
+ LightGridCache *grid_data;
} LightCache;
/* LightCache->flag */
enum {
- 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),
+ 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),
};
/* EEVEE_LightCacheTexture->data_type */
enum {
- LIGHTCACHETEX_BYTE = (1 << 0),
- LIGHTCACHETEX_FLOAT = (1 << 1),
- LIGHTCACHETEX_UINT = (1 << 2),
+ LIGHTCACHETEX_BYTE = (1 << 0),
+ LIGHTCACHETEX_FLOAT = (1 << 1),
+ LIGHTCACHETEX_UINT = (1 << 2),
};
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_linestyle_types.h b/source/blender/makesdna/DNA_linestyle_types.h
index 34392016f27..48850805724 100644
--- a/source/blender/makesdna/DNA_linestyle_types.h
+++ b/source/blender/makesdna/DNA_linestyle_types.h
@@ -28,11 +28,11 @@
#include "DNA_ID.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 18
+# define MAX_MTEX 18
#endif
/* texco (also in DNA_material_types.h) */
-#define TEXCO_STROKE 16 /* actually it's UV */
+#define TEXCO_STROKE 16 /* actually it's UV */
struct AnimData;
struct ColorBand;
@@ -42,539 +42,539 @@ struct Object;
struct bNodeTree;
typedef struct LineStyleModifier {
- struct LineStyleModifier *next, *prev;
-
- /** MAX_NAME. */
- char name[64];
- int type;
- float influence;
- int flags;
- int blend;
+ struct LineStyleModifier *next, *prev;
+
+ /** MAX_NAME. */
+ char name[64];
+ int type;
+ float influence;
+ int flags;
+ int blend;
} LineStyleModifier;
/* LineStyleModifier::type */
-#define LS_MODIFIER_ALONG_STROKE 1
-#define LS_MODIFIER_DISTANCE_FROM_CAMERA 2
-#define LS_MODIFIER_DISTANCE_FROM_OBJECT 3
-#define LS_MODIFIER_MATERIAL 4
-#define LS_MODIFIER_SAMPLING 5
-#define LS_MODIFIER_BEZIER_CURVE 6
-#define LS_MODIFIER_SINUS_DISPLACEMENT 7
-#define LS_MODIFIER_SPATIAL_NOISE 8
-#define LS_MODIFIER_PERLIN_NOISE_1D 9
-#define LS_MODIFIER_PERLIN_NOISE_2D 10
-#define LS_MODIFIER_BACKBONE_STRETCHER 11
-#define LS_MODIFIER_TIP_REMOVER 12
-#define LS_MODIFIER_CALLIGRAPHY 13
-#define LS_MODIFIER_POLYGONIZATION 14
-#define LS_MODIFIER_GUIDING_LINES 15
-#define LS_MODIFIER_BLUEPRINT 16
-#define LS_MODIFIER_2D_OFFSET 17
-#define LS_MODIFIER_2D_TRANSFORM 18
-#define LS_MODIFIER_TANGENT 19
-#define LS_MODIFIER_NOISE 20
-#define LS_MODIFIER_CREASE_ANGLE 21
-#define LS_MODIFIER_SIMPLIFICATION 22
-#define LS_MODIFIER_CURVATURE_3D 23
-#define LS_MODIFIER_NUM 24
+#define LS_MODIFIER_ALONG_STROKE 1
+#define LS_MODIFIER_DISTANCE_FROM_CAMERA 2
+#define LS_MODIFIER_DISTANCE_FROM_OBJECT 3
+#define LS_MODIFIER_MATERIAL 4
+#define LS_MODIFIER_SAMPLING 5
+#define LS_MODIFIER_BEZIER_CURVE 6
+#define LS_MODIFIER_SINUS_DISPLACEMENT 7
+#define LS_MODIFIER_SPATIAL_NOISE 8
+#define LS_MODIFIER_PERLIN_NOISE_1D 9
+#define LS_MODIFIER_PERLIN_NOISE_2D 10
+#define LS_MODIFIER_BACKBONE_STRETCHER 11
+#define LS_MODIFIER_TIP_REMOVER 12
+#define LS_MODIFIER_CALLIGRAPHY 13
+#define LS_MODIFIER_POLYGONIZATION 14
+#define LS_MODIFIER_GUIDING_LINES 15
+#define LS_MODIFIER_BLUEPRINT 16
+#define LS_MODIFIER_2D_OFFSET 17
+#define LS_MODIFIER_2D_TRANSFORM 18
+#define LS_MODIFIER_TANGENT 19
+#define LS_MODIFIER_NOISE 20
+#define LS_MODIFIER_CREASE_ANGLE 21
+#define LS_MODIFIER_SIMPLIFICATION 22
+#define LS_MODIFIER_CURVATURE_3D 23
+#define LS_MODIFIER_NUM 24
/* LineStyleModifier::flags */
-#define LS_MODIFIER_ENABLED 1
-#define LS_MODIFIER_EXPANDED 2
+#define LS_MODIFIER_ENABLED 1
+#define LS_MODIFIER_EXPANDED 2
/* flags (for color) */
-#define LS_MODIFIER_USE_RAMP 1
+#define LS_MODIFIER_USE_RAMP 1
/* flags (for alpha & thickness) */
-#define LS_MODIFIER_USE_CURVE 1
-#define LS_MODIFIER_INVERT 2
+#define LS_MODIFIER_USE_CURVE 1
+#define LS_MODIFIER_INVERT 2
/* flags (for asymmetric thickness application) */
-#define LS_THICKNESS_ASYMMETRIC 1
+#define LS_THICKNESS_ASYMMETRIC 1
/* blend (for alpha & thickness) */
-#define LS_VALUE_BLEND 0
-#define LS_VALUE_ADD 1
-#define LS_VALUE_MULT 2
-#define LS_VALUE_SUB 3
-#define LS_VALUE_DIV 4
-#define LS_VALUE_DIFF 5
-#define LS_VALUE_MIN 6
-#define LS_VALUE_MAX 7
+#define LS_VALUE_BLEND 0
+#define LS_VALUE_ADD 1
+#define LS_VALUE_MULT 2
+#define LS_VALUE_SUB 3
+#define LS_VALUE_DIV 4
+#define LS_VALUE_DIFF 5
+#define LS_VALUE_MIN 6
+#define LS_VALUE_MAX 7
/* Along Stroke modifiers */
typedef struct LineStyleColorModifier_AlongStroke {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct ColorBand *color_ramp;
+ struct ColorBand *color_ramp;
} LineStyleColorModifier_AlongStroke;
typedef struct LineStyleAlphaModifier_AlongStroke {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ char _pad[4];
} LineStyleAlphaModifier_AlongStroke;
typedef struct LineStyleThicknessModifier_AlongStroke {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float value_min, value_max;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ float value_min, value_max;
+ char _pad[4];
} LineStyleThicknessModifier_AlongStroke;
/* Distance from Camera modifiers */
typedef struct LineStyleColorModifier_DistanceFromCamera {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct ColorBand *color_ramp;
- float range_min, range_max;
+ struct ColorBand *color_ramp;
+ float range_min, range_max;
} LineStyleColorModifier_DistanceFromCamera;
typedef struct LineStyleAlphaModifier_DistanceFromCamera {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float range_min, range_max;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ char _pad[4];
} LineStyleAlphaModifier_DistanceFromCamera;
typedef struct LineStyleThicknessModifier_DistanceFromCamera {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float range_min, range_max;
- float value_min, value_max;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ float value_min, value_max;
+ char _pad[4];
} LineStyleThicknessModifier_DistanceFromCamera;
/* Distance from Object modifiers */
typedef struct LineStyleColorModifier_DistanceFromObject {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct Object *target;
- struct ColorBand *color_ramp;
- float range_min, range_max;
+ struct Object *target;
+ struct ColorBand *color_ramp;
+ float range_min, range_max;
} LineStyleColorModifier_DistanceFromObject;
typedef struct LineStyleAlphaModifier_DistanceFromObject {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct Object *target;
- struct CurveMapping *curve;
- int flags;
- float range_min, range_max;
- char _pad[4];
+ struct Object *target;
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ char _pad[4];
} LineStyleAlphaModifier_DistanceFromObject;
typedef struct LineStyleThicknessModifier_DistanceFromObject {
- struct LineStyleModifier modifier;
-
- struct Object *target;
- struct CurveMapping *curve;
- int flags;
- float range_min, range_max;
- float value_min, value_max;
- char _pad[4];
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ float value_min, value_max;
+ char _pad[4];
} LineStyleThicknessModifier_DistanceFromObject;
/* 3D curvature modifiers */
typedef struct LineStyleColorModifier_Curvature_3D {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float min_curvature, max_curvature;
- struct ColorBand *color_ramp;
- float range_min, range_max;
+ float min_curvature, max_curvature;
+ struct ColorBand *color_ramp;
+ float range_min, range_max;
} LineStyleColorModifier_Curvature_3D;
typedef struct LineStyleAlphaModifier_Curvature_3D {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float min_curvature, max_curvature;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ float min_curvature, max_curvature;
+ char _pad[4];
} LineStyleAlphaModifier_Curvature_3D;
typedef struct LineStyleThicknessModifier_Curvature_3D {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- char _pad[4];
- float min_curvature, max_curvature;
- float min_thickness, max_thickness;
+ struct CurveMapping *curve;
+ int flags;
+ char _pad[4];
+ float min_curvature, max_curvature;
+ float min_thickness, max_thickness;
} LineStyleThicknessModifier_Curvature_3D;
/* Noise modifiers (for color, alpha and thickness) */
typedef struct LineStyleColorModifier_Noise {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct ColorBand *color_ramp;
- float period, amplitude;
- int seed;
- char _pad[4];
+ struct ColorBand *color_ramp;
+ float period, amplitude;
+ int seed;
+ char _pad[4];
} LineStyleColorModifier_Noise;
typedef struct LineStyleAlphaModifier_Noise {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float period, amplitude;
- int seed;
+ struct CurveMapping *curve;
+ int flags;
+ float period, amplitude;
+ int seed;
} LineStyleAlphaModifier_Noise;
typedef struct LineStyleThicknessModifier_Noise {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float period, amplitude;
- int flags;
- int seed;
+ float period, amplitude;
+ int flags;
+ int seed;
} LineStyleThicknessModifier_Noise;
/* Crease Angle modifiers */
typedef struct LineStyleColorModifier_CreaseAngle {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct ColorBand *color_ramp;
- float min_angle, max_angle;
+ struct ColorBand *color_ramp;
+ float min_angle, max_angle;
} LineStyleColorModifier_CreaseAngle;
typedef struct LineStyleAlphaModifier_CreaseAngle {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float min_angle, max_angle;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ float min_angle, max_angle;
+ char _pad[4];
} LineStyleAlphaModifier_CreaseAngle;
typedef struct LineStyleThicknessModifier_CreaseAngle {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- char _pad[4];
- float min_angle, max_angle;
- float min_thickness, max_thickness;
+ struct CurveMapping *curve;
+ int flags;
+ char _pad[4];
+ float min_angle, max_angle;
+ float min_thickness, max_thickness;
} LineStyleThicknessModifier_CreaseAngle;
/* Tangent modifiers */
typedef struct LineStyleColorModifier_Tangent {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct ColorBand *color_ramp;
+ struct ColorBand *color_ramp;
} LineStyleColorModifier_Tangent;
typedef struct LineStyleAlphaModifier_Tangent {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ char _pad[4];
} LineStyleAlphaModifier_Tangent;
typedef struct LineStyleThicknessModifier_Tangent {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float min_thickness, max_thickness;
- char _pad[4];
+ struct CurveMapping *curve;
+ int flags;
+ float min_thickness, max_thickness;
+ char _pad[4];
} LineStyleThicknessModifier_Tangent;
/* Material modifiers */
/* mat_attr */
-#define LS_MODIFIER_MATERIAL_DIFF 1
-#define LS_MODIFIER_MATERIAL_DIFF_R 2
-#define LS_MODIFIER_MATERIAL_DIFF_G 3
-#define LS_MODIFIER_MATERIAL_DIFF_B 4
-#define LS_MODIFIER_MATERIAL_SPEC 5
-#define LS_MODIFIER_MATERIAL_SPEC_R 6
-#define LS_MODIFIER_MATERIAL_SPEC_G 7
-#define LS_MODIFIER_MATERIAL_SPEC_B 8
-#define LS_MODIFIER_MATERIAL_SPEC_HARD 9
-#define LS_MODIFIER_MATERIAL_ALPHA 10
-#define LS_MODIFIER_MATERIAL_LINE 11
-#define LS_MODIFIER_MATERIAL_LINE_R 12
-#define LS_MODIFIER_MATERIAL_LINE_G 13
-#define LS_MODIFIER_MATERIAL_LINE_B 14
-#define LS_MODIFIER_MATERIAL_LINE_A 15
+#define LS_MODIFIER_MATERIAL_DIFF 1
+#define LS_MODIFIER_MATERIAL_DIFF_R 2
+#define LS_MODIFIER_MATERIAL_DIFF_G 3
+#define LS_MODIFIER_MATERIAL_DIFF_B 4
+#define LS_MODIFIER_MATERIAL_SPEC 5
+#define LS_MODIFIER_MATERIAL_SPEC_R 6
+#define LS_MODIFIER_MATERIAL_SPEC_G 7
+#define LS_MODIFIER_MATERIAL_SPEC_B 8
+#define LS_MODIFIER_MATERIAL_SPEC_HARD 9
+#define LS_MODIFIER_MATERIAL_ALPHA 10
+#define LS_MODIFIER_MATERIAL_LINE 11
+#define LS_MODIFIER_MATERIAL_LINE_R 12
+#define LS_MODIFIER_MATERIAL_LINE_G 13
+#define LS_MODIFIER_MATERIAL_LINE_B 14
+#define LS_MODIFIER_MATERIAL_LINE_A 15
typedef struct LineStyleColorModifier_Material {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct ColorBand *color_ramp;
- int flags;
- int mat_attr;
+ struct ColorBand *color_ramp;
+ int flags;
+ int mat_attr;
} LineStyleColorModifier_Material;
typedef struct LineStyleAlphaModifier_Material {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- int mat_attr;
+ struct CurveMapping *curve;
+ int flags;
+ int mat_attr;
} LineStyleAlphaModifier_Material;
typedef struct LineStyleThicknessModifier_Material {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- struct CurveMapping *curve;
- int flags;
- float value_min, value_max;
- int mat_attr;
+ struct CurveMapping *curve;
+ int flags;
+ float value_min, value_max;
+ int mat_attr;
} LineStyleThicknessModifier_Material;
/* Geometry modifiers */
typedef struct LineStyleGeometryModifier_Sampling {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float sampling;
- char _pad[4];
+ float sampling;
+ char _pad[4];
} LineStyleGeometryModifier_Sampling;
typedef struct LineStyleGeometryModifier_BezierCurve {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float error;
- char _pad[4];
+ float error;
+ char _pad[4];
} LineStyleGeometryModifier_BezierCurve;
typedef struct LineStyleGeometryModifier_SinusDisplacement {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float wavelength, amplitude, phase;
- char _pad[4];
+ float wavelength, amplitude, phase;
+ char _pad[4];
} LineStyleGeometryModifier_SinusDisplacement;
/* LineStyleGeometryModifier_SpatialNoise::flags */
-#define LS_MODIFIER_SPATIAL_NOISE_SMOOTH 1
-#define LS_MODIFIER_SPATIAL_NOISE_PURERANDOM 2
+#define LS_MODIFIER_SPATIAL_NOISE_SMOOTH 1
+#define LS_MODIFIER_SPATIAL_NOISE_PURERANDOM 2
typedef struct LineStyleGeometryModifier_SpatialNoise {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float amplitude, scale;
- unsigned int octaves;
- int flags;
+ float amplitude, scale;
+ unsigned int octaves;
+ int flags;
} LineStyleGeometryModifier_SpatialNoise;
typedef struct LineStyleGeometryModifier_PerlinNoise1D {
- struct LineStyleModifier modifier;
-
- float frequency, amplitude;
- /** In radians!. */
- float angle;
- unsigned int octaves;
- int seed;
- char _pad1[4];
+ struct LineStyleModifier modifier;
+
+ float frequency, amplitude;
+ /** In radians!. */
+ float angle;
+ unsigned int octaves;
+ int seed;
+ char _pad1[4];
} LineStyleGeometryModifier_PerlinNoise1D;
typedef struct LineStyleGeometryModifier_PerlinNoise2D {
- struct LineStyleModifier modifier;
-
- float frequency, amplitude;
- /** In radians!. */
- float angle;
- unsigned int octaves;
- int seed;
- char _pad1[4];
+ struct LineStyleModifier modifier;
+
+ float frequency, amplitude;
+ /** In radians!. */
+ float angle;
+ unsigned int octaves;
+ int seed;
+ char _pad1[4];
} LineStyleGeometryModifier_PerlinNoise2D;
typedef struct LineStyleGeometryModifier_BackboneStretcher {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float backbone_length;
- char _pad[4];
+ float backbone_length;
+ char _pad[4];
} LineStyleGeometryModifier_BackboneStretcher;
typedef struct LineStyleGeometryModifier_TipRemover {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float tip_length;
- char _pad[4];
+ float tip_length;
+ char _pad[4];
} LineStyleGeometryModifier_TipRemover;
typedef struct LineStyleGeometryModifier_Polygonalization {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float error;
- char _pad[4];
+ float error;
+ char _pad[4];
} LineStyleGeometryModifier_Polygonalization;
typedef struct LineStyleGeometryModifier_GuidingLines {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float offset;
- char _pad[4];
+ float offset;
+ char _pad[4];
} LineStyleGeometryModifier_GuidingLines;
/* LineStyleGeometryModifier_BluePrintLines::shape */
-#define LS_MODIFIER_BLUEPRINT_CIRCLES 1
-#define LS_MODIFIER_BLUEPRINT_ELLIPSES 2
-#define LS_MODIFIER_BLUEPRINT_SQUARES 4
+#define LS_MODIFIER_BLUEPRINT_CIRCLES 1
+#define LS_MODIFIER_BLUEPRINT_ELLIPSES 2
+#define LS_MODIFIER_BLUEPRINT_SQUARES 4
typedef struct LineStyleGeometryModifier_Blueprint {
- struct LineStyleModifier modifier;
-
- int flags;
- unsigned int rounds;
- float backbone_length;
- unsigned int random_radius;
- unsigned int random_center;
- unsigned int random_backbone;
+ struct LineStyleModifier modifier;
+
+ int flags;
+ unsigned int rounds;
+ float backbone_length;
+ unsigned int random_radius;
+ unsigned int random_center;
+ unsigned int random_backbone;
} LineStyleGeometryModifier_Blueprint;
typedef struct LineStyleGeometryModifier_2DOffset {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float start, end;
- float x, y;
+ float start, end;
+ float x, y;
} LineStyleGeometryModifier_2DOffset;
/* LineStyleGeometryModifier_2DTransform::pivot */
-#define LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER 1
-#define LS_MODIFIER_2D_TRANSFORM_PIVOT_START 2
-#define LS_MODIFIER_2D_TRANSFORM_PIVOT_END 3
-#define LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM 4
-#define LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE 5
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER 1
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_START 2
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_END 3
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM 4
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE 5
typedef struct LineStyleGeometryModifier_2DTransform {
- struct LineStyleModifier modifier;
-
- int pivot;
- float scale_x, scale_y;
- /** In radians!. */
- float angle;
- float pivot_u;
- float pivot_x, pivot_y;
- char _pad[4];
+ struct LineStyleModifier modifier;
+
+ int pivot;
+ float scale_x, scale_y;
+ /** In radians!. */
+ float angle;
+ float pivot_u;
+ float pivot_x, pivot_y;
+ char _pad[4];
} LineStyleGeometryModifier_2DTransform;
typedef struct LineStyleGeometryModifier_Simplification {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float tolerance;
- char _pad[4];
-}LineStyleGeometryModifier_Simplification;
+ float tolerance;
+ char _pad[4];
+} LineStyleGeometryModifier_Simplification;
/* Calligraphic thickness modifier */
typedef struct LineStyleThicknessModifier_Calligraphy {
- struct LineStyleModifier modifier;
+ struct LineStyleModifier modifier;
- float min_thickness, max_thickness;
- /** In radians!. */
- float orientation;
- char _pad[4];
+ float min_thickness, max_thickness;
+ /** In radians!. */
+ float orientation;
+ char _pad[4];
} LineStyleThicknessModifier_Calligraphy;
/* FreestyleLineStyle::panel */
-#define LS_PANEL_STROKES 1
-#define LS_PANEL_COLOR 2
-#define LS_PANEL_ALPHA 3
-#define LS_PANEL_THICKNESS 4
-#define LS_PANEL_GEOMETRY 5
-#define LS_PANEL_TEXTURE 6
-#define LS_PANEL_MISC 7
+#define LS_PANEL_STROKES 1
+#define LS_PANEL_COLOR 2
+#define LS_PANEL_ALPHA 3
+#define LS_PANEL_THICKNESS 4
+#define LS_PANEL_GEOMETRY 5
+#define LS_PANEL_TEXTURE 6
+#define LS_PANEL_MISC 7
/* FreestyleLineStyle::flag */
-#define LS_DS_EXPAND (1 << 0) /* for animation editors */
-#define LS_SAME_OBJECT (1 << 1)
-#define LS_DASHED_LINE (1 << 2)
-#define LS_MATERIAL_BOUNDARY (1 << 3)
-#define LS_MIN_2D_LENGTH (1 << 4)
-#define LS_MAX_2D_LENGTH (1 << 5)
-#define LS_NO_CHAINING (1 << 6)
-#define LS_MIN_2D_ANGLE (1 << 7)
-#define LS_MAX_2D_ANGLE (1 << 8)
-#define LS_SPLIT_LENGTH (1 << 9)
-#define LS_SPLIT_PATTERN (1 << 10)
-#define LS_NO_SORTING (1 << 11)
-#define LS_REVERSE_ORDER (1 << 12) /* for sorting */
-#define LS_TEXTURE (1 << 13)
-#define LS_CHAIN_COUNT (1 << 14)
+#define LS_DS_EXPAND (1 << 0) /* for animation editors */
+#define LS_SAME_OBJECT (1 << 1)
+#define LS_DASHED_LINE (1 << 2)
+#define LS_MATERIAL_BOUNDARY (1 << 3)
+#define LS_MIN_2D_LENGTH (1 << 4)
+#define LS_MAX_2D_LENGTH (1 << 5)
+#define LS_NO_CHAINING (1 << 6)
+#define LS_MIN_2D_ANGLE (1 << 7)
+#define LS_MAX_2D_ANGLE (1 << 8)
+#define LS_SPLIT_LENGTH (1 << 9)
+#define LS_SPLIT_PATTERN (1 << 10)
+#define LS_NO_SORTING (1 << 11)
+#define LS_REVERSE_ORDER (1 << 12) /* for sorting */
+#define LS_TEXTURE (1 << 13)
+#define LS_CHAIN_COUNT (1 << 14)
/* FreestyleLineStyle::chaining */
-#define LS_CHAINING_PLAIN 1
-#define LS_CHAINING_SKETCHY 2
+#define LS_CHAINING_PLAIN 1
+#define LS_CHAINING_SKETCHY 2
/* FreestyleLineStyle::caps */
-#define LS_CAPS_BUTT 1
-#define LS_CAPS_ROUND 2
-#define LS_CAPS_SQUARE 3
+#define LS_CAPS_BUTT 1
+#define LS_CAPS_ROUND 2
+#define LS_CAPS_SQUARE 3
/* FreestyleLineStyle::thickness_position */
-#define LS_THICKNESS_CENTER 1
-#define LS_THICKNESS_INSIDE 2
-#define LS_THICKNESS_OUTSIDE 3
-#define LS_THICKNESS_RELATIVE 4 /* thickness_ratio is used */
+#define LS_THICKNESS_CENTER 1
+#define LS_THICKNESS_INSIDE 2
+#define LS_THICKNESS_OUTSIDE 3
+#define LS_THICKNESS_RELATIVE 4 /* thickness_ratio is used */
/* FreestyleLineStyle::sort_key */
-#define LS_SORT_KEY_DISTANCE_FROM_CAMERA 1
-#define LS_SORT_KEY_2D_LENGTH 2
-#define LS_SORT_KEY_PROJECTED_X 3
-#define LS_SORT_KEY_PROJECTED_Y 4
+#define LS_SORT_KEY_DISTANCE_FROM_CAMERA 1
+#define LS_SORT_KEY_2D_LENGTH 2
+#define LS_SORT_KEY_PROJECTED_X 3
+#define LS_SORT_KEY_PROJECTED_Y 4
/* FreestyleLineStyle::integration_type */
-#define LS_INTEGRATION_MEAN 1
-#define LS_INTEGRATION_MIN 2
-#define LS_INTEGRATION_MAX 3
-#define LS_INTEGRATION_FIRST 4
-#define LS_INTEGRATION_LAST 5
+#define LS_INTEGRATION_MEAN 1
+#define LS_INTEGRATION_MIN 2
+#define LS_INTEGRATION_MAX 3
+#define LS_INTEGRATION_FIRST 4
+#define LS_INTEGRATION_LAST 5
typedef struct FreestyleLineStyle {
- ID id;
- struct AnimData *adt;
-
- float r, g, b, alpha;
- float thickness;
- int thickness_position;
- float thickness_ratio;
- int flag, caps;
- int chaining;
- unsigned int rounds;
- float split_length;
- /** In radians, for splitting. */
- float min_angle, max_angle;
- float min_length, max_length;
- unsigned int chain_count;
- unsigned short split_dash1, split_gap1;
- unsigned short split_dash2, split_gap2;
- unsigned short split_dash3, split_gap3;
- int sort_key, integration_type;
- float texstep;
- short texact, pr_texture;
- short use_nodes;
- char _pad[6];
- unsigned short dash1, gap1, dash2, gap2, dash3, gap3;
- /** For UI. */
- int panel;
- /** MAX_MTEX. */
- struct MTex *mtex[18];
- /* nodes */
- struct bNodeTree *nodetree;
-
- ListBase color_modifiers;
- ListBase alpha_modifiers;
- ListBase thickness_modifiers;
- ListBase geometry_modifiers;
+ ID id;
+ struct AnimData *adt;
+
+ float r, g, b, alpha;
+ float thickness;
+ int thickness_position;
+ float thickness_ratio;
+ int flag, caps;
+ int chaining;
+ unsigned int rounds;
+ float split_length;
+ /** In radians, for splitting. */
+ float min_angle, max_angle;
+ float min_length, max_length;
+ unsigned int chain_count;
+ unsigned short split_dash1, split_gap1;
+ unsigned short split_dash2, split_gap2;
+ unsigned short split_dash3, split_gap3;
+ int sort_key, integration_type;
+ float texstep;
+ short texact, pr_texture;
+ short use_nodes;
+ char _pad[6];
+ unsigned short dash1, gap1, dash2, gap2, dash3, gap3;
+ /** For UI. */
+ int panel;
+ /** MAX_MTEX. */
+ struct MTex *mtex[18];
+ /* nodes */
+ struct bNodeTree *nodetree;
+
+ ListBase color_modifiers;
+ ListBase alpha_modifiers;
+ ListBase thickness_modifiers;
+ ListBase geometry_modifiers;
} FreestyleLineStyle;
#endif
diff --git a/source/blender/makesdna/DNA_listBase.h b/source/blender/makesdna/DNA_listBase.h
index 359aa7a219c..7d247c99387 100644
--- a/source/blender/makesdna/DNA_listBase.h
+++ b/source/blender/makesdna/DNA_listBase.h
@@ -34,19 +34,18 @@ extern "C" {
/** Generic - all structs which are put into linked lists begin with this. */
typedef struct Link {
- struct Link *next, *prev;
+ struct Link *next, *prev;
} Link;
-
/** Simple subclass of Link. Use this when it is not worth defining a custom one. */
typedef struct LinkData {
- struct LinkData *next, *prev;
- void *data;
+ struct LinkData *next, *prev;
+ void *data;
} LinkData;
/** Never change the size of this! dna_genfile.c detects pointer_size with it. */
-typedef struct ListBase {
- void *first, *last;
+typedef struct ListBase {
+ void *first, *last;
} ListBase;
/* 8 byte alignment! */
diff --git a/source/blender/makesdna/DNA_mask_types.h b/source/blender/makesdna/DNA_mask_types.h
index 58418738f3a..bed7f0a150d 100644
--- a/source/blender/makesdna/DNA_mask_types.h
+++ b/source/blender/makesdna/DNA_mask_types.h
@@ -33,108 +33,108 @@
#include "DNA_curve_types.h"
typedef struct Mask {
- ID id;
- struct AnimData *adt;
- /** Mask layers. */
- ListBase masklayers;
- /** Index of active mask layer (-1 == None). */
- int masklay_act;
- /** Total number of mask layers. */
- int masklay_tot;
-
- /** Frames, used by the sequencer. */
- int sfra, efra;
-
- /** For anim info. */
- int flag;
- char _pad[4];
+ ID id;
+ struct AnimData *adt;
+ /** Mask layers. */
+ ListBase masklayers;
+ /** Index of active mask layer (-1 == None). */
+ int masklay_act;
+ /** Total number of mask layers. */
+ int masklay_tot;
+
+ /** Frames, used by the sequencer. */
+ int sfra, efra;
+
+ /** For anim info. */
+ int flag;
+ char _pad[4];
} Mask;
typedef struct MaskParent {
- //* /* Parenting flags */ /* not used. */
- // int flag;
- /** Type of parenting. */
- int id_type;
- /** Type of parenting. */
- int type;
- /**
- * 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;
- /**
- * 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];
+ //* /* Parenting flags */ /* not used. */
+ // int flag;
+ /** Type of parenting. */
+ int id_type;
+ /** Type of parenting. */
+ int type;
+ /**
+ * 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;
+ /**
+ * 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];
} MaskParent;
typedef struct MaskSplinePointUW {
- /** U coordinate along spline segment and weight of this point. */
- float u, w;
- /** Different flags of this point. */
- int flag;
+ /** U coordinate along spline segment and weight of this point. */
+ float u, w;
+ /** Different flags of this point. */
+ int flag;
} MaskSplinePointUW;
typedef struct MaskSplinePoint {
- /** Actual point coordinates and it's handles . */
- BezTriple bezt;
- char _pad[4];
- /** Number of uv feather values. */
- int tot_uw;
- /** Feather UV values. */
- MaskSplinePointUW *uw;
- /** Parenting information of particular spline point. */
- MaskParent parent;
+ /** Actual point coordinates and it's handles . */
+ BezTriple bezt;
+ char _pad[4];
+ /** Number of uv feather values. */
+ int tot_uw;
+ /** Feather UV values. */
+ MaskSplinePointUW *uw;
+ /** Parenting information of particular spline point. */
+ MaskParent parent;
} MaskSplinePoint;
typedef struct MaskSpline {
- struct MaskSpline *next, *prev;
-
- /** Different spline flag (closed, ...). */
- short flag;
- /** Feather offset method. */
- char offset_mode;
- /** Weight interpolation. */
- char weight_interp;
-
- /** Total number of points. */
- int tot_point;
- /** Points which defines spline itself. */
- MaskSplinePoint *points;
- /** Parenting information of the whole spline. */
- MaskParent parent;
-
- /** Deformed copy of 'points' BezTriple data - not saved. */
- MaskSplinePoint *points_deform;
+ struct MaskSpline *next, *prev;
+
+ /** Different spline flag (closed, ...). */
+ short flag;
+ /** Feather offset method. */
+ char offset_mode;
+ /** Weight interpolation. */
+ char weight_interp;
+
+ /** Total number of points. */
+ int tot_point;
+ /** Points which defines spline itself. */
+ MaskSplinePoint *points;
+ /** Parenting information of the whole spline. */
+ MaskParent parent;
+
+ /** Deformed copy of 'points' BezTriple data - not saved. */
+ MaskSplinePoint *points_deform;
} MaskSpline;
/* one per frame */
typedef struct MaskLayerShape {
- struct MaskLayerShape *next, *prev;
-
- /** U coordinate along spline segment and weight of this point. */
- float *data;
- /** To ensure no buffer overruns's: alloc size is (tot_vert * MASK_OBJECT_SHAPE_ELEM_SIZE). */
- int tot_vert;
- /** Different flags of this point. */
- int frame;
- /** Animation flag. */
- char flag;
- char _pad[7];
+ struct MaskLayerShape *next, *prev;
+
+ /** U coordinate along spline segment and weight of this point. */
+ float *data;
+ /** To ensure no buffer overruns's: alloc size is (tot_vert * MASK_OBJECT_SHAPE_ELEM_SIZE). */
+ int tot_vert;
+ /** Different flags of this point. */
+ int frame;
+ /** Animation flag. */
+ char flag;
+ char _pad[7];
} MaskLayerShape;
/* cast to this for convenience, not saved */
@@ -143,35 +143,35 @@ typedef struct MaskLayerShape {
#
#
typedef struct MaskLayerShapeElem {
- float value[MASK_OBJECT_SHAPE_ELEM_SIZE];
+ float value[MASK_OBJECT_SHAPE_ELEM_SIZE];
} MaskLayerShapeElem;
typedef struct MaskLayer {
- struct MaskLayer *next, *prev;
-
- /** Name of the mask layer (64 = MAD_ID_NAME - 2). */
- char name[64];
-
- /** List of splines which defines this mask layer. */
- ListBase splines;
- ListBase splines_shapes;
-
- /** Active spline. */
- struct MaskSpline *act_spline;
- /** Active point. */
- struct MaskSplinePoint *act_point;
-
- /* blending options */
- float alpha;
- char blend;
- char blend_flag;
- char falloff;
- char _pad[7];
-
- /** For animation. */
- char flag;
- /** Matching 'Object' flag of the same name - eventually use in the outliner . */
- char restrictflag;
+ struct MaskLayer *next, *prev;
+
+ /** Name of the mask layer (64 = MAD_ID_NAME - 2). */
+ char name[64];
+
+ /** List of splines which defines this mask layer. */
+ ListBase splines;
+ ListBase splines_shapes;
+
+ /** Active spline. */
+ struct MaskSpline *act_spline;
+ /** Active point. */
+ struct MaskSplinePoint *act_point;
+
+ /* blending options */
+ float alpha;
+ char blend;
+ char blend_flag;
+ char falloff;
+ char _pad[7];
+
+ /** For animation. */
+ char flag;
+ /** Matching 'Object' flag of the same name - eventually use in the outliner . */
+ char restrictflag;
} MaskLayer;
/* MaskParent->flag */
@@ -179,92 +179,90 @@ typedef struct MaskLayer {
/* MaskParent->type */
enum {
- MASK_PARENT_POINT_TRACK = 0, /* parenting happens to point track */
- MASK_PARENT_PLANE_TRACK = 1, /* parenting happens to plane track */
+ MASK_PARENT_POINT_TRACK = 0, /* parenting happens to point track */
+ MASK_PARENT_PLANE_TRACK = 1, /* parenting happens to plane track */
};
/* MaskSpline->flag */
/* reserve (1 << 0) for SELECT */
enum {
- MASK_SPLINE_CYCLIC = (1 << 1),
- MASK_SPLINE_NOFILL = (1 << 2),
- MASK_SPLINE_NOINTERSECT = (1 << 3),
+ MASK_SPLINE_CYCLIC = (1 << 1),
+ MASK_SPLINE_NOFILL = (1 << 2),
+ MASK_SPLINE_NOINTERSECT = (1 << 3),
};
/* MaskSpline->weight_interp */
enum {
- MASK_SPLINE_INTERP_LINEAR = 1,
- MASK_SPLINE_INTERP_EASE = 2,
+ MASK_SPLINE_INTERP_LINEAR = 1,
+ MASK_SPLINE_INTERP_EASE = 2,
};
/* MaskSpline->offset_mode */
enum {
- MASK_SPLINE_OFFSET_EVEN = 0,
- MASK_SPLINE_OFFSET_SMOOTH = 1,
+ MASK_SPLINE_OFFSET_EVEN = 0,
+ MASK_SPLINE_OFFSET_SMOOTH = 1,
};
-
/* ob->restrictflag */
-#define MASK_RESTRICT_VIEW (1 << 0)
-#define MASK_RESTRICT_SELECT (1 << 1)
-#define MASK_RESTRICT_RENDER (1 << 2)
+#define MASK_RESTRICT_VIEW (1 << 0)
+#define MASK_RESTRICT_SELECT (1 << 1)
+#define MASK_RESTRICT_RENDER (1 << 2)
/* SpaceClip->mask_draw_flag */
-#define MASK_DRAWFLAG_SMOOTH (1 << 0)
-#define MASK_DRAWFLAG_OVERLAY (1 << 1)
+#define MASK_DRAWFLAG_SMOOTH (1 << 0)
+#define MASK_DRAWFLAG_OVERLAY (1 << 1)
/* copy of eSpaceImage_UVDT */
/* SpaceClip->mask_draw_type */
enum {
- MASK_DT_OUTLINE = 0,
- MASK_DT_DASH = 1,
- MASK_DT_BLACK = 2,
- MASK_DT_WHITE = 3,
+ MASK_DT_OUTLINE = 0,
+ MASK_DT_DASH = 1,
+ MASK_DT_BLACK = 2,
+ MASK_DT_WHITE = 3,
};
/* MaskSpaceInfo->overlay_mode */
enum {
- MASK_OVERLAY_ALPHACHANNEL = 0,
- MASK_OVERLAY_COMBINED = 1,
+ MASK_OVERLAY_ALPHACHANNEL = 0,
+ MASK_OVERLAY_COMBINED = 1,
};
/* masklay->blend */
enum {
- 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,
+ 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,
};
/* masklay->blend_flag */
enum {
- MASK_BLENDFLAG_INVERT = (1 << 0),
+ MASK_BLENDFLAG_INVERT = (1 << 0),
};
/* masklay->flag */
enum {
- MASK_LAYERFLAG_LOCKED = (1 << 4),
- MASK_LAYERFLAG_SELECT = (1 << 5),
+ MASK_LAYERFLAG_LOCKED = (1 << 4),
+ MASK_LAYERFLAG_SELECT = (1 << 5),
- /* no holes */
- MASK_LAYERFLAG_FILL_DISCRETE = (1 << 6),
- MASK_LAYERFLAG_FILL_OVERLAP = (1 << 7),
+ /* no holes */
+ MASK_LAYERFLAG_FILL_DISCRETE = (1 << 6),
+ MASK_LAYERFLAG_FILL_OVERLAP = (1 << 7),
};
/* masklay_shape->flag */
enum {
- MASK_SHAPE_SELECT = (1 << 0),
+ MASK_SHAPE_SELECT = (1 << 0),
};
-
/* mask->flag */
enum {
- MASK_ANIMF_EXPAND = (1 << 4),
+ MASK_ANIMF_EXPAND = (1 << 4),
};
-#endif /* __DNA_MASK_TYPES_H__ */
+#endif /* __DNA_MASK_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 1f8e7741304..eacb19822f9 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -29,7 +29,7 @@
#include "DNA_listBase.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 18
+# define MAX_MTEX 18
#endif
struct AnimData;
@@ -40,162 +40,162 @@ struct bNodeTree;
/* WATCH IT: change type? also make changes in ipo.h */
typedef struct TexPaintSlot {
- /** Image to be painted on. */
- struct Image *ima;
- /** Customdata index for uv layer, MAX_NAM.E*/
- char *uvname;
- /** Do we have a valid image and UV map. */
- int valid;
- /** Copy of node inteporlation setting. */
- int interp;
+ /** Image to be painted on. */
+ struct Image *ima;
+ /** Customdata index for uv layer, MAX_NAM.E*/
+ char *uvname;
+ /** Do we have a valid image and UV map. */
+ int valid;
+ /** Copy of node inteporlation setting. */
+ int interp;
} TexPaintSlot;
typedef struct MaterialGPencilStyle {
- /** Texture image for strokes. */
- struct Image *sima;
- /** Texture image for filling. */
- struct Image *ima;
- /** 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. */
- short flag;
- /** Custom index for passes. */
- short index;
- /** Style for drawing strokes (used to select shader type). */
- short stroke_style;
- /** Style for filling areas (used to select shader type). */
- short fill_style;
- /** Factor used to define shader behavior (several uses). */
- float mix_factor;
- /** Angle used for gradients orientation. */
- float gradient_angle;
- /** Radius for radial gradients. */
- float gradient_radius;
- /** Cheesboard size. */
- float pattern_gridsize;
- /** Uv coordinates scale. */
- float gradient_scale[2];
- /** Factor to shift filling in 2d space. */
- float gradient_shift[2];
- /** Angle used for texture orientation. */
- float texture_angle;
- /** Texture scale (separated of uv scale). */
- float texture_scale[2];
- /** Factor to shift texture in 2d space. */
- float texture_offset[2];
- /** Texture opacity. */
- float texture_opacity;
- /** Pixel size for uv along the stroke. */
- float texture_pixsize;
- /** Drawing mode (line or dots). */
- int mode;
-
- /** Type of gradient. */
- int gradient_type;
- char _pad[4];
+ /** Texture image for strokes. */
+ struct Image *sima;
+ /** Texture image for filling. */
+ struct Image *ima;
+ /** 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. */
+ short flag;
+ /** Custom index for passes. */
+ short index;
+ /** Style for drawing strokes (used to select shader type). */
+ short stroke_style;
+ /** Style for filling areas (used to select shader type). */
+ short fill_style;
+ /** Factor used to define shader behavior (several uses). */
+ float mix_factor;
+ /** Angle used for gradients orientation. */
+ float gradient_angle;
+ /** Radius for radial gradients. */
+ float gradient_radius;
+ /** Cheesboard size. */
+ float pattern_gridsize;
+ /** Uv coordinates scale. */
+ float gradient_scale[2];
+ /** Factor to shift filling in 2d space. */
+ float gradient_shift[2];
+ /** Angle used for texture orientation. */
+ float texture_angle;
+ /** Texture scale (separated of uv scale). */
+ float texture_scale[2];
+ /** Factor to shift texture in 2d space. */
+ float texture_offset[2];
+ /** Texture opacity. */
+ float texture_opacity;
+ /** Pixel size for uv along the stroke. */
+ float texture_pixsize;
+ /** Drawing mode (line or dots). */
+ int mode;
+
+ /** Type of gradient. */
+ int gradient_type;
+ char _pad[4];
} MaterialGPencilStyle;
/* MaterialGPencilStyle->flag */
typedef enum eMaterialGPencilStyle_Flag {
- /* Fill Texture is a pattern */
- GP_STYLE_FILL_PATTERN = (1 << 0),
- /* don't display color */
- GP_STYLE_COLOR_HIDE = (1 << 1),
- /* protected from further editing */
- GP_STYLE_COLOR_LOCKED = (1 << 2),
- /* do onion skinning */
- GP_STYLE_COLOR_ONIONSKIN = (1 << 3),
- /* clamp texture */
- GP_STYLE_COLOR_TEX_CLAMP = (1 << 4),
- /* mix texture */
- GP_STYLE_COLOR_TEX_MIX = (1 << 5),
- /* Flip fill colors */
- GP_STYLE_COLOR_FLIP_FILL = (1 << 6),
- /* Stroke Texture is a pattern */
- GP_STYLE_STROKE_PATTERN = (1 << 7),
- /* Stroke show main switch */
- GP_STYLE_STROKE_SHOW = (1 << 8),
- /* Fill show main switch */
- GP_STYLE_FILL_SHOW = (1 << 9),
- /* Don't rotate dots/boxes */
- GP_STYLE_COLOR_LOCK_DOTS = (1 << 10),
+ /* Fill Texture is a pattern */
+ GP_STYLE_FILL_PATTERN = (1 << 0),
+ /* don't display color */
+ GP_STYLE_COLOR_HIDE = (1 << 1),
+ /* protected from further editing */
+ GP_STYLE_COLOR_LOCKED = (1 << 2),
+ /* do onion skinning */
+ GP_STYLE_COLOR_ONIONSKIN = (1 << 3),
+ /* clamp texture */
+ GP_STYLE_COLOR_TEX_CLAMP = (1 << 4),
+ /* mix texture */
+ GP_STYLE_COLOR_TEX_MIX = (1 << 5),
+ /* Flip fill colors */
+ GP_STYLE_COLOR_FLIP_FILL = (1 << 6),
+ /* Stroke Texture is a pattern */
+ GP_STYLE_STROKE_PATTERN = (1 << 7),
+ /* Stroke show main switch */
+ GP_STYLE_STROKE_SHOW = (1 << 8),
+ /* Fill show main switch */
+ GP_STYLE_FILL_SHOW = (1 << 9),
+ /* Don't rotate dots/boxes */
+ GP_STYLE_COLOR_LOCK_DOTS = (1 << 10),
} eMaterialGPencilStyle_Flag;
typedef enum eMaterialGPencilStyle_Mode {
- GP_STYLE_MODE_LINE = 0, /* line */
- GP_STYLE_MODE_DOTS = 1, /* dots */
- GP_STYLE_MODE_BOX = 2, /* rectangles */
+ GP_STYLE_MODE_LINE = 0, /* line */
+ GP_STYLE_MODE_DOTS = 1, /* dots */
+ GP_STYLE_MODE_BOX = 2, /* rectangles */
} eMaterialGPencilStyle_Mode;
typedef struct Material {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- short flag;
- char _pad1[2];
-
- /* Colors from Blender Internal that we are still using. */
- float r, g, b, a;
- float specr, specg, specb;
- float alpha DNA_DEPRECATED;
- float ray_mirror DNA_DEPRECATED;
- float spec;
- /** Renamed and inversed to roughness. */
- float gloss_mir DNA_DEPRECATED;
- float roughness;
- float metallic;
-
- /** Nodes */
- char use_nodes;
-
- /** Preview render. */
- char pr_type;
- short pr_texture;
- short pr_flag;
-
- /** Index for render passes. */
- short index;
-
- struct bNodeTree *nodetree;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- struct PreviewImage *preview;
-
- /* Freestyle line settings. */
- float line_col[4];
- short line_priority;
- short vcol_alpha;
-
- /* Texture painting slots. */
- short paint_active_slot;
- short paint_clone_slot;
- short tot_slots;
- char _pad2[2];
-
- /* Transparency. */
- float alpha_threshold;
- float refract_depth;
- char blend_method;
- char blend_shadow;
- char blend_flag;
- char _pad3[1];
-
- /**
- * Cached slots for texture painting, must be refreshed in
- * refresh_texpaint_image_cache before using.
- */
- struct TexPaintSlot *texpaintslot;
-
- /** Runtime cache for GLSL materials. */
- ListBase gpumaterial;
-
- /** Grease pencil color. */
- struct MaterialGPencilStyle *gp_style;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ short flag;
+ char _pad1[2];
+
+ /* Colors from Blender Internal that we are still using. */
+ float r, g, b, a;
+ float specr, specg, specb;
+ float alpha DNA_DEPRECATED;
+ float ray_mirror DNA_DEPRECATED;
+ float spec;
+ /** Renamed and inversed to roughness. */
+ float gloss_mir DNA_DEPRECATED;
+ float roughness;
+ float metallic;
+
+ /** Nodes */
+ char use_nodes;
+
+ /** Preview render. */
+ char pr_type;
+ short pr_texture;
+ short pr_flag;
+
+ /** Index for render passes. */
+ short index;
+
+ struct bNodeTree *nodetree;
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ struct PreviewImage *preview;
+
+ /* Freestyle line settings. */
+ float line_col[4];
+ short line_priority;
+ short vcol_alpha;
+
+ /* Texture painting slots. */
+ short paint_active_slot;
+ short paint_clone_slot;
+ short tot_slots;
+ char _pad2[2];
+
+ /* Transparency. */
+ float alpha_threshold;
+ float refract_depth;
+ char blend_method;
+ char blend_shadow;
+ char blend_flag;
+ char _pad3[1];
+
+ /**
+ * Cached slots for texture painting, must be refreshed in
+ * refresh_texpaint_image_cache before using.
+ */
+ struct TexPaintSlot *texpaintslot;
+
+ /** Runtime cache for GLSL materials. */
+ ListBase gpumaterial;
+
+ /** Grease pencil color. */
+ struct MaterialGPencilStyle *gp_style;
} Material;
/* **************** MATERIAL ********************* */
@@ -204,143 +204,143 @@ typedef struct Material {
* (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)
+#define MAXMAT (32767 - 1)
/* flag */
- /* for render */
+/* for render */
/* #define MA_IS_USED (1 << 0) */ /* UNUSED */
- /* for dopesheet */
-#define MA_DS_EXPAND (1 << 1)
- /* for dopesheet (texture stack expander)
- * NOTE: this must have the same value as other texture stacks,
- * otherwise anim-editors will not read correctly
- */
+ /* for dopesheet */
+#define MA_DS_EXPAND (1 << 1)
+/* for dopesheet (texture stack expander)
+ * NOTE: this must have the same value as other texture stacks,
+ * otherwise anim-editors will not read correctly
+ */
#define MA_DS_SHOW_TEXS (1 << 2)
/* ramps */
-#define MA_RAMP_BLEND 0
-#define MA_RAMP_ADD 1
-#define MA_RAMP_MULT 2
-#define MA_RAMP_SUB 3
-#define MA_RAMP_SCREEN 4
-#define MA_RAMP_DIV 5
-#define MA_RAMP_DIFF 6
-#define MA_RAMP_DARK 7
-#define MA_RAMP_LIGHT 8
-#define MA_RAMP_OVERLAY 9
-#define MA_RAMP_DODGE 10
-#define MA_RAMP_BURN 11
-#define MA_RAMP_HUE 12
-#define MA_RAMP_SAT 13
-#define MA_RAMP_VAL 14
-#define MA_RAMP_COLOR 15
-#define MA_RAMP_SOFT 16
-#define MA_RAMP_LINEAR 17
+#define MA_RAMP_BLEND 0
+#define MA_RAMP_ADD 1
+#define MA_RAMP_MULT 2
+#define MA_RAMP_SUB 3
+#define MA_RAMP_SCREEN 4
+#define MA_RAMP_DIV 5
+#define MA_RAMP_DIFF 6
+#define MA_RAMP_DARK 7
+#define MA_RAMP_LIGHT 8
+#define MA_RAMP_OVERLAY 9
+#define MA_RAMP_DODGE 10
+#define MA_RAMP_BURN 11
+#define MA_RAMP_HUE 12
+#define MA_RAMP_SAT 13
+#define MA_RAMP_VAL 14
+#define MA_RAMP_COLOR 15
+#define MA_RAMP_SOFT 16
+#define MA_RAMP_LINEAR 17
/* texco */
-#define TEXCO_ORCO (1 << 0)
+#define TEXCO_ORCO (1 << 0)
/* #define TEXCO_REFL (1 << 1) */ /* deprecated */
/* #define TEXCO_NORM (1 << 2) */ /* deprecated */
-#define TEXCO_GLOB (1 << 3)
-#define TEXCO_UV (1 << 4)
-#define TEXCO_OBJECT (1 << 5)
+#define TEXCO_GLOB (1 << 3)
+#define TEXCO_UV (1 << 4)
+#define TEXCO_OBJECT (1 << 5)
/* #define TEXCO_LAVECTOR (1 << 6) */ /* deprecated */
/* #define TEXCO_VIEW (1 << 7) */ /* deprecated */
-/* #define TEXCO_STICKY (1 << 8) */ /* deprecated */
+/* #define TEXCO_STICKY (1 << 8) */ /* deprecated */
/* #define TEXCO_OSA (1 << 9) */ /* deprecated */
-#define TEXCO_WINDOW (1 << 10)
+#define TEXCO_WINDOW (1 << 10)
/* #define NEED_UV (1 << 11) */ /* deprecated */
/* #define TEXCO_TANGENT (1 << 12) */ /* deprecated */
- /* still stored in vertex->accum, 1 D */
-#define TEXCO_STRAND (1 << 13)
+/* still stored in vertex->accum, 1 D */
+#define TEXCO_STRAND (1 << 13)
/** strand is used for normal materials, particle for halo materials */
-#define TEXCO_PARTICLE (1 << 13)
+#define TEXCO_PARTICLE (1 << 13)
/* #define TEXCO_STRESS (1 << 14) */ /* deprecated */
/* #define TEXCO_SPEED (1 << 15) */ /* deprecated */
/* mapto */
-#define MAP_COL (1 << 0)
-#define MAP_ALPHA (1 << 7)
+#define MAP_COL (1 << 0)
+#define MAP_ALPHA (1 << 7)
/* pmapto */
/* init */
-#define MAP_PA_INIT ((1 << 5) - 1)
-#define MAP_PA_TIME (1 << 0)
-#define MAP_PA_LIFE (1 << 1)
-#define MAP_PA_DENS (1 << 2)
-#define MAP_PA_SIZE (1 << 3)
-#define MAP_PA_LENGTH (1 << 4)
+#define MAP_PA_INIT ((1 << 5) - 1)
+#define MAP_PA_TIME (1 << 0)
+#define MAP_PA_LIFE (1 << 1)
+#define MAP_PA_DENS (1 << 2)
+#define MAP_PA_SIZE (1 << 3)
+#define MAP_PA_LENGTH (1 << 4)
/* reset */
-#define MAP_PA_IVEL (1 << 5)
+#define MAP_PA_IVEL (1 << 5)
/* physics */
-#define MAP_PA_PVEL (1 << 6)
+#define MAP_PA_PVEL (1 << 6)
/* path cache */
-#define MAP_PA_CLUMP (1 << 7)
-#define MAP_PA_KINK (1 << 8)
-#define MAP_PA_ROUGH (1 << 9)
-#define MAP_PA_FREQ (1 << 10)
+#define MAP_PA_CLUMP (1 << 7)
+#define MAP_PA_KINK (1 << 8)
+#define MAP_PA_ROUGH (1 << 9)
+#define MAP_PA_FREQ (1 << 10)
/* pr_type */
-#define MA_FLAT 0
-#define MA_SPHERE 1
-#define MA_CUBE 2
-#define MA_SHADERBALL 3
-#define MA_SPHERE_A 4 /* Used for icon renders only. */
-#define MA_TEXTURE 5
-#define MA_LAMP 6
-#define MA_SKY 7
-#define MA_HAIR 10
-#define MA_ATMOS 11
-#define MA_CLOTH 12
-#define MA_FLUID 13
+#define MA_FLAT 0
+#define MA_SPHERE 1
+#define MA_CUBE 2
+#define MA_SHADERBALL 3
+#define MA_SPHERE_A 4 /* Used for icon renders only. */
+#define MA_TEXTURE 5
+#define MA_LAMP 6
+#define MA_SKY 7
+#define MA_HAIR 10
+#define MA_ATMOS 11
+#define MA_CLOTH 12
+#define MA_FLUID 13
/* pr_flag */
#define MA_PREVIEW_WORLD (1 << 0)
/* blend_method */
enum {
- MA_BM_SOLID,
- MA_BM_ADD,
- MA_BM_MULTIPLY,
- MA_BM_CLIP,
- MA_BM_HASHED,
- MA_BM_BLEND,
+ MA_BM_SOLID,
+ MA_BM_ADD,
+ MA_BM_MULTIPLY,
+ MA_BM_CLIP,
+ MA_BM_HASHED,
+ MA_BM_BLEND,
};
/* blend_flag */
enum {
- MA_BL_HIDE_BACKFACE = (1 << 0),
- MA_BL_SS_REFRACTION = (1 << 1),
- MA_BL_FLAG_UNUSED_2 = (1 << 2), /* cleared */
- MA_BL_TRANSLUCENCY = (1 << 3),
+ MA_BL_HIDE_BACKFACE = (1 << 0),
+ MA_BL_SS_REFRACTION = (1 << 1),
+ MA_BL_FLAG_UNUSED_2 = (1 << 2), /* cleared */
+ MA_BL_TRANSLUCENCY = (1 << 3),
};
/* blend_shadow */
enum {
- MA_BS_NONE = 0,
- MA_BS_SOLID,
- MA_BS_CLIP,
- MA_BS_HASHED,
+ MA_BS_NONE = 0,
+ MA_BS_SOLID,
+ MA_BS_CLIP,
+ MA_BS_HASHED,
};
/* Grease Pencil Stroke styles */
enum {
- GP_STYLE_STROKE_STYLE_SOLID = 0,
- GP_STYLE_STROKE_STYLE_TEXTURE,
+ GP_STYLE_STROKE_STYLE_SOLID = 0,
+ GP_STYLE_STROKE_STYLE_TEXTURE,
};
/* Grease Pencil Fill styles */
enum {
- GP_STYLE_FILL_STYLE_SOLID = 0,
- GP_STYLE_FILL_STYLE_GRADIENT,
- GP_STYLE_FILL_STYLE_CHESSBOARD,
- GP_STYLE_FILL_STYLE_TEXTURE,
+ GP_STYLE_FILL_STYLE_SOLID = 0,
+ GP_STYLE_FILL_STYLE_GRADIENT,
+ GP_STYLE_FILL_STYLE_CHESSBOARD,
+ GP_STYLE_FILL_STYLE_TEXTURE,
};
/* Grease Pencil Gradient Types */
enum {
- GP_STYLE_GRADIENT_LINEAR = 0,
- GP_STYLE_GRADIENT_RADIAL,
+ GP_STYLE_GRADIENT_LINEAR = 0,
+ GP_STYLE_GRADIENT_RADIAL,
};
#endif
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 0d43b14e252..a7b061e6d48 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -50,159 +50,158 @@ struct SubdivCCG;
#
#
typedef struct EditMeshData {
- /** when set, \a vertexNos, polyNos are lazy initialized */
- const float (*vertexCos)[3];
-
- /** lazy initialize (when \a vertexCos is set) */
- float const (*vertexNos)[3];
- float const (*polyNos)[3];
- /** also lazy init but dont depend on \a vertexCos */
- const float (*polyCos)[3];
+ /** when set, \a vertexNos, polyNos are lazy initialized */
+ const float (*vertexCos)[3];
+
+ /** lazy initialize (when \a vertexCos is set) */
+ float const (*vertexNos)[3];
+ float const (*polyNos)[3];
+ /** also lazy init but dont depend on \a vertexCos */
+ const float (*polyCos)[3];
} EditMeshData;
-
/**
* \warning Typical access is done via #BKE_mesh_runtime_looptri_ensure, #BKE_mesh_runtime_looptri_len.
*/
struct MLoopTri_Store {
- /* WARNING! swapping between array (ready-to-be-used data) and array_wip
- * (where data is actually computed)
- * shall always be protected by same lock as one used for looptris computing. */
- struct MLoopTri *array, *array_wip;
- int len;
- int len_alloc;
+ /* WARNING! swapping between array (ready-to-be-used data) and array_wip
+ * (where data is actually computed)
+ * shall always be protected by same lock as one used for looptris computing. */
+ struct MLoopTri *array, *array_wip;
+ int len;
+ int len_alloc;
};
/* not saved in file! */
typedef struct Mesh_Runtime {
- struct EditMeshData *edit_data;
- void *batch_cache;
-
- struct SubdivCCG *subdiv_ccg;
- void *_pad1;
- int subdiv_ccg_tot_level;
- char _pad2[4];
-
- int64_t cd_dirty_vert;
- int64_t cd_dirty_edge;
- int64_t cd_dirty_loop;
- int64_t cd_dirty_poly;
-
- struct MLoopTri_Store looptris;
-
- /** 'BVHCache', for 'BKE_bvhutil.c' */
- struct LinkNode *bvh_cache;
-
- /** Non-manifold boundary data for Shrinkwrap Target Project. */
- struct ShrinkwrapBoundaryData *shrinkwrap_data;
-
- /** Set by modifier stack if only deformed from original. */
- char deformed_only;
- /**
- * Copied from edit-mesh (hint, draw with editmesh data).
- * In the future we may leave the mesh-data empty
- * since its not needed if we can use edit-mesh data. */
- char is_original;
- char _pad[6];
+ struct EditMeshData *edit_data;
+ void *batch_cache;
+
+ struct SubdivCCG *subdiv_ccg;
+ void *_pad1;
+ int subdiv_ccg_tot_level;
+ char _pad2[4];
+
+ int64_t cd_dirty_vert;
+ int64_t cd_dirty_edge;
+ int64_t cd_dirty_loop;
+ int64_t cd_dirty_poly;
+
+ struct MLoopTri_Store looptris;
+
+ /** 'BVHCache', for 'BKE_bvhutil.c' */
+ struct LinkNode *bvh_cache;
+
+ /** Non-manifold boundary data for Shrinkwrap Target Project. */
+ struct ShrinkwrapBoundaryData *shrinkwrap_data;
+
+ /** Set by modifier stack if only deformed from original. */
+ char deformed_only;
+ /**
+ * Copied from edit-mesh (hint, draw with editmesh data).
+ * In the future we may leave the mesh-data empty
+ * since its not needed if we can use edit-mesh data. */
+ char is_original;
+ char _pad[6];
} Mesh_Runtime;
typedef struct Mesh {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- struct BoundBox *bb;
-
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- struct Key *key;
- struct Material **mat;
- struct MSelect *mselect;
-
-/* BMESH ONLY */
- /*new face structures*/
- struct MPoly *mpoly;
- struct MLoop *mloop;
- struct MLoopUV *mloopuv;
- struct MLoopCol *mloopcol;
-/* END BMESH ONLY */
-
- /* mface stores the tessellation (triangulation) of the mesh,
- * real faces are now stored in nface.*/
- /** Array of mesh object mode faces for tessellation. */
- struct MFace *mface;
- /** Store tessellation face UV's and texture here. */
- struct MTFace *mtface;
- /** Deprecated, use mtface. */
- struct TFace *tface DNA_DEPRECATED;
- /** Array of verts. */
- struct MVert *mvert;
- /** Array of edges. */
- struct MEdge *medge;
- /** Deformgroup vertices. */
- struct MDeformVert *dvert;
-
- /* array of colors for the tessellated faces, must be number of tessellated
- * faces * 4 in length */
- struct MCol *mcol;
- struct Mesh *texcomesh;
-
- /* When the object is available, the preferred access method is: BKE_editmesh_from_object(ob) */
- /** Not saved in file!. */
- struct BMEditMesh *edit_mesh;
-
- struct CustomData vdata, edata, fdata;
-
-/* BMESH ONLY */
- struct CustomData pdata, ldata;
-/* END BMESH ONLY */
-
- int totvert, totedge, totface, totselect;
-
-/* BMESH ONLY */
- int totpoly, totloop;
-/* END BMESH ONLY */
-
- /* the last selected vertex/edge/face are used for the active face however
- * this means the active face must always be selected, this is to keep track
- * of the last selected face and is similar to the old active face flag where
- * the face does not need to be selected, -1 is inactive */
- int act_face;
-
- /* texture space, copied as one block in editobject.c */
- float loc[3];
- float size[3];
- float rot[3];
-
- short texflag, flag;
- float smoothresh;
-
- /* customdata flag, for bevel-weight and crease, which are now optional */
- char cd_flag, _pad;
-
- char subdiv DNA_DEPRECATED, subdivr DNA_DEPRECATED;
- /** Only kept for backwards compat, not used anymore. */
- char subsurftype DNA_DEPRECATED;
- char editflag;
-
- short totcol;
-
- /** Deprecated multiresolution modeling data, only keep for loading old files. */
- struct Multires *mr DNA_DEPRECATED;
- void *_pad1;
-
- Mesh_Runtime runtime;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ struct BoundBox *bb;
+
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ struct Key *key;
+ struct Material **mat;
+ struct MSelect *mselect;
+
+ /* BMESH ONLY */
+ /*new face structures*/
+ struct MPoly *mpoly;
+ struct MLoop *mloop;
+ struct MLoopUV *mloopuv;
+ struct MLoopCol *mloopcol;
+ /* END BMESH ONLY */
+
+ /* mface stores the tessellation (triangulation) of the mesh,
+ * real faces are now stored in nface.*/
+ /** Array of mesh object mode faces for tessellation. */
+ struct MFace *mface;
+ /** Store tessellation face UV's and texture here. */
+ struct MTFace *mtface;
+ /** Deprecated, use mtface. */
+ struct TFace *tface DNA_DEPRECATED;
+ /** Array of verts. */
+ struct MVert *mvert;
+ /** Array of edges. */
+ struct MEdge *medge;
+ /** Deformgroup vertices. */
+ struct MDeformVert *dvert;
+
+ /* array of colors for the tessellated faces, must be number of tessellated
+ * faces * 4 in length */
+ struct MCol *mcol;
+ struct Mesh *texcomesh;
+
+ /* When the object is available, the preferred access method is: BKE_editmesh_from_object(ob) */
+ /** Not saved in file!. */
+ struct BMEditMesh *edit_mesh;
+
+ struct CustomData vdata, edata, fdata;
+
+ /* BMESH ONLY */
+ struct CustomData pdata, ldata;
+ /* END BMESH ONLY */
+
+ int totvert, totedge, totface, totselect;
+
+ /* BMESH ONLY */
+ int totpoly, totloop;
+ /* END BMESH ONLY */
+
+ /* the last selected vertex/edge/face are used for the active face however
+ * this means the active face must always be selected, this is to keep track
+ * of the last selected face and is similar to the old active face flag where
+ * the face does not need to be selected, -1 is inactive */
+ int act_face;
+
+ /* texture space, copied as one block in editobject.c */
+ float loc[3];
+ float size[3];
+ float rot[3];
+
+ short texflag, flag;
+ float smoothresh;
+
+ /* customdata flag, for bevel-weight and crease, which are now optional */
+ char cd_flag, _pad;
+
+ char subdiv DNA_DEPRECATED, subdivr DNA_DEPRECATED;
+ /** Only kept for backwards compat, not used anymore. */
+ char subsurftype DNA_DEPRECATED;
+ char editflag;
+
+ short totcol;
+
+ /** Deprecated multiresolution modeling data, only keep for loading old files. */
+ struct Multires *mr DNA_DEPRECATED;
+ void *_pad1;
+
+ Mesh_Runtime runtime;
} Mesh;
/* deprecated by MTFace, only here for file reading */
#ifdef DNA_DEPRECATED
typedef struct TFace {
- /** The faces image for the active UVLayer. */
- void *tpage;
- float uv[4][2];
- unsigned int col[4];
- char flag, transp;
- short mode, tile, unwrap;
+ /** The faces image for the active UVLayer. */
+ void *tpage;
+ float uv[4][2];
+ unsigned int col[4];
+ char flag, transp;
+ short mode, tile, unwrap;
} TFace;
#endif
@@ -210,54 +209,53 @@ typedef struct TFace {
/* texflag */
enum {
- ME_AUTOSPACE = 1,
+ ME_AUTOSPACE = 1,
};
/* me->editflag */
enum {
- ME_EDIT_MIRROR_X = 1 << 0,
- ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */
- ME_EDIT_MIRROR_Z = 1 << 2, /* unused so far */
+ ME_EDIT_MIRROR_X = 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,
+ ME_EDIT_PAINT_FACE_SEL = 1 << 3,
+ ME_EDIT_MIRROR_TOPO = 1 << 4,
+ ME_EDIT_PAINT_VERT_SEL = 1 << 5,
};
/* we cant 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 \
- )
+#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)
/* me->flag */
enum {
- ME_FLAG_UNUSED_0 = 1 << 0, /* cleared */
- ME_FLAG_UNUSED_1 = 1 << 1, /* cleared */
- ME_TWOSIDED = 1 << 2,
- ME_FLAG_UNUSED_3 = 1 << 3, /* cleared */
- ME_FLAG_UNUSED_4 = 1 << 4, /* cleared */
- ME_AUTOSMOOTH = 1 << 5,
- ME_FLAG_UNUSED_6 = 1 << 6, /* cleared */
- ME_FLAG_UNUSED_7 = 1 << 7, /* cleared */
- ME_FLAG_UNUSED_8 = 1 << 8, /* cleared */
- ME_DS_EXPAND = 1 << 9,
- ME_SCULPT_DYNAMIC_TOPOLOGY = 1 << 10,
+ ME_FLAG_UNUSED_0 = 1 << 0, /* cleared */
+ ME_FLAG_UNUSED_1 = 1 << 1, /* cleared */
+ ME_TWOSIDED = 1 << 2,
+ ME_FLAG_UNUSED_3 = 1 << 3, /* cleared */
+ ME_FLAG_UNUSED_4 = 1 << 4, /* cleared */
+ ME_AUTOSMOOTH = 1 << 5,
+ ME_FLAG_UNUSED_6 = 1 << 6, /* cleared */
+ ME_FLAG_UNUSED_7 = 1 << 7, /* cleared */
+ ME_FLAG_UNUSED_8 = 1 << 8, /* cleared */
+ ME_DS_EXPAND = 1 << 9,
+ ME_SCULPT_DYNAMIC_TOPOLOGY = 1 << 10,
};
/* me->cd_flag */
enum {
- ME_CDFLAG_VERT_BWEIGHT = 1 << 0,
- ME_CDFLAG_EDGE_BWEIGHT = 1 << 1,
- ME_CDFLAG_EDGE_CREASE = 1 << 2,
+ ME_CDFLAG_VERT_BWEIGHT = 1 << 0,
+ ME_CDFLAG_EDGE_BWEIGHT = 1 << 1,
+ ME_CDFLAG_EDGE_CREASE = 1 << 2,
};
/* Subsurf Type */
enum {
- ME_CC_SUBSURF = 0,
- ME_SIMPLE_SUBSURF = 1,
+ ME_CC_SUBSURF = 0,
+ ME_SIMPLE_SUBSURF = 1,
};
#define MESH_MAX_VERTS 2000000000L
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 5f86ee562f9..ee12f47051c 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -31,59 +31,59 @@ struct Image;
/*tessellation face, see MLoop/MPoly for the real face data*/
typedef struct MFace {
- unsigned int v1, v2, v3, v4;
- short mat_nr;
- /** We keep edcode, for conversion to edges draw flags in old files. */
- char edcode, flag;
+ unsigned int v1, v2, v3, v4;
+ short mat_nr;
+ /** We keep edcode, for conversion to edges draw flags in old files. */
+ char edcode, flag;
} MFace;
typedef struct MEdge {
- unsigned int v1, v2;
- char crease, bweight;
- short flag;
+ unsigned int v1, v2;
+ char crease, bweight;
+ short flag;
} MEdge;
typedef struct MDeformWeight {
- int def_nr;
- float weight;
+ int def_nr;
+ float weight;
} MDeformWeight;
typedef struct MDeformVert {
- struct MDeformWeight *dw;
- int totweight;
- /** Flag only in use for weightpaint now. */
- int flag;
+ struct MDeformWeight *dw;
+ int totweight;
+ /** Flag only in use for weightpaint now. */
+ int flag;
} MDeformVert;
typedef struct MVert {
- float co[3];
- short no[3];
- char flag, bweight;
+ float co[3];
+ short no[3];
+ char flag, bweight;
} MVert;
/* tessellation vertex color data.
* at the moment alpha is abused for vertex painting and not used for transparency, note that red and blue are swapped
*/
typedef struct MCol {
- unsigned char a, r, g, b;
+ unsigned char a, r, g, b;
} MCol;
/* new face structure, replaces MFace, which is now only used for storing tessellations.*/
typedef 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;
- short mat_nr;
- char flag, _pad;
+ /* 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;
+ short mat_nr;
+ char flag, _pad;
} MPoly;
/* the e here is because we want to move away from relying on edge hashes.*/
typedef struct MLoop {
- /** Vertex index. */
- unsigned int v;
- /** Edge index. */
- unsigned int e;
+ /** Vertex index. */
+ unsigned int v;
+ /** Edge index. */
+ unsigned int e;
} MLoop;
/**
@@ -174,29 +174,29 @@ typedef struct MLoop {
* \note A #MLoopTri may be in the middle of an ngon and not reference **any** edges.
*/
typedef struct MLoopTri {
- unsigned int tri[3];
- unsigned int poly;
+ unsigned int tri[3];
+ unsigned int poly;
} MLoopTri;
#
#
typedef struct MVertTri {
- unsigned int tri[3];
+ unsigned int tri[3];
} MVertTri;
//typedef struct MTexPoly {
-// void *_pad;
+// void *_pad;
//} MTexPoly;
typedef struct MLoopUV {
- float uv[2];
- int flag;
+ float uv[2];
+ int flag;
} MLoopUV;
/*mloopuv->flag*/
enum {
- MLOOPUV_EDGESEL = (1 << 0),
- MLOOPUV_VERTSEL = (1 << 1),
- MLOOPUV_PINNED = (1 << 2),
+ MLOOPUV_EDGESEL = (1 << 0),
+ MLOOPUV_VERTSEL = (1 << 1),
+ MLOOPUV_PINNED = (1 << 2),
};
/**
@@ -208,227 +208,229 @@ enum {
* \note red and blue are _not_ swapped, as they are with #MCol
*/
typedef struct MLoopCol {
- unsigned char r, g, b, a;
+ unsigned char r, g, b, a;
} MLoopCol;
#define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \
-{ \
- MLoopCol *mloopcol__tmp = _mloopcol; \
- const MCol *mcol__tmp = _mcol; \
- mloopcol__tmp->r = mcol__tmp->b; \
- mloopcol__tmp->g = mcol__tmp->g; \
- mloopcol__tmp->b = mcol__tmp->r; \
- mloopcol__tmp->a = mcol__tmp->a; \
-} (void)0
-
+ { \
+ MLoopCol *mloopcol__tmp = _mloopcol; \
+ const MCol *mcol__tmp = _mcol; \
+ mloopcol__tmp->r = mcol__tmp->b; \
+ mloopcol__tmp->g = mcol__tmp->g; \
+ mloopcol__tmp->b = mcol__tmp->r; \
+ mloopcol__tmp->a = mcol__tmp->a; \
+ } \
+ (void)0
#define MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) \
-{ \
- const MLoopCol *mloopcol__tmp = _mloopcol; \
- MCol *mcol__tmp = _mcol; \
- mcol__tmp->b = mloopcol__tmp->r; \
- mcol__tmp->g = mloopcol__tmp->g; \
- mcol__tmp->r = mloopcol__tmp->b; \
- mcol__tmp->a = mloopcol__tmp->a; \
-} (void)0
+ { \
+ const MLoopCol *mloopcol__tmp = _mloopcol; \
+ MCol *mcol__tmp = _mcol; \
+ mcol__tmp->b = mloopcol__tmp->r; \
+ mcol__tmp->g = mloopcol__tmp->g; \
+ mcol__tmp->r = mloopcol__tmp->b; \
+ mcol__tmp->a = mloopcol__tmp->a; \
+ } \
+ (void)0
typedef struct MSelect {
- int index;
- /** ME_VSEL/ME_ESEL/ME_FSEL. */
- int type;
+ int index;
+ /** ME_VSEL/ME_ESEL/ME_FSEL. */
+ int type;
} MSelect;
/*tessellation uv face data*/
typedef struct MTFace {
- float uv[4][2];
+ float uv[4][2];
} MTFace;
/*Custom Data Properties*/
typedef struct MFloatProperty {
- float f;
+ float f;
} MFloatProperty;
typedef struct MIntProperty {
- int i;
+ int i;
} MIntProperty;
typedef struct MStringProperty {
- char s[255], s_len;
+ char s[255], s_len;
} MStringProperty;
typedef struct OrigSpaceFace {
- float uv[4][2];
+ float uv[4][2];
} OrigSpaceFace;
typedef struct OrigSpaceLoop {
- float uv[2];
+ float uv[2];
} OrigSpaceLoop;
typedef 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 MVert.flag's ME_HIDE bit.
- *
- * \note This is a bitmap, keep in sync with type used in BLI_bitmap.h
- */
- unsigned int *hidden;
+ /* 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 MVert.flag's ME_HIDE bit.
+ *
+ * \note This is a bitmap, keep in sync with type used in BLI_bitmap.h
+ */
+ unsigned int *hidden;
} MDisps;
/** Multires structs kept for compatibility with old files. */
typedef struct MultiresCol {
- float a, r, g, b;
+ float a, r, g, b;
} MultiresCol;
typedef struct MultiresColFace {
- /* vertex colors */
- MultiresCol col[4];
+ /* vertex colors */
+ MultiresCol col[4];
} MultiresColFace;
typedef struct MultiresFace {
- unsigned int v[4];
- unsigned int mid;
- char flag, mat_nr, _pad[2];
+ unsigned int v[4];
+ unsigned int mid;
+ char flag, mat_nr, _pad[2];
} MultiresFace;
typedef struct MultiresEdge {
- unsigned int v[2];
- unsigned int mid;
+ unsigned int v[2];
+ unsigned int mid;
} MultiresEdge;
typedef struct MultiresLevel {
- struct MultiresLevel *next, *prev;
+ struct MultiresLevel *next, *prev;
- MultiresFace *faces;
- MultiresColFace *colfaces;
- MultiresEdge *edges;
+ MultiresFace *faces;
+ MultiresColFace *colfaces;
+ MultiresEdge *edges;
- unsigned int totvert, totface, totedge;
- char _pad[4];
+ unsigned int totvert, totface, totedge;
+ char _pad[4];
- /* Kept for compatibility with even older files */
- MVert *verts;
+ /* Kept for compatibility with even older files */
+ MVert *verts;
} MultiresLevel;
typedef struct Multires {
- ListBase levels;
- MVert *verts;
+ ListBase levels;
+ MVert *verts;
- unsigned char level_count, current, newlvl, edgelvl, pinlvl, renderlvl;
- unsigned char use_col, flag;
+ unsigned char level_count, current, newlvl, edgelvl, pinlvl, renderlvl;
+ unsigned char use_col, flag;
- /* Special level 1 data that cannot be modified from other levels */
- CustomData vdata;
- CustomData fdata;
- short *edge_flags;
- char *edge_creases;
+ /* Special level 1 data that cannot be modified from other levels */
+ CustomData vdata;
+ CustomData fdata;
+ short *edge_flags;
+ char *edge_creases;
} Multires;
/* End Multires */
typedef struct MRecast {
- int i;
+ int i;
} MRecast;
typedef struct GridPaintMask {
- /* The data array contains gridsize*gridsize elements */
- float *data;
+ /* The data array contains gridsize*gridsize elements */
+ float *data;
- /* The maximum multires level associated with this grid */
- unsigned int level;
+ /* The maximum multires level associated with this grid */
+ unsigned int level;
- char _pad[4];
+ char _pad[4];
} GridPaintMask;
typedef enum eMVertSkinFlag {
- /** 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 it's neighbors
- * are directly hulled together, rather than the default of generating intermediate frames.
- */
- MVERT_SKIN_LOOSE = 2,
+ /** 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 it's neighbors
+ * are directly hulled together, rather than the default of generating intermediate frames.
+ */
+ MVERT_SKIN_LOOSE = 2,
} eMVertSkinFlag;
typedef struct MVertSkin {
- /* Radii of the skin, define how big the generated frames are.
- * Currently only the first two elements are used. */
- float radius[3];
+ /* Radii of the skin, define how big the generated frames are.
+ * Currently only the first two elements are used. */
+ float radius[3];
- /* eMVertSkinFlag */
- int flag;
+ /* eMVertSkinFlag */
+ int flag;
} MVertSkin;
typedef struct FreestyleEdge {
- char flag;
- char _pad[3];
+ char flag;
+ char _pad[3];
} FreestyleEdge;
/* FreestyleEdge->flag */
enum {
- FREESTYLE_EDGE_MARK = 1,
+ FREESTYLE_EDGE_MARK = 1,
};
typedef struct FreestyleFace {
- char flag;
- char _pad[3];
+ char flag;
+ char _pad[3];
} FreestyleFace;
/* FreestyleFace->flag */
enum {
- FREESTYLE_FACE_MARK = 1,
+ FREESTYLE_FACE_MARK = 1,
};
/* mvert->flag */
enum {
-/* SELECT = (1 << 0), */
- ME_VERT_TMP_TAG = (1 << 2),
- ME_HIDE = (1 << 4),
-/* ME_VERT_MERGED = (1 << 6), */
- ME_VERT_PBVH_UPDATE = (1 << 7),
+ /* SELECT = (1 << 0), */
+ ME_VERT_TMP_TAG = (1 << 2),
+ ME_HIDE = (1 << 4),
+ /* ME_VERT_MERGED = (1 << 6), */
+ ME_VERT_PBVH_UPDATE = (1 << 7),
};
/* medge->flag */
enum {
-/* SELECT = (1 << 0), */
- ME_EDGEDRAW = (1 << 1),
- ME_SEAM = (1 << 2),
-/* ME_HIDE = (1 << 4), */
- ME_EDGERENDER = (1 << 5),
- ME_LOOSEEDGE = (1 << 7),
- ME_EDGE_TMP_TAG = (1 << 8),
- ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */
+ /* SELECT = (1 << 0), */
+ ME_EDGEDRAW = (1 << 1),
+ ME_SEAM = (1 << 2),
+ /* ME_HIDE = (1 << 4), */
+ ME_EDGERENDER = (1 << 5),
+ ME_LOOSEEDGE = (1 << 7),
+ ME_EDGE_TMP_TAG = (1 << 8),
+ ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */
};
/* puno = vertexnormal (mface) */
enum {
- ME_PROJXY = (1 << 4),
- ME_PROJXZ = (1 << 5),
- ME_PROJYZ = (1 << 6),
+ ME_PROJXY = (1 << 4),
+ ME_PROJXZ = (1 << 5),
+ ME_PROJYZ = (1 << 6),
};
/* edcode (mface) */
enum {
- ME_V1V2 = (1 << 0),
- ME_V2V3 = (1 << 1),
- ME_V3V1 = (1 << 2),
- ME_V3V4 = ME_V3V1,
- ME_V4V1 = (1 << 3),
+ ME_V1V2 = (1 << 0),
+ ME_V2V3 = (1 << 1),
+ ME_V3V1 = (1 << 2),
+ ME_V3V4 = ME_V3V1,
+ ME_V4V1 = (1 << 3),
};
/* flag (mface) */
enum {
- ME_SMOOTH = (1 << 0),
- ME_FACE_SEL = (1 << 1),
-/* ME_HIDE = (1 << 4), */
+ ME_SMOOTH = (1 << 0),
+ ME_FACE_SEL = (1 << 1),
+ /* ME_HIDE = (1 << 4), */
};
-#define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])
-#define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)])
+#define ME_POLY_LOOP_PREV(mloop, mp, i) \
+ (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])
+#define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)])
/* number of tri's that make up this polygon once tessellated */
#define ME_POLY_TRI_TOT(mp) ((mp)->totloop - 2)
@@ -439,15 +441,15 @@ enum {
* So usage such as array lookup needs to check.
*/
#define ME_MAT_NR_TEST(mat_nr, totmat) \
- (CHECK_TYPE_ANY(mat_nr, short, const short), \
- CHECK_TYPE_ANY(totmat, short, const short), \
- (LIKELY(mat_nr < totmat) ? mat_nr : 0))
+ (CHECK_TYPE_ANY(mat_nr, short, const short), \
+ CHECK_TYPE_ANY(totmat, short, const short), \
+ (LIKELY(mat_nr < totmat) ? mat_nr : 0))
/* mselect->type */
enum {
- ME_VSEL = 0,
- ME_ESEL = 1,
- ME_FSEL = 2,
+ ME_VSEL = 0,
+ ME_ESEL = 1,
+ ME_FSEL = 2,
};
-#endif /* __DNA_MESHDATA_TYPES_H__ */
+#endif /* __DNA_MESHDATA_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index 92b6c6e3c5b..c98842eb6d7 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -33,107 +33,105 @@ struct BoundBox;
struct Ipo;
struct Material;
-
typedef struct MetaElem {
- struct MetaElem *next, *prev;
-
- /** Bound Box of MetaElem. */
- struct BoundBox *bb;
-
- short type, flag;
- char _pad[4];
- /** Position of center of MetaElem. */
- float x, y, z;
- /** Rotation of MetaElem (MUST be kept normalized). */
- float quat[4];
- /** Dimension parameters, used for some types like cubes. */
- float expx;
- float expy;
- float expz;
- /** Radius of the meta element. */
- float rad;
- /** Temp field, used only while processing. */
- float rad2;
- /** Stiffness, how much of the element to fill. */
- float s;
- /** Old, only used for backwards compat. use dimensions now. */
- float len;
-
- /** Matrix and inverted matrix. */
- float *mat, *imat;
+ struct MetaElem *next, *prev;
+
+ /** Bound Box of MetaElem. */
+ struct BoundBox *bb;
+
+ short type, flag;
+ char _pad[4];
+ /** Position of center of MetaElem. */
+ float x, y, z;
+ /** Rotation of MetaElem (MUST be kept normalized). */
+ float quat[4];
+ /** Dimension parameters, used for some types like cubes. */
+ float expx;
+ float expy;
+ float expz;
+ /** Radius of the meta element. */
+ float rad;
+ /** Temp field, used only while processing. */
+ float rad2;
+ /** Stiffness, how much of the element to fill. */
+ float s;
+ /** Old, only used for backwards compat. use dimensions now. */
+ float len;
+
+ /** Matrix and inverted matrix. */
+ float *mat, *imat;
} MetaElem;
typedef struct MetaBall {
- ID id;
- struct AnimData *adt;
-
- ListBase elems;
- ListBase disp;
- /** Not saved in files, note we use pointer for editmode check. */
- ListBase *editelems;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
-
- /* material of the mother ball will define the material used of all others */
- struct Material **mat;
-
- /** Flag is enum for updates, flag2 is bitflags for settings. */
- char flag, flag2;
- short totcol;
- /** Used to store MB_AUTOSPACE. */
- short texflag;
- char _pad[2];
-
- /* texture space, copied as one block in editobject.c */
- float loc[3];
- float size[3];
- float rot[3];
-
- /** Display and render res. */
- float wiresize, rendersize;
-
- /* 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;
-
- /* used in editmode */
- /*ListBase edit_elems;*/
- MetaElem *lastelem;
-
- void *batch_cache;
+ ID id;
+ struct AnimData *adt;
+
+ ListBase elems;
+ ListBase disp;
+ /** Not saved in files, note we use pointer for editmode check. */
+ ListBase *editelems;
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+
+ /* material of the mother ball will define the material used of all others */
+ struct Material **mat;
+
+ /** Flag is enum for updates, flag2 is bitflags for settings. */
+ char flag, flag2;
+ short totcol;
+ /** Used to store MB_AUTOSPACE. */
+ short texflag;
+ char _pad[2];
+
+ /* texture space, copied as one block in editobject.c */
+ float loc[3];
+ float size[3];
+ float rot[3];
+
+ /** Display and render res. */
+ float wiresize, rendersize;
+
+ /* 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;
+
+ /* used in editmode */
+ /*ListBase edit_elems;*/
+ MetaElem *lastelem;
+
+ void *batch_cache;
} MetaBall;
/* **************** METABALL ********************* */
/* texflag */
-#define MB_AUTOSPACE 1
+#define MB_AUTOSPACE 1
/* mb->flag */
-#define MB_UPDATE_ALWAYS 0
-#define MB_UPDATE_HALFRES 1
-#define MB_UPDATE_FAST 2
-#define MB_UPDATE_NEVER 3
+#define MB_UPDATE_ALWAYS 0
+#define MB_UPDATE_HALFRES 1
+#define MB_UPDATE_FAST 2
+#define MB_UPDATE_NEVER 3
/* mb->flag2 */
-#define MB_DS_EXPAND (1 << 0)
-
+#define MB_DS_EXPAND (1 << 0)
/* ml->type */
-#define MB_BALL 0
-#define MB_TUBEX 1 /* depercated */
-#define MB_TUBEY 2 /* depercated */
-#define MB_TUBEZ 3 /* depercated */
-#define MB_TUBE 4
-#define MB_PLANE 5
-#define MB_ELIPSOID 6
-#define MB_CUBE 7
+#define MB_BALL 0
+#define MB_TUBEX 1 /* depercated */
+#define MB_TUBEY 2 /* depercated */
+#define MB_TUBEZ 3 /* depercated */
+#define MB_TUBE 4
+#define MB_PLANE 5
+#define MB_ELIPSOID 6
+#define MB_CUBE 7
-#define MB_TYPE_SIZE_SQUARED(type) (type == MB_ELIPSOID)
+#define MB_TYPE_SIZE_SQUARED(type) (type == MB_ELIPSOID)
/* ml->flag */
-#define MB_NEGATIVE 2
-#define MB_HIDE 8
-#define MB_SCALE_RAD 16
+#define MB_NEGATIVE 2
+#define MB_HIDE 8
+#define MB_SCALE_RAD 16
#endif
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 0ee58b5397b..1b85fb26c0e 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -33,1896 +33,1894 @@ struct Scene;
struct Subdiv;
typedef enum ModifierType {
- eModifierType_None = 0,
- eModifierType_Subsurf = 1,
- eModifierType_Lattice = 2,
- eModifierType_Curve = 3,
- eModifierType_Build = 4,
- eModifierType_Mirror = 5,
- eModifierType_Decimate = 6,
- eModifierType_Wave = 7,
- eModifierType_Armature = 8,
- eModifierType_Hook = 9,
- eModifierType_Softbody = 10,
- eModifierType_Boolean = 11,
- eModifierType_Array = 12,
- eModifierType_EdgeSplit = 13,
- eModifierType_Displace = 14,
- eModifierType_UVProject = 15,
- eModifierType_Smooth = 16,
- eModifierType_Cast = 17,
- eModifierType_MeshDeform = 18,
- eModifierType_ParticleSystem = 19,
- eModifierType_ParticleInstance = 20,
- eModifierType_Explode = 21,
- eModifierType_Cloth = 22,
- eModifierType_Collision = 23,
- eModifierType_Bevel = 24,
- eModifierType_Shrinkwrap = 25,
- eModifierType_Fluidsim = 26,
- eModifierType_Mask = 27,
- eModifierType_SimpleDeform = 28,
- eModifierType_Multires = 29,
- eModifierType_Surface = 30,
- eModifierType_Smoke = 31,
- eModifierType_ShapeKey = 32,
- eModifierType_Solidify = 33,
- eModifierType_Screw = 34,
- eModifierType_Warp = 35,
- eModifierType_WeightVGEdit = 36,
- eModifierType_WeightVGMix = 37,
- eModifierType_WeightVGProximity = 38,
- eModifierType_Ocean = 39,
- eModifierType_DynamicPaint = 40,
- eModifierType_Remesh = 41,
- eModifierType_Skin = 42,
- eModifierType_LaplacianSmooth = 43,
- eModifierType_Triangulate = 44,
- eModifierType_UVWarp = 45,
- eModifierType_MeshCache = 46,
- eModifierType_LaplacianDeform = 47,
- eModifierType_Wireframe = 48,
- eModifierType_DataTransfer = 49,
- eModifierType_NormalEdit = 50,
- eModifierType_CorrectiveSmooth = 51,
- eModifierType_MeshSequenceCache = 52,
- eModifierType_SurfaceDeform = 53,
- eModifierType_WeightedNormal = 54,
- NUM_MODIFIER_TYPES,
+ eModifierType_None = 0,
+ eModifierType_Subsurf = 1,
+ eModifierType_Lattice = 2,
+ eModifierType_Curve = 3,
+ eModifierType_Build = 4,
+ eModifierType_Mirror = 5,
+ eModifierType_Decimate = 6,
+ eModifierType_Wave = 7,
+ eModifierType_Armature = 8,
+ eModifierType_Hook = 9,
+ eModifierType_Softbody = 10,
+ eModifierType_Boolean = 11,
+ eModifierType_Array = 12,
+ eModifierType_EdgeSplit = 13,
+ eModifierType_Displace = 14,
+ eModifierType_UVProject = 15,
+ eModifierType_Smooth = 16,
+ eModifierType_Cast = 17,
+ eModifierType_MeshDeform = 18,
+ eModifierType_ParticleSystem = 19,
+ eModifierType_ParticleInstance = 20,
+ eModifierType_Explode = 21,
+ eModifierType_Cloth = 22,
+ eModifierType_Collision = 23,
+ eModifierType_Bevel = 24,
+ eModifierType_Shrinkwrap = 25,
+ eModifierType_Fluidsim = 26,
+ eModifierType_Mask = 27,
+ eModifierType_SimpleDeform = 28,
+ eModifierType_Multires = 29,
+ eModifierType_Surface = 30,
+ eModifierType_Smoke = 31,
+ eModifierType_ShapeKey = 32,
+ eModifierType_Solidify = 33,
+ eModifierType_Screw = 34,
+ eModifierType_Warp = 35,
+ eModifierType_WeightVGEdit = 36,
+ eModifierType_WeightVGMix = 37,
+ eModifierType_WeightVGProximity = 38,
+ eModifierType_Ocean = 39,
+ eModifierType_DynamicPaint = 40,
+ eModifierType_Remesh = 41,
+ eModifierType_Skin = 42,
+ eModifierType_LaplacianSmooth = 43,
+ eModifierType_Triangulate = 44,
+ eModifierType_UVWarp = 45,
+ eModifierType_MeshCache = 46,
+ eModifierType_LaplacianDeform = 47,
+ eModifierType_Wireframe = 48,
+ eModifierType_DataTransfer = 49,
+ eModifierType_NormalEdit = 50,
+ eModifierType_CorrectiveSmooth = 51,
+ eModifierType_MeshSequenceCache = 52,
+ eModifierType_SurfaceDeform = 53,
+ eModifierType_WeightedNormal = 54,
+ NUM_MODIFIER_TYPES,
} ModifierType;
typedef enum ModifierMode {
- eModifierMode_Realtime = (1 << 0),
- eModifierMode_Render = (1 << 1),
- eModifierMode_Editmode = (1 << 2),
- eModifierMode_OnCage = (1 << 3),
- eModifierMode_Expanded = (1 << 4),
- eModifierMode_Virtual = (1 << 5),
- eModifierMode_ApplyOnSpline = (1 << 6),
- eModifierMode_DisableTemporary = (1u << 31),
+ eModifierMode_Realtime = (1 << 0),
+ eModifierMode_Render = (1 << 1),
+ eModifierMode_Editmode = (1 << 2),
+ eModifierMode_OnCage = (1 << 3),
+ eModifierMode_Expanded = (1 << 4),
+ eModifierMode_Virtual = (1 << 5),
+ eModifierMode_ApplyOnSpline = (1 << 6),
+ eModifierMode_DisableTemporary = (1u << 31),
} ModifierMode;
typedef struct ModifierData {
- struct ModifierData *next, *prev;
+ struct ModifierData *next, *prev;
- int type, mode;
- int stackindex;
- short flag;
- char _pad[2];
- /** MAX_NAME. */
- char name[64];
+ int type, mode;
+ int stackindex;
+ short flag;
+ char _pad[2];
+ /** MAX_NAME. */
+ char name[64];
- char *error;
+ char *error;
- /* Pointer to a ModifierData in the original domain. */
- struct ModifierData *orig_modifier_data;
- void *runtime;
+ /* Pointer to a ModifierData in the original domain. */
+ struct ModifierData *orig_modifier_data;
+ void *runtime;
} ModifierData;
typedef enum {
- /* This modifier has been inserted in local override, and hence can be fully edited. */
- eModifierFlag_StaticOverride_Local = (1 << 0),
- /* This modifier does not own its caches, but instead shares them with another modifier. */
- eModifierFlag_SharedCaches = (1 << 1),
+ /* This modifier has been inserted in local override, and hence can be fully edited. */
+ eModifierFlag_StaticOverride_Local = (1 << 0),
+ /* This modifier does not own its caches, but instead shares them with another modifier. */
+ eModifierFlag_SharedCaches = (1 << 1),
} ModifierFlag;
/* not a real modifier */
typedef struct MappingInfoModifierData {
- ModifierData modifier;
-
- struct Tex *texture;
- struct Object *map_object;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- int uvlayer_tmp;
- int texmapping;
+ ModifierData modifier;
+
+ struct Tex *texture;
+ struct Object *map_object;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ int uvlayer_tmp;
+ int texmapping;
} MappingInfoModifierData;
typedef enum {
- eSubsurfModifierFlag_Incremental = (1 << 0),
- eSubsurfModifierFlag_DebugIncr = (1 << 1),
- eSubsurfModifierFlag_ControlEdges = (1 << 2),
- /* DEPRECATED, ONLY USED FOR DO-VERSIONS */
- eSubsurfModifierFlag_SubsurfUv_DEPRECATED = (1 << 3),
- eSubsurfModifierFlag_UseCrease = (1 << 4),
+ eSubsurfModifierFlag_Incremental = (1 << 0),
+ eSubsurfModifierFlag_DebugIncr = (1 << 1),
+ eSubsurfModifierFlag_ControlEdges = (1 << 2),
+ /* DEPRECATED, ONLY USED FOR DO-VERSIONS */
+ eSubsurfModifierFlag_SubsurfUv_DEPRECATED = (1 << 3),
+ eSubsurfModifierFlag_UseCrease = (1 << 4),
} SubsurfModifierFlag;
typedef enum {
- SUBSURF_TYPE_CATMULL_CLARK = 0,
- SUBSURF_TYPE_SIMPLE = 1,
+ SUBSURF_TYPE_CATMULL_CLARK = 0,
+ SUBSURF_TYPE_SIMPLE = 1,
} eSubsurfModifierType;
typedef enum {
- SUBSURF_UV_SMOOTH_NONE = 0,
- SUBSURF_UV_SMOOTH_PRESERVE_CORNERS = 1,
- SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS = 2,
- SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE = 3,
- SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES = 4,
- SUBSURF_UV_SMOOTH_ALL = 5,
+ SUBSURF_UV_SMOOTH_NONE = 0,
+ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS = 1,
+ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS = 2,
+ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE = 3,
+ SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES = 4,
+ SUBSURF_UV_SMOOTH_ALL = 5,
} eSubsurfUVSmooth;
typedef struct SubsurfModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- short subdivType, levels, renderLevels, flags;
- short uv_smooth;
- short quality;
- char _pad[4];
+ short subdivType, levels, renderLevels, flags;
+ short uv_smooth;
+ short quality;
+ char _pad[4];
- /* TODO(sergey): Get rid of those with the old CCG subdivision code. */
- void *emCache, *mCache;
+ /* TODO(sergey): Get rid of those with the old CCG subdivision code. */
+ void *emCache, *mCache;
} SubsurfModifierData;
typedef struct LatticeModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- struct Object *object;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char name[64];
- float strength;
- char _pad[4];
+ struct Object *object;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char name[64];
+ float strength;
+ char _pad[4];
} LatticeModifierData;
typedef struct CurveModifierData {
- ModifierData modifier;
-
- struct Object *object;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char name[64];
- /** Axis along which curve deforms. */
- short defaxis;
- char _pad[6];
+ ModifierData modifier;
+
+ struct Object *object;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char name[64];
+ /** Axis along which curve deforms. */
+ short defaxis;
+ char _pad[6];
} CurveModifierData;
/* CurveModifierData->defaxis */
enum {
- MOD_CURVE_POSX = 1,
- MOD_CURVE_POSY = 2,
- MOD_CURVE_POSZ = 3,
- MOD_CURVE_NEGX = 4,
- MOD_CURVE_NEGY = 5,
- MOD_CURVE_NEGZ = 6,
+ MOD_CURVE_POSX = 1,
+ MOD_CURVE_POSY = 2,
+ MOD_CURVE_POSZ = 3,
+ MOD_CURVE_NEGX = 4,
+ MOD_CURVE_NEGY = 5,
+ MOD_CURVE_NEGZ = 6,
};
typedef struct BuildModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- float start, length;
- short flag;
+ float start, length;
+ short flag;
- /** (bool) whether order of vertices is randomized - legacy files (for readfile conversion). */
- short randomize;
- /** (int) random seed. */
- int seed;
+ /** (bool) whether order of vertices is randomized - legacy files (for readfile conversion). */
+ short randomize;
+ /** (int) random seed. */
+ int seed;
} BuildModifierData;
/* Build Modifier -> flag */
enum {
- /** order of vertices is randomized */
- MOD_BUILD_FLAG_RANDOMIZE = (1 << 0),
- /** frame range is reversed, resulting in a deconstruction effect */
- MOD_BUILD_FLAG_REVERSE = (1 << 1),
+ /** order of vertices is randomized */
+ MOD_BUILD_FLAG_RANDOMIZE = (1 << 0),
+ /** frame range is reversed, resulting in a deconstruction effect */
+ MOD_BUILD_FLAG_REVERSE = (1 << 1),
};
/* Mask Modifier */
typedef struct MaskModifierData {
- ModifierData modifier;
-
- /** Armature to use to in place of hardcoded vgroup. */
- struct Object *ob_arm;
- /** Name of vertex group to use to mask, MAX_VGROUP_NAME. */
- char vgroup[64];
-
- /** Using armature or hardcoded vgroup. */
- short mode;
- /** Flags for various things. */
- short flag;
- float threshold;
+ ModifierData modifier;
+
+ /** Armature to use to in place of hardcoded vgroup. */
+ struct Object *ob_arm;
+ /** Name of vertex group to use to mask, MAX_VGROUP_NAME. */
+ char vgroup[64];
+
+ /** Using armature or hardcoded vgroup. */
+ short mode;
+ /** Flags for various things. */
+ short flag;
+ float threshold;
} MaskModifierData;
/* Mask Modifier -> mode */
enum {
- MOD_MASK_MODE_VGROUP = 0,
- MOD_MASK_MODE_ARM = 1,
+ MOD_MASK_MODE_VGROUP = 0,
+ MOD_MASK_MODE_ARM = 1,
};
/* Mask Modifier -> flag */
enum {
- MOD_MASK_INV = (1 << 0),
+ MOD_MASK_INV = (1 << 0),
};
typedef struct ArrayModifierData {
- ModifierData modifier;
-
- /* the object with which to cap the start of the array */
- struct Object *start_cap;
- /* the object with which to cap the end of the array */
- struct Object *end_cap;
- /* the curve object to use for MOD_ARR_FITCURVE */
- struct Object *curve_ob;
- /* the object to use for object offset */
- struct Object *offset_ob;
- /* a constant duplicate offset;
- * 1 means the duplicates are 1 unit apart
- */
- float offset[3];
- /* a scaled factor for duplicate offsets;
- * 1 means the duplicates are 1 object-width apart
- */
- float scale[3];
- /* the length over which to distribute the duplicates */
- float length;
- /* the limit below which to merge vertices in adjacent duplicates */
- float merge_dist;
- /* determines how duplicate count is calculated; one of:
- * - MOD_ARR_FIXEDCOUNT -> fixed
- * - MOD_ARR_FITLENGTH -> calculated to fit a set length
- * - MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
- */
- int fit_type;
- /* flags specifying how total offset is calculated; binary OR of:
- * - MOD_ARR_OFF_CONST -> total offset += offset
- * - MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
- * - MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
- * total offset is the sum of the individual enabled offsets
- */
- int offset_type;
- /* general flags:
- * MOD_ARR_MERGE -> merge vertices in adjacent duplicates
- */
- int flags;
- /* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
- int count;
- float uv_offset[2];
+ ModifierData modifier;
+
+ /* the object with which to cap the start of the array */
+ struct Object *start_cap;
+ /* the object with which to cap the end of the array */
+ struct Object *end_cap;
+ /* the curve object to use for MOD_ARR_FITCURVE */
+ struct Object *curve_ob;
+ /* the object to use for object offset */
+ struct Object *offset_ob;
+ /* a constant duplicate offset;
+ * 1 means the duplicates are 1 unit apart
+ */
+ float offset[3];
+ /* a scaled factor for duplicate offsets;
+ * 1 means the duplicates are 1 object-width apart
+ */
+ float scale[3];
+ /* the length over which to distribute the duplicates */
+ float length;
+ /* the limit below which to merge vertices in adjacent duplicates */
+ float merge_dist;
+ /* determines how duplicate count is calculated; one of:
+ * - MOD_ARR_FIXEDCOUNT -> fixed
+ * - MOD_ARR_FITLENGTH -> calculated to fit a set length
+ * - MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
+ */
+ int fit_type;
+ /* flags specifying how total offset is calculated; binary OR of:
+ * - MOD_ARR_OFF_CONST -> total offset += offset
+ * - MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
+ * - MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
+ * total offset is the sum of the individual enabled offsets
+ */
+ int offset_type;
+ /* general flags:
+ * MOD_ARR_MERGE -> merge vertices in adjacent duplicates
+ */
+ int flags;
+ /* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
+ int count;
+ float uv_offset[2];
} ArrayModifierData;
/* ArrayModifierData->fit_type */
enum {
- MOD_ARR_FIXEDCOUNT = 0,
- MOD_ARR_FITLENGTH = 1,
- MOD_ARR_FITCURVE = 2,
+ MOD_ARR_FIXEDCOUNT = 0,
+ MOD_ARR_FITLENGTH = 1,
+ MOD_ARR_FITCURVE = 2,
};
/* ArrayModifierData->offset_type */
enum {
- MOD_ARR_OFF_CONST = (1 << 0),
- MOD_ARR_OFF_RELATIVE = (1 << 1),
- MOD_ARR_OFF_OBJ = (1 << 2),
+ MOD_ARR_OFF_CONST = (1 << 0),
+ MOD_ARR_OFF_RELATIVE = (1 << 1),
+ MOD_ARR_OFF_OBJ = (1 << 2),
};
/* ArrayModifierData->flags */
enum {
- MOD_ARR_MERGE = (1 << 0),
- MOD_ARR_MERGEFINAL = (1 << 1),
+ MOD_ARR_MERGE = (1 << 0),
+ MOD_ARR_MERGEFINAL = (1 << 1),
};
typedef struct MirrorModifierData {
- ModifierData modifier;
-
- /** Deprecated, use flag instead. */
- short axis DNA_DEPRECATED;
- short flag;
- float tolerance;
- float uv_offset[2];
- float uv_offset_copy[2];
- struct Object *mirror_ob;
+ ModifierData modifier;
+
+ /** Deprecated, use flag instead. */
+ short axis DNA_DEPRECATED;
+ short flag;
+ float tolerance;
+ float uv_offset[2];
+ float uv_offset_copy[2];
+ struct Object *mirror_ob;
} MirrorModifierData;
/* MirrorModifierData->flag */
enum {
- MOD_MIR_CLIPPING = (1 << 0),
- MOD_MIR_MIRROR_U = (1 << 1),
- MOD_MIR_MIRROR_V = (1 << 2),
- MOD_MIR_AXIS_X = (1 << 3),
- MOD_MIR_AXIS_Y = (1 << 4),
- MOD_MIR_AXIS_Z = (1 << 5),
- MOD_MIR_VGROUP = (1 << 6),
- MOD_MIR_NO_MERGE = (1 << 7),
- MOD_MIR_BISECT_AXIS_X = (1 << 8),
- MOD_MIR_BISECT_AXIS_Y = (1 << 9),
- MOD_MIR_BISECT_AXIS_Z = (1 << 10),
- MOD_MIR_BISECT_FLIP_AXIS_X = (1 << 11),
- MOD_MIR_BISECT_FLIP_AXIS_Y = (1 << 12),
- MOD_MIR_BISECT_FLIP_AXIS_Z = (1 << 13),
+ MOD_MIR_CLIPPING = (1 << 0),
+ MOD_MIR_MIRROR_U = (1 << 1),
+ MOD_MIR_MIRROR_V = (1 << 2),
+ MOD_MIR_AXIS_X = (1 << 3),
+ MOD_MIR_AXIS_Y = (1 << 4),
+ MOD_MIR_AXIS_Z = (1 << 5),
+ MOD_MIR_VGROUP = (1 << 6),
+ MOD_MIR_NO_MERGE = (1 << 7),
+ MOD_MIR_BISECT_AXIS_X = (1 << 8),
+ MOD_MIR_BISECT_AXIS_Y = (1 << 9),
+ MOD_MIR_BISECT_AXIS_Z = (1 << 10),
+ MOD_MIR_BISECT_FLIP_AXIS_X = (1 << 11),
+ MOD_MIR_BISECT_FLIP_AXIS_Y = (1 << 12),
+ MOD_MIR_BISECT_FLIP_AXIS_Z = (1 << 13),
};
typedef struct EdgeSplitModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /** Angle above which edges should be split. */
- float split_angle;
- int flags;
+ /** Angle above which edges should be split. */
+ float split_angle;
+ int flags;
} EdgeSplitModifierData;
/* EdgeSplitModifierData->flags */
enum {
- MOD_EDGESPLIT_FROMANGLE = (1 << 1),
- MOD_EDGESPLIT_FROMFLAG = (1 << 2),
+ MOD_EDGESPLIT_FROMANGLE = (1 << 1),
+ MOD_EDGESPLIT_FROMFLAG = (1 << 2),
};
typedef struct BevelModifierData {
- ModifierData modifier;
-
- /** The "raw" bevel value (distance/amount to bevel). */
- float value;
- /** The resolution (as originally coded, it is the number of recursive bevels). */
- int res;
- /** General option flags. */
- short flags;
- /** Used to interpret the bevel value. */
- short val_flags;
- /** Flags to tell the tool how to limit the bevel. */
- short lim_flags;
- /** Flags to direct how edge weights are applied to verts. */
- short e_flags;
- /** Material index if >= 0, else material inherited from surrounding faces. */
- short mat;
- short edge_flags;
- short face_str_mode;
- /* patterns to use for mitering non-reflex and reflex miter edges */
- short miter_inner;
- short miter_outer;
- char _pad0[2];
- /** Controls profile shape (0->1, .5 is round). */
- float profile;
- /** if the MOD_BEVEL_ANGLE is set,
- * this will be how "sharp" an edge must be before it gets beveled */
- float bevel_angle;
- float spread;
- /** if the MOD_BEVEL_VWEIGHT option is set,
- * this will be the name of the vert group, MAX_VGROUP_NAME */
- char defgrp_name[64];
+ ModifierData modifier;
+
+ /** The "raw" bevel value (distance/amount to bevel). */
+ float value;
+ /** The resolution (as originally coded, it is the number of recursive bevels). */
+ int res;
+ /** General option flags. */
+ short flags;
+ /** Used to interpret the bevel value. */
+ short val_flags;
+ /** Flags to tell the tool how to limit the bevel. */
+ short lim_flags;
+ /** Flags to direct how edge weights are applied to verts. */
+ short e_flags;
+ /** Material index if >= 0, else material inherited from surrounding faces. */
+ short mat;
+ short edge_flags;
+ short face_str_mode;
+ /* patterns to use for mitering non-reflex and reflex miter edges */
+ short miter_inner;
+ short miter_outer;
+ char _pad0[2];
+ /** Controls profile shape (0->1, .5 is round). */
+ float profile;
+ /** if the MOD_BEVEL_ANGLE is set,
+ * this will be how "sharp" an edge must be before it gets beveled */
+ float bevel_angle;
+ float spread;
+ /** if the MOD_BEVEL_VWEIGHT option is set,
+ * this will be the name of the vert group, MAX_VGROUP_NAME */
+ char defgrp_name[64];
} BevelModifierData;
/* BevelModifierData->flags and BevelModifierData->lim_flags */
enum {
- MOD_BEVEL_VERT = (1 << 1),
-/* unused = (1 << 2), */
- MOD_BEVEL_ANGLE = (1 << 3),
- MOD_BEVEL_WEIGHT = (1 << 4),
- MOD_BEVEL_VGROUP = (1 << 5),
-/* unused = (1 << 7), */
-/* unused = (1 << 8), */
-/* unused = (1 << 9), */
-/* unused = (1 << 10), */
-/* unused = (1 << 11), */
-/* unused = (1 << 12), */
- MOD_BEVEL_OVERLAP_OK = (1 << 13),
- MOD_BEVEL_EVEN_WIDTHS = (1 << 14),
- MOD_BEVEL_HARDEN_NORMALS = (1 << 15),
+ MOD_BEVEL_VERT = (1 << 1),
+ /* unused = (1 << 2), */
+ MOD_BEVEL_ANGLE = (1 << 3),
+ MOD_BEVEL_WEIGHT = (1 << 4),
+ MOD_BEVEL_VGROUP = (1 << 5),
+ /* unused = (1 << 7), */
+ /* unused = (1 << 8), */
+ /* unused = (1 << 9), */
+ /* unused = (1 << 10), */
+ /* unused = (1 << 11), */
+ /* unused = (1 << 12), */
+ MOD_BEVEL_OVERLAP_OK = (1 << 13),
+ MOD_BEVEL_EVEN_WIDTHS = (1 << 14),
+ MOD_BEVEL_HARDEN_NORMALS = (1 << 15),
};
/* BevelModifierData->val_flags (not used as flags any more) */
enum {
- MOD_BEVEL_AMT_OFFSET = 0,
- MOD_BEVEL_AMT_WIDTH = 1,
- MOD_BEVEL_AMT_DEPTH = 2,
- MOD_BEVEL_AMT_PERCENT = 3,
+ MOD_BEVEL_AMT_OFFSET = 0,
+ MOD_BEVEL_AMT_WIDTH = 1,
+ MOD_BEVEL_AMT_DEPTH = 2,
+ MOD_BEVEL_AMT_PERCENT = 3,
};
/* BevelModifierData->edge_flags */
enum {
- MOD_BEVEL_MARK_SEAM = (1 << 0),
- MOD_BEVEL_MARK_SHARP = (1 << 1),
+ MOD_BEVEL_MARK_SEAM = (1 << 0),
+ MOD_BEVEL_MARK_SHARP = (1 << 1),
};
/* BevelModifierData->face_str_mode */
enum {
- MOD_BEVEL_FACE_STRENGTH_NONE,
- MOD_BEVEL_FACE_STRENGTH_NEW,
- MOD_BEVEL_FACE_STRENGTH_AFFECTED,
- MOD_BEVEL_FACE_STRENGTH_ALL,
+ MOD_BEVEL_FACE_STRENGTH_NONE,
+ MOD_BEVEL_FACE_STRENGTH_NEW,
+ MOD_BEVEL_FACE_STRENGTH_AFFECTED,
+ MOD_BEVEL_FACE_STRENGTH_ALL,
};
/* BevelModifier->miter_inner and ->miter_outer */
enum {
- MOD_BEVEL_MITER_SHARP,
- MOD_BEVEL_MITER_PATCH,
- MOD_BEVEL_MITER_ARC,
+ MOD_BEVEL_MITER_SHARP,
+ MOD_BEVEL_MITER_PATCH,
+ MOD_BEVEL_MITER_ARC,
};
typedef struct SmokeModifierData {
- ModifierData modifier;
-
- struct SmokeDomainSettings *domain;
- /** Inflow, outflow, smoke objects. */
- struct SmokeFlowSettings *flow;
- /** Collision objects. */
- struct SmokeCollSettings *coll;
- float time;
- /** Domain, inflow, outflow, .... */
- int type;
+ ModifierData modifier;
+
+ struct SmokeDomainSettings *domain;
+ /** Inflow, outflow, smoke objects. */
+ struct SmokeFlowSettings *flow;
+ /** Collision objects. */
+ struct SmokeCollSettings *coll;
+ float time;
+ /** Domain, inflow, outflow, .... */
+ int type;
} SmokeModifierData;
/* Smoke modifier flags */
enum {
- MOD_SMOKE_TYPE_DOMAIN = (1 << 0),
- MOD_SMOKE_TYPE_FLOW = (1 << 1),
- MOD_SMOKE_TYPE_COLL = (1 << 2),
+ MOD_SMOKE_TYPE_DOMAIN = (1 << 0),
+ MOD_SMOKE_TYPE_FLOW = (1 << 1),
+ MOD_SMOKE_TYPE_COLL = (1 << 2),
};
typedef struct DisplaceModifierData {
- ModifierData modifier;
-
- /* keep in sync with MappingInfoModifierData */
- struct Tex *texture;
- struct Object *map_object;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- int uvlayer_tmp;
- int texmapping;
- /* end MappingInfoModifierData */
-
- float strength;
- int direction;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- float midlevel;
- int space;
+ ModifierData modifier;
+
+ /* keep in sync with MappingInfoModifierData */
+ struct Tex *texture;
+ struct Object *map_object;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ int uvlayer_tmp;
+ int texmapping;
+ /* end MappingInfoModifierData */
+
+ float strength;
+ int direction;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ float midlevel;
+ int space;
} DisplaceModifierData;
/* DisplaceModifierData->direction */
enum {
- MOD_DISP_DIR_X = 0,
- MOD_DISP_DIR_Y = 1,
- MOD_DISP_DIR_Z = 2,
- MOD_DISP_DIR_NOR = 3,
- MOD_DISP_DIR_RGB_XYZ = 4,
- MOD_DISP_DIR_CLNOR = 5,
+ MOD_DISP_DIR_X = 0,
+ MOD_DISP_DIR_Y = 1,
+ MOD_DISP_DIR_Z = 2,
+ MOD_DISP_DIR_NOR = 3,
+ MOD_DISP_DIR_RGB_XYZ = 4,
+ MOD_DISP_DIR_CLNOR = 5,
};
/* DisplaceModifierData->texmapping */
enum {
- MOD_DISP_MAP_LOCAL = 0,
- MOD_DISP_MAP_GLOBAL = 1,
- MOD_DISP_MAP_OBJECT = 2,
- MOD_DISP_MAP_UV = 3,
+ MOD_DISP_MAP_LOCAL = 0,
+ MOD_DISP_MAP_GLOBAL = 1,
+ MOD_DISP_MAP_OBJECT = 2,
+ MOD_DISP_MAP_UV = 3,
};
/* DisplaceModifierData->space */
enum {
- MOD_DISP_SPACE_LOCAL = 0,
- MOD_DISP_SPACE_GLOBAL = 1,
+ MOD_DISP_SPACE_LOCAL = 0,
+ MOD_DISP_SPACE_GLOBAL = 1,
};
typedef struct UVProjectModifierData {
- ModifierData modifier;
-
- /* the objects which do the projecting */
- /** MOD_UVPROJECT_MAXPROJECTORS. */
- struct Object *projectors[10];
- char _pad2[4];
- int num_projectors;
- float aspectx, aspecty;
- float scalex, scaley;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- int uvlayer_tmp;
- char _pad[4];
+ ModifierData modifier;
+
+ /* the objects which do the projecting */
+ /** MOD_UVPROJECT_MAXPROJECTORS. */
+ struct Object *projectors[10];
+ char _pad2[4];
+ int num_projectors;
+ float aspectx, aspecty;
+ float scalex, scaley;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ int uvlayer_tmp;
+ char _pad[4];
} UVProjectModifierData;
#define MOD_UVPROJECT_MAXPROJECTORS 10
/* UVProjectModifierData->flags */
enum {
- MOD_UVPROJECT_OVERRIDEIMAGE = (1 << 0),
+ MOD_UVPROJECT_OVERRIDEIMAGE = (1 << 0),
};
typedef struct DecimateModifierData {
- ModifierData modifier;
-
- /** (mode == MOD_DECIM_MODE_COLLAPSE). */
- float percent;
- /** (mode == MOD_DECIM_MODE_UNSUBDIV). */
- short iter;
- /** (mode == MOD_DECIM_MODE_DISSOLVE). */
- char delimit;
- /** (mode == MOD_DECIM_MODE_COLLAPSE). */
- char symmetry_axis;
- /** (mode == MOD_DECIM_MODE_DISSOLVE). */
- float angle;
-
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- float defgrp_factor;
- short flag, mode;
-
- /* runtime only */
- int face_count;
+ ModifierData modifier;
+
+ /** (mode == MOD_DECIM_MODE_COLLAPSE). */
+ float percent;
+ /** (mode == MOD_DECIM_MODE_UNSUBDIV). */
+ short iter;
+ /** (mode == MOD_DECIM_MODE_DISSOLVE). */
+ char delimit;
+ /** (mode == MOD_DECIM_MODE_COLLAPSE). */
+ char symmetry_axis;
+ /** (mode == MOD_DECIM_MODE_DISSOLVE). */
+ float angle;
+
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ float defgrp_factor;
+ short flag, mode;
+
+ /* runtime only */
+ int face_count;
} DecimateModifierData;
enum {
- MOD_DECIM_FLAG_INVERT_VGROUP = (1 << 0),
- /** for collapse only. dont convert tri pairs back to quads */
- MOD_DECIM_FLAG_TRIANGULATE = (1 << 1),
- /** for dissolve only. collapse all verts between 2 faces */
- MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS = (1 << 2),
- MOD_DECIM_FLAG_SYMMETRY = (1 << 3),
+ MOD_DECIM_FLAG_INVERT_VGROUP = (1 << 0),
+ /** for collapse only. dont convert tri pairs back to quads */
+ MOD_DECIM_FLAG_TRIANGULATE = (1 << 1),
+ /** for dissolve only. collapse all verts between 2 faces */
+ MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS = (1 << 2),
+ MOD_DECIM_FLAG_SYMMETRY = (1 << 3),
};
enum {
- MOD_DECIM_MODE_COLLAPSE,
- MOD_DECIM_MODE_UNSUBDIV,
- /** called planar in the UI */
- MOD_DECIM_MODE_DISSOLVE,
+ MOD_DECIM_MODE_COLLAPSE,
+ MOD_DECIM_MODE_UNSUBDIV,
+ /** called planar in the UI */
+ MOD_DECIM_MODE_DISSOLVE,
};
typedef struct SmoothModifierData {
- ModifierData modifier;
- float fac;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- short flag, repeat;
+ ModifierData modifier;
+ float fac;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ short flag, repeat;
} SmoothModifierData;
/* Smooth modifier flags */
enum {
- MOD_SMOOTH_X = (1 << 1),
- MOD_SMOOTH_Y = (1 << 2),
- MOD_SMOOTH_Z = (1 << 3),
+ MOD_SMOOTH_X = (1 << 1),
+ MOD_SMOOTH_Y = (1 << 2),
+ MOD_SMOOTH_Z = (1 << 3),
};
typedef struct CastModifierData {
- ModifierData modifier;
-
- struct Object *object;
- float fac;
- float radius;
- float size;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- short flag, type;
+ ModifierData modifier;
+
+ struct Object *object;
+ float fac;
+ float radius;
+ float size;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ short flag, type;
} CastModifierData;
/* Cast modifier flags */
enum {
- /* And what bout (1 << 0) flag? ;) */
- MOD_CAST_X = (1 << 1),
- MOD_CAST_Y = (1 << 2),
- MOD_CAST_Z = (1 << 3),
- MOD_CAST_USE_OB_TRANSFORM = (1 << 4),
- MOD_CAST_SIZE_FROM_RADIUS = (1 << 5),
+ /* And what bout (1 << 0) flag? ;) */
+ MOD_CAST_X = (1 << 1),
+ MOD_CAST_Y = (1 << 2),
+ MOD_CAST_Z = (1 << 3),
+ MOD_CAST_USE_OB_TRANSFORM = (1 << 4),
+ MOD_CAST_SIZE_FROM_RADIUS = (1 << 5),
};
/* Cast modifier projection types */
enum {
- MOD_CAST_TYPE_SPHERE = 0,
- MOD_CAST_TYPE_CYLINDER = 1,
- MOD_CAST_TYPE_CUBOID = 2,
+ MOD_CAST_TYPE_SPHERE = 0,
+ MOD_CAST_TYPE_CYLINDER = 1,
+ MOD_CAST_TYPE_CUBOID = 2,
};
typedef struct WaveModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /* keep in sync with MappingInfoModifierData */
- struct Tex *texture;
- struct Object *map_object;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- int uvlayer_tmp;
- int texmapping;
- /* end MappingInfoModifierData */
+ /* keep in sync with MappingInfoModifierData */
+ struct Tex *texture;
+ struct Object *map_object;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ int uvlayer_tmp;
+ int texmapping;
+ /* end MappingInfoModifierData */
- struct Object *objectcenter;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
+ struct Object *objectcenter;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
- short flag;
- char _pad[2];
+ short flag;
+ char _pad[2];
- float startx, starty, height, width;
- float narrow, speed, damp, falloff;
+ float startx, starty, height, width;
+ float narrow, speed, damp, falloff;
- float timeoffs, lifetime;
- char _pad1[4];
+ float timeoffs, lifetime;
+ char _pad1[4];
} WaveModifierData;
/* WaveModifierData.flag */
enum {
- /* And what bout (1 << 0) flag? ;) */
- MOD_WAVE_X = (1 << 1),
- MOD_WAVE_Y = (1 << 2),
- MOD_WAVE_CYCL = (1 << 3),
- MOD_WAVE_NORM = (1 << 4),
- MOD_WAVE_NORM_X = (1 << 5),
- MOD_WAVE_NORM_Y = (1 << 6),
- MOD_WAVE_NORM_Z = (1 << 7),
+ /* And what bout (1 << 0) flag? ;) */
+ MOD_WAVE_X = (1 << 1),
+ MOD_WAVE_Y = (1 << 2),
+ MOD_WAVE_CYCL = (1 << 3),
+ MOD_WAVE_NORM = (1 << 4),
+ MOD_WAVE_NORM_X = (1 << 5),
+ MOD_WAVE_NORM_Y = (1 << 6),
+ MOD_WAVE_NORM_Z = (1 << 7),
};
typedef struct ArmatureModifierData {
- ModifierData modifier;
-
- /** Deformflag replaces armature->deformflag. */
- short deformflag, multi;
- char _pad2[4];
- struct Object *object;
- /** Stored input of previous modifier, for vertexgroup blending. */
- float *prevCos;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
+ ModifierData modifier;
+
+ /** Deformflag replaces armature->deformflag. */
+ short deformflag, multi;
+ char _pad2[4];
+ struct Object *object;
+ /** Stored input of previous modifier, for vertexgroup blending. */
+ float *prevCos;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
} ArmatureModifierData;
enum {
- MOD_HOOK_UNIFORM_SPACE = (1 << 0),
+ MOD_HOOK_UNIFORM_SPACE = (1 << 0),
};
/* same as WarpModifierFalloff */
typedef enum {
- eHook_Falloff_None = 0,
- eHook_Falloff_Curve = 1,
- eHook_Falloff_Sharp = 2, /* PROP_SHARP */
- eHook_Falloff_Smooth = 3, /* PROP_SMOOTH */
- eHook_Falloff_Root = 4, /* PROP_ROOT */
- eHook_Falloff_Linear = 5, /* PROP_LIN */
- eHook_Falloff_Const = 6, /* PROP_CONST */
- eHook_Falloff_Sphere = 7, /* PROP_SPHERE */
- eHook_Falloff_InvSquare = 8, /* PROP_INVSQUARE */
- /* PROP_RANDOM not used */
+ eHook_Falloff_None = 0,
+ eHook_Falloff_Curve = 1,
+ eHook_Falloff_Sharp = 2, /* PROP_SHARP */
+ eHook_Falloff_Smooth = 3, /* PROP_SMOOTH */
+ eHook_Falloff_Root = 4, /* PROP_ROOT */
+ eHook_Falloff_Linear = 5, /* PROP_LIN */
+ eHook_Falloff_Const = 6, /* PROP_CONST */
+ eHook_Falloff_Sphere = 7, /* PROP_SPHERE */
+ eHook_Falloff_InvSquare = 8, /* PROP_INVSQUARE */
+ /* PROP_RANDOM not used */
} HookModifierFalloff;
typedef struct HookModifierData {
- ModifierData modifier;
-
- struct Object *object;
- /** Optional name of bone target, MAX_ID_NAME-2. */
- char subtarget[64];
-
- char flag;
- /** Use enums from WarpModifier (exact same functionality). */
- char falloff_type;
- char _pad[6];
- /** Matrix making current transform unmodified. */
- float parentinv[4][4];
- /** Visualization of hook. */
- float cent[3];
- /** If not zero, falloff is distance where influence zero. */
- float falloff;
-
- struct CurveMapping *curfalloff;
-
- /** If NULL, it's using vertexgroup. */
- int *indexar;
- int totindex;
- float force;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char name[64];
+ ModifierData modifier;
+
+ struct Object *object;
+ /** Optional name of bone target, MAX_ID_NAME-2. */
+ char subtarget[64];
+
+ char flag;
+ /** Use enums from WarpModifier (exact same functionality). */
+ char falloff_type;
+ char _pad[6];
+ /** Matrix making current transform unmodified. */
+ float parentinv[4][4];
+ /** Visualization of hook. */
+ float cent[3];
+ /** If not zero, falloff is distance where influence zero. */
+ float falloff;
+
+ struct CurveMapping *curfalloff;
+
+ /** If NULL, it's using vertexgroup. */
+ int *indexar;
+ int totindex;
+ float force;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char name[64];
} HookModifierData;
typedef struct SoftbodyModifierData {
- ModifierData modifier;
+ ModifierData modifier;
} SoftbodyModifierData;
typedef struct ClothModifierData {
- ModifierData modifier;
-
- /** The internal data structure for cloth. */
- struct Cloth *clothObject;
- /** Definition is in DNA_cloth_types.h. */
- struct ClothSimSettings *sim_parms;
- /** Definition is in DNA_cloth_types.h. */
- struct ClothCollSettings *coll_parms;
-
- /* PointCache can be shared with other instances of ClothModifierData.
- * Inspect (modifier.flag & eModifierFlag_SharedCaches) to find out. */
- /** Definition is in DNA_object_force_types.h. */
- struct PointCache *point_cache;
- struct ListBase ptcaches;
-
- /* XXX nasty hack, remove once hair can be separated from cloth modifier data */
- struct ClothHairData *hairdata;
- /* grid geometry values of hair continuum */
- float hair_grid_min[3];
- float hair_grid_max[3];
- int hair_grid_res[3];
- float hair_grid_cellsize;
-
- struct ClothSolverResult *solver_result;
+ ModifierData modifier;
+
+ /** The internal data structure for cloth. */
+ struct Cloth *clothObject;
+ /** Definition is in DNA_cloth_types.h. */
+ struct ClothSimSettings *sim_parms;
+ /** Definition is in DNA_cloth_types.h. */
+ struct ClothCollSettings *coll_parms;
+
+ /* PointCache can be shared with other instances of ClothModifierData.
+ * Inspect (modifier.flag & eModifierFlag_SharedCaches) to find out. */
+ /** Definition is in DNA_object_force_types.h. */
+ struct PointCache *point_cache;
+ struct ListBase ptcaches;
+
+ /* XXX nasty hack, remove once hair can be separated from cloth modifier data */
+ struct ClothHairData *hairdata;
+ /* grid geometry values of hair continuum */
+ float hair_grid_min[3];
+ float hair_grid_max[3];
+ int hair_grid_res[3];
+ float hair_grid_cellsize;
+
+ struct ClothSolverResult *solver_result;
} ClothModifierData;
typedef struct CollisionModifierData {
- ModifierData modifier;
-
- /** Position at the beginning of the frame. */
- struct MVert *x;
- /** Position at the end of the frame. */
- struct MVert *xnew;
- /** Unused atm, but was discussed during sprint. */
- struct MVert *xold;
- /** New position at the actual inter-frame step. */
- struct MVert *current_xnew;
- /** Position at the actual inter-frame step. */
- struct MVert *current_x;
- /** (xnew - x) at the actual inter-frame step. */
- struct MVert *current_v;
-
- struct MVertTri *tri;
-
- unsigned int mvert_num;
- unsigned int tri_num;
- /** Cfra time of modifier. */
- float time_x, time_xnew;
- /** Collider doesn't move this frame, i.e. x[].co==xnew[].co. */
- char is_static;
- char _pad[7];
-
- /** Bounding volume hierarchy for this cloth object. */
- struct BVHTree *bvhtree;
+ ModifierData modifier;
+
+ /** Position at the beginning of the frame. */
+ struct MVert *x;
+ /** Position at the end of the frame. */
+ struct MVert *xnew;
+ /** Unused atm, but was discussed during sprint. */
+ struct MVert *xold;
+ /** New position at the actual inter-frame step. */
+ struct MVert *current_xnew;
+ /** Position at the actual inter-frame step. */
+ struct MVert *current_x;
+ /** (xnew - x) at the actual inter-frame step. */
+ struct MVert *current_v;
+
+ struct MVertTri *tri;
+
+ unsigned int mvert_num;
+ unsigned int tri_num;
+ /** Cfra time of modifier. */
+ float time_x, time_xnew;
+ /** Collider doesn't move this frame, i.e. x[].co==xnew[].co. */
+ char is_static;
+ char _pad[7];
+
+ /** Bounding volume hierarchy for this cloth object. */
+ struct BVHTree *bvhtree;
} CollisionModifierData;
typedef struct SurfaceModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /** Old position. */
- struct MVert *x;
- /** Velocity. */
- struct MVert *v;
+ /** Old position. */
+ struct MVert *x;
+ /** Velocity. */
+ struct MVert *v;
- struct Mesh *mesh;
+ struct Mesh *mesh;
- /** Bounding volume hierarchy of the mesh faces. */
- struct BVHTreeFromMesh *bvhtree;
+ /** Bounding volume hierarchy of the mesh faces. */
+ struct BVHTreeFromMesh *bvhtree;
- int cfra, numverts;
+ int cfra, numverts;
} SurfaceModifierData;
typedef struct BooleanModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- struct Object *object;
- char operation;
- char _pad[2];
- char bm_flag;
- float double_threshold;
+ struct Object *object;
+ char operation;
+ char _pad[2];
+ char bm_flag;
+ float double_threshold;
} BooleanModifierData;
typedef enum {
- eBooleanModifierOp_Intersect = 0,
- eBooleanModifierOp_Union = 1,
- eBooleanModifierOp_Difference = 2,
+ eBooleanModifierOp_Intersect = 0,
+ eBooleanModifierOp_Union = 1,
+ eBooleanModifierOp_Difference = 2,
} BooleanModifierOp;
/* bm_flag (only used when G_DEBUG) */
enum {
- eBooleanModifierBMeshFlag_BMesh_Separate = (1 << 0),
- eBooleanModifierBMeshFlag_BMesh_NoDissolve = (1 << 1),
- eBooleanModifierBMeshFlag_BMesh_NoConnectRegions = (1 << 2),
+ eBooleanModifierBMeshFlag_BMesh_Separate = (1 << 0),
+ eBooleanModifierBMeshFlag_BMesh_NoDissolve = (1 << 1),
+ eBooleanModifierBMeshFlag_BMesh_NoConnectRegions = (1 << 2),
};
typedef struct MDefInfluence {
- int vertex;
- float weight;
+ int vertex;
+ float weight;
} MDefInfluence;
typedef struct MDefCell {
- int offset;
- int totinfluence;
+ int offset;
+ int totinfluence;
} MDefCell;
typedef struct MeshDeformModifierData {
- ModifierData modifier;
-
- /** Mesh object. */
- struct Object *object;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char defgrp_name[64];
-
- short gridsize, flag;
- char _pad[4];
-
- /* result of static binding */
- /** Influences. */
- MDefInfluence *bindinfluences;
- /** Offsets into influences array. */
- int *bindoffsets;
- /** Coordinates that cage was bound with. */
- float *bindcagecos;
- /** Total vertices in mesh and cage. */
- int totvert, totcagevert;
-
- /* result of dynamic binding */
- /** Grid with dynamic binding cell points. */
- MDefCell *dyngrid;
- /** Dynamic binding vertex influences. */
- MDefInfluence *dyninfluences;
- /** Is this vertex bound or not?. */
- int *dynverts;
- /** Size of the dynamic bind grid. */
- int dyngridsize;
- /** Total number of vertex influences. */
- int totinfluence;
- /** Offset of the dynamic bind grid. */
- float dyncellmin[3];
- /** Width of dynamic bind cell. */
- float dyncellwidth;
- /** Matrix of cage at binding time. */
- float bindmat[4][4];
-
- /* deprecated storage */
- /** Deprecated inefficient storage. */
- float *bindweights;
- /** Deprecated storage of cage coords. */
- float *bindcos;
-
- /* runtime */
- void (*bindfunc)(struct MeshDeformModifierData *mmd, struct Mesh *cagemesh,
- float *vertexcos, int totvert, float cagemat[4][4]);
+ ModifierData modifier;
+
+ /** Mesh object. */
+ struct Object *object;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+
+ short gridsize, flag;
+ char _pad[4];
+
+ /* result of static binding */
+ /** Influences. */
+ MDefInfluence *bindinfluences;
+ /** Offsets into influences array. */
+ int *bindoffsets;
+ /** Coordinates that cage was bound with. */
+ float *bindcagecos;
+ /** Total vertices in mesh and cage. */
+ int totvert, totcagevert;
+
+ /* result of dynamic binding */
+ /** Grid with dynamic binding cell points. */
+ MDefCell *dyngrid;
+ /** Dynamic binding vertex influences. */
+ MDefInfluence *dyninfluences;
+ /** Is this vertex bound or not?. */
+ int *dynverts;
+ /** Size of the dynamic bind grid. */
+ int dyngridsize;
+ /** Total number of vertex influences. */
+ int totinfluence;
+ /** Offset of the dynamic bind grid. */
+ float dyncellmin[3];
+ /** Width of dynamic bind cell. */
+ float dyncellwidth;
+ /** Matrix of cage at binding time. */
+ float bindmat[4][4];
+
+ /* deprecated storage */
+ /** Deprecated inefficient storage. */
+ float *bindweights;
+ /** Deprecated storage of cage coords. */
+ float *bindcos;
+
+ /* runtime */
+ void (*bindfunc)(struct MeshDeformModifierData *mmd,
+ struct Mesh *cagemesh,
+ float *vertexcos,
+ int totvert,
+ float cagemat[4][4]);
} MeshDeformModifierData;
enum {
- MOD_MDEF_INVERT_VGROUP = (1 << 0),
- MOD_MDEF_DYNAMIC_BIND = (1 << 1),
+ MOD_MDEF_INVERT_VGROUP = (1 << 0),
+ MOD_MDEF_DYNAMIC_BIND = (1 << 1),
};
enum {
- MOD_MDEF_VOLUME = 0,
- MOD_MDEF_SURFACE = 1,
+ MOD_MDEF_VOLUME = 0,
+ MOD_MDEF_SURFACE = 1,
};
typedef struct ParticleSystemModifierData {
- ModifierData modifier;
-
- struct ParticleSystem *psys;
- /** Final Mesh - its topology may differ from orig mesh. */
- struct Mesh *mesh_final;
- /** Original mesh that particles are attached to. */
- struct Mesh *mesh_original;
- int totdmvert, totdmedge, totdmface;
- short flag;
- char _pad[2];
+ ModifierData modifier;
+
+ struct ParticleSystem *psys;
+ /** Final Mesh - its topology may differ from orig mesh. */
+ struct Mesh *mesh_final;
+ /** Original mesh that particles are attached to. */
+ struct Mesh *mesh_original;
+ int totdmvert, totdmedge, totdmface;
+ short flag;
+ char _pad[2];
} ParticleSystemModifierData;
typedef enum {
- eParticleSystemFlag_Pars = (1 << 0),
- eParticleSystemFlag_psys_updated = (1 << 1),
- eParticleSystemFlag_file_loaded = (1 << 2),
+ eParticleSystemFlag_Pars = (1 << 0),
+ eParticleSystemFlag_psys_updated = (1 << 1),
+ eParticleSystemFlag_file_loaded = (1 << 2),
} ParticleSystemModifierFlag;
typedef enum {
- eParticleInstanceFlag_Parents = (1 << 0),
- eParticleInstanceFlag_Children = (1 << 1),
- eParticleInstanceFlag_Path = (1 << 2),
- eParticleInstanceFlag_Unborn = (1 << 3),
- eParticleInstanceFlag_Alive = (1 << 4),
- eParticleInstanceFlag_Dead = (1 << 5),
- eParticleInstanceFlag_KeepShape = (1 << 6),
- eParticleInstanceFlag_UseSize = (1 << 7),
+ eParticleInstanceFlag_Parents = (1 << 0),
+ eParticleInstanceFlag_Children = (1 << 1),
+ eParticleInstanceFlag_Path = (1 << 2),
+ eParticleInstanceFlag_Unborn = (1 << 3),
+ eParticleInstanceFlag_Alive = (1 << 4),
+ eParticleInstanceFlag_Dead = (1 << 5),
+ eParticleInstanceFlag_KeepShape = (1 << 6),
+ eParticleInstanceFlag_UseSize = (1 << 7),
} ParticleInstanceModifierFlag;
typedef enum {
- eParticleInstanceSpace_World = 0,
- eParticleInstanceSpace_Local = 1,
+ eParticleInstanceSpace_World = 0,
+ eParticleInstanceSpace_Local = 1,
} ParticleInstanceModifierSpace;
typedef struct ParticleInstanceModifierData {
- ModifierData modifier;
-
- struct Object *ob;
- short psys, flag, axis, space;
- float position, random_position;
- float rotation, random_rotation;
- float particle_amount, particle_offset;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char index_layer_name[64];
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char value_layer_name[64];
+ ModifierData modifier;
+
+ struct Object *ob;
+ short psys, flag, axis, space;
+ float position, random_position;
+ float rotation, random_rotation;
+ float particle_amount, particle_offset;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char index_layer_name[64];
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char value_layer_name[64];
} ParticleInstanceModifierData;
typedef enum {
- eExplodeFlag_CalcFaces = (1 << 0),
- eExplodeFlag_PaSize = (1 << 1),
- eExplodeFlag_EdgeCut = (1 << 2),
- eExplodeFlag_Unborn = (1 << 3),
- eExplodeFlag_Alive = (1 << 4),
- eExplodeFlag_Dead = (1 << 5),
+ eExplodeFlag_CalcFaces = (1 << 0),
+ eExplodeFlag_PaSize = (1 << 1),
+ eExplodeFlag_EdgeCut = (1 << 2),
+ eExplodeFlag_Unborn = (1 << 3),
+ eExplodeFlag_Alive = (1 << 4),
+ eExplodeFlag_Dead = (1 << 5),
} ExplodeModifierFlag;
typedef struct ExplodeModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- int *facepa;
- short flag, vgroup;
- float protect;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvname[64];
+ int *facepa;
+ short flag, vgroup;
+ float protect;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvname[64];
} ExplodeModifierData;
typedef struct MultiresModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- char lvl, sculptlvl, renderlvl, totlvl;
- char simple, flags, _pad[2];
- short quality;
- short uv_smooth;
- char _pad2[4];
+ char lvl, sculptlvl, renderlvl, totlvl;
+ char simple, flags, _pad[2];
+ short quality;
+ short uv_smooth;
+ char _pad2[4];
} MultiresModifierData;
typedef enum {
- eMultiresModifierFlag_ControlEdges = (1 << 0),
- /* DEPRECATED, only used for versioning. */
- eMultiresModifierFlag_PlainUv_DEPRECATED = (1 << 1),
- eMultiresModifierFlag_UseCrease = (1 << 2),
+ eMultiresModifierFlag_ControlEdges = (1 << 0),
+ /* DEPRECATED, only used for versioning. */
+ eMultiresModifierFlag_PlainUv_DEPRECATED = (1 << 1),
+ eMultiresModifierFlag_UseCrease = (1 << 2),
} MultiresModifierFlag;
typedef struct FluidsimModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /** Definition is in DNA_object_fluidsim_types.h. */
- struct FluidsimSettings *fss;
+ /** Definition is in DNA_object_fluidsim_types.h. */
+ struct FluidsimSettings *fss;
} FluidsimModifierData;
typedef struct ShrinkwrapModifierData {
- ModifierData modifier;
-
- /** Shrink target. */
- struct Object *target;
- /** Additional shrink target. */
- struct Object *auxTarget;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgroup_name[64];
- /** Distance offset to keep from mesh/projection point. */
- float keepDist;
- /** Shrink type projection. */
- short shrinkType;
- /** Shrink options. */
- char shrinkOpts;
- /** Shrink to surface mode. */
- char shrinkMode;
- /** Limit the projection ray cast. */
- float projLimit;
- /** Axis to project over. */
- char projAxis;
-
- /** If using projection over vertex normal this controls the level of subsurface that must be
- * done before getting the vertex coordinates and normal
- */
- char subsurfLevels;
-
- char _pad[2];
+ ModifierData modifier;
+
+ /** Shrink target. */
+ struct Object *target;
+ /** Additional shrink target. */
+ struct Object *auxTarget;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgroup_name[64];
+ /** Distance offset to keep from mesh/projection point. */
+ float keepDist;
+ /** Shrink type projection. */
+ short shrinkType;
+ /** Shrink options. */
+ char shrinkOpts;
+ /** Shrink to surface mode. */
+ char shrinkMode;
+ /** Limit the projection ray cast. */
+ float projLimit;
+ /** Axis to project over. */
+ char projAxis;
+
+ /** If using projection over vertex normal this controls the level of subsurface that must be
+ * done before getting the vertex coordinates and normal
+ */
+ char subsurfLevels;
+
+ char _pad[2];
} ShrinkwrapModifierData;
/* Shrinkwrap->shrinkType */
enum {
- MOD_SHRINKWRAP_NEAREST_SURFACE = 0,
- MOD_SHRINKWRAP_PROJECT = 1,
- MOD_SHRINKWRAP_NEAREST_VERTEX = 2,
- MOD_SHRINKWRAP_TARGET_PROJECT = 3,
+ MOD_SHRINKWRAP_NEAREST_SURFACE = 0,
+ MOD_SHRINKWRAP_PROJECT = 1,
+ MOD_SHRINKWRAP_NEAREST_VERTEX = 2,
+ MOD_SHRINKWRAP_TARGET_PROJECT = 3,
};
/* Shrinkwrap->shrinkMode */
enum {
- /** 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,
+ /** 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,
};
/* Shrinkwrap->shrinkOpts */
enum {
- /** allow shrinkwrap to move the vertex in the positive direction of axis */
- MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR = (1 << 0),
- /** allow shrinkwrap to move the vertex in the negative direction of axis */
- MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR = (1 << 1),
+ /** allow shrinkwrap to move the vertex in the positive direction of axis */
+ MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR = (1 << 0),
+ /** allow shrinkwrap 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),
+ /** 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),
+ /** 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),
+ MOD_SHRINKWRAP_INVERT_VGROUP = (1 << 6),
+ MOD_SHRINKWRAP_INVERT_CULL_TARGET = (1 << 7),
};
-#define MOD_SHRINKWRAP_CULL_TARGET_MASK (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)
+#define MOD_SHRINKWRAP_CULL_TARGET_MASK \
+ (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)
/* Shrinkwrap->projAxis */
enum {
- /** 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),
+ /** 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),
};
-
typedef struct SimpleDeformModifierData {
- ModifierData modifier;
-
- /** Object to control the origin of modifier space coordinates. */
- struct Object *origin;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgroup_name[64];
- /** Factors to control simple deforms. */
- float factor;
- /** Lower and upper limit. */
- float limit[2];
-
- /** Deform function. */
- char mode;
- /** Lock axis (for taper and stretch). */
- char axis;
- /** Axis to perform the deform on (default is X, but can be overridden by origin. */
- char deform_axis;
- char flag;
+ ModifierData modifier;
+
+ /** Object to control the origin of modifier space coordinates. */
+ struct Object *origin;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgroup_name[64];
+ /** Factors to control simple deforms. */
+ float factor;
+ /** Lower and upper limit. */
+ float limit[2];
+
+ /** Deform function. */
+ char mode;
+ /** Lock axis (for taper and stretch). */
+ char axis;
+ /** Axis to perform the deform on (default is X, but can be overridden by origin. */
+ char deform_axis;
+ char flag;
} SimpleDeformModifierData;
/* SimpleDeform->flag */
enum {
- MOD_SIMPLEDEFORM_FLAG_INVERT_VGROUP = (1 << 0),
+ MOD_SIMPLEDEFORM_FLAG_INVERT_VGROUP = (1 << 0),
};
-
enum {
- MOD_SIMPLEDEFORM_MODE_TWIST = 1,
- MOD_SIMPLEDEFORM_MODE_BEND = 2,
- MOD_SIMPLEDEFORM_MODE_TAPER = 3,
- MOD_SIMPLEDEFORM_MODE_STRETCH = 4,
+ MOD_SIMPLEDEFORM_MODE_TWIST = 1,
+ MOD_SIMPLEDEFORM_MODE_BEND = 2,
+ MOD_SIMPLEDEFORM_MODE_TAPER = 3,
+ MOD_SIMPLEDEFORM_MODE_STRETCH = 4,
};
enum {
- MOD_SIMPLEDEFORM_LOCK_AXIS_X = (1 << 0),
- MOD_SIMPLEDEFORM_LOCK_AXIS_Y = (1 << 1),
- MOD_SIMPLEDEFORM_LOCK_AXIS_Z = (1 << 2),
+ MOD_SIMPLEDEFORM_LOCK_AXIS_X = (1 << 0),
+ MOD_SIMPLEDEFORM_LOCK_AXIS_Y = (1 << 1),
+ MOD_SIMPLEDEFORM_LOCK_AXIS_Z = (1 << 2),
};
typedef struct ShapeKeyModifierData {
- ModifierData modifier;
+ ModifierData modifier;
} ShapeKeyModifierData;
typedef struct SolidifyModifierData {
- ModifierData modifier;
-
- /** Name of vertex group to use, MAX_VGROUP_NAME. */
- char defgrp_name[64];
- /** New surface offset leve.l*/
- float offset;
- /** Midpoint of the offset . */
- float offset_fac;
- /** factor for the minimum weight to use when vgroups are used,
- * avoids 0.0 weights giving duplicate geometry */
- float offset_fac_vg;
- /** Clamp offset based on surrounding geometry. */
- float offset_clamp;
- char _pad[4];
- float crease_inner;
- float crease_outer;
- float crease_rim;
- int flag;
- short mat_ofs;
- short mat_ofs_rim;
+ ModifierData modifier;
+
+ /** Name of vertex group to use, MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ /** New surface offset leve.l*/
+ float offset;
+ /** Midpoint of the offset . */
+ float offset_fac;
+ /** factor for the minimum weight to use when vgroups are used,
+ * avoids 0.0 weights giving duplicate geometry */
+ float offset_fac_vg;
+ /** Clamp offset based on surrounding geometry. */
+ float offset_clamp;
+ char _pad[4];
+ float crease_inner;
+ float crease_outer;
+ float crease_rim;
+ int flag;
+ short mat_ofs;
+ short mat_ofs_rim;
} SolidifyModifierData;
enum {
- MOD_SOLIDIFY_RIM = (1 << 0),
- MOD_SOLIDIFY_EVEN = (1 << 1),
- MOD_SOLIDIFY_NORMAL_CALC = (1 << 2),
- MOD_SOLIDIFY_VGROUP_INV = (1 << 3),
+ MOD_SOLIDIFY_RIM = (1 << 0),
+ MOD_SOLIDIFY_EVEN = (1 << 1),
+ MOD_SOLIDIFY_NORMAL_CALC = (1 << 2),
+ MOD_SOLIDIFY_VGROUP_INV = (1 << 3),
#ifdef DNA_DEPRECATED
- MOD_SOLIDIFY_RIM_MATERIAL = (1 << 4), /* deprecated, used in do_versions */
+ MOD_SOLIDIFY_RIM_MATERIAL = (1 << 4), /* deprecated, used in do_versions */
#endif
- MOD_SOLIDIFY_FLIP = (1 << 5),
- MOD_SOLIDIFY_NOSHELL = (1 << 6),
+ MOD_SOLIDIFY_FLIP = (1 << 5),
+ MOD_SOLIDIFY_NOSHELL = (1 << 6),
};
typedef struct ScrewModifierData {
- ModifierData modifier;
-
- struct Object *ob_axis;
- unsigned int steps;
- unsigned int render_steps;
- unsigned int iter;
- float screw_ofs;
- float angle;
- float merge_dist;
- short flag;
- char axis;
- char _pad[5];
+ ModifierData modifier;
+
+ struct Object *ob_axis;
+ unsigned int steps;
+ unsigned int render_steps;
+ unsigned int iter;
+ float screw_ofs;
+ float angle;
+ float merge_dist;
+ short flag;
+ char axis;
+ char _pad[5];
} ScrewModifierData;
enum {
- MOD_SCREW_NORMAL_FLIP = (1 << 0),
- MOD_SCREW_NORMAL_CALC = (1 << 1),
- MOD_SCREW_OBJECT_OFFSET = (1 << 2),
-/* MOD_SCREW_OBJECT_ANGLE = (1 << 4), */
- MOD_SCREW_SMOOTH_SHADING = (1 << 5),
- MOD_SCREW_UV_STRETCH_U = (1 << 6),
- MOD_SCREW_UV_STRETCH_V = (1 << 7),
- MOD_SCREW_MERGE = (1 << 8),
+ MOD_SCREW_NORMAL_FLIP = (1 << 0),
+ MOD_SCREW_NORMAL_CALC = (1 << 1),
+ MOD_SCREW_OBJECT_OFFSET = (1 << 2),
+ /* MOD_SCREW_OBJECT_ANGLE = (1 << 4), */
+ MOD_SCREW_SMOOTH_SHADING = (1 << 5),
+ MOD_SCREW_UV_STRETCH_U = (1 << 6),
+ MOD_SCREW_UV_STRETCH_V = (1 << 7),
+ MOD_SCREW_MERGE = (1 << 8),
};
typedef struct OceanModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- struct Ocean *ocean;
- struct OceanCache *oceancache;
+ struct Ocean *ocean;
+ struct OceanCache *oceancache;
- int resolution;
- int spatial_size;
+ int resolution;
+ int spatial_size;
- float wind_velocity;
+ float wind_velocity;
- float damp;
- float smallest_wave;
- float depth;
+ float damp;
+ float smallest_wave;
+ float depth;
- float wave_alignment;
- float wave_direction;
- float wave_scale;
+ float wave_alignment;
+ float wave_direction;
+ float wave_scale;
- float chop_amount;
- float foam_coverage;
- float time;
+ float chop_amount;
+ float foam_coverage;
+ float time;
- int bakestart;
- int bakeend;
+ int bakestart;
+ int bakeend;
- /** FILE_MAX. */
- char cachepath[1024];
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char foamlayername[64];
- char cached;
- char geometry_mode;
+ /** FILE_MAX. */
+ char cachepath[1024];
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char foamlayername[64];
+ char cached;
+ char geometry_mode;
- char flag;
- char _pad2;
+ char flag;
+ char _pad2;
- short repeat_x;
- short repeat_y;
+ short repeat_x;
+ short repeat_y;
- int seed;
+ int seed;
- float size;
+ float size;
- float foam_fade;
+ float foam_fade;
- char _pad[4];
+ char _pad[4];
} OceanModifierData;
enum {
- MOD_OCEAN_GEOM_GENERATE = 0,
- MOD_OCEAN_GEOM_DISPLACE = 1,
- MOD_OCEAN_GEOM_SIM_ONLY = 2,
+ MOD_OCEAN_GEOM_GENERATE = 0,
+ MOD_OCEAN_GEOM_DISPLACE = 1,
+ MOD_OCEAN_GEOM_SIM_ONLY = 2,
};
-
enum {
- MOD_OCEAN_GENERATE_FOAM = (1 << 0),
- MOD_OCEAN_GENERATE_NORMALS = (1 << 1),
+ MOD_OCEAN_GENERATE_FOAM = (1 << 0),
+ MOD_OCEAN_GENERATE_NORMALS = (1 << 1),
};
typedef struct WarpModifierData {
- ModifierData modifier;
- /* keep in sync with MappingInfoModifierData */
- struct Tex *texture;
- struct Object *map_object;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- int uvlayer_tmp;
- int texmapping;
- /* end MappingInfoModifierData */
-
- struct Object *object_from;
- struct Object *object_to;
- struct CurveMapping *curfalloff;
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char defgrp_name[64];
- float strength;
- float falloff_radius;
- /** Not used yet. */
- char flag;
- char falloff_type;
- char _pad[6];
+ ModifierData modifier;
+ /* keep in sync with MappingInfoModifierData */
+ struct Tex *texture;
+ struct Object *map_object;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ int uvlayer_tmp;
+ int texmapping;
+ /* end MappingInfoModifierData */
+
+ struct Object *object_from;
+ struct Object *object_to;
+ struct CurveMapping *curfalloff;
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ float strength;
+ float falloff_radius;
+ /** Not used yet. */
+ char flag;
+ char falloff_type;
+ char _pad[6];
} WarpModifierData;
#define MOD_WARP_VOLUME_PRESERVE 1
typedef enum {
- eWarp_Falloff_None = 0,
- eWarp_Falloff_Curve = 1,
- eWarp_Falloff_Sharp = 2, /* PROP_SHARP */
- eWarp_Falloff_Smooth = 3, /* PROP_SMOOTH */
- eWarp_Falloff_Root = 4, /* PROP_ROOT */
- eWarp_Falloff_Linear = 5, /* PROP_LIN */
- eWarp_Falloff_Const = 6, /* PROP_CONST */
- eWarp_Falloff_Sphere = 7, /* PROP_SPHERE */
- eWarp_Falloff_InvSquare = 8, /* PROP_INVSQUARE */
- /* PROP_RANDOM not used */
+ eWarp_Falloff_None = 0,
+ eWarp_Falloff_Curve = 1,
+ eWarp_Falloff_Sharp = 2, /* PROP_SHARP */
+ eWarp_Falloff_Smooth = 3, /* PROP_SMOOTH */
+ eWarp_Falloff_Root = 4, /* PROP_ROOT */
+ eWarp_Falloff_Linear = 5, /* PROP_LIN */
+ eWarp_Falloff_Const = 6, /* PROP_CONST */
+ eWarp_Falloff_Sphere = 7, /* PROP_SPHERE */
+ eWarp_Falloff_InvSquare = 8, /* PROP_INVSQUARE */
+ /* PROP_RANDOM not used */
} WarpModifierFalloff;
typedef struct WeightVGEditModifierData {
- ModifierData modifier;
-
- /** Name of vertex group to edit. MAX_VGROUP_NAME. */
- char defgrp_name[64];
-
- /** Using MOD_WVG_EDIT_* flags. */
- short edit_flags;
- /** Using MOD_WVG_MAPPING_* defines. */
- short falloff_type;
- /** Weight for vertices not in vgroup. */
- float default_weight;
-
- /* Mapping stuff. */
- /** The custom mapping curve!. */
- struct CurveMapping *cmap_curve;
-
- /* The add/remove vertices weight thresholds. */
- float add_threshold, rem_threshold;
-
- /* Masking options. */
- /** The global "influence", if no vgroup nor tex is used as mask. */
- float mask_constant;
- /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */
- char mask_defgrp_name[64];
-
- /* Texture masking. */
- /** Which channel to use as weightf. */
- int mask_tex_use_channel;
- /** The texture. */
- struct Tex *mask_texture;
- /** Name of the map object. */
- struct Object *mask_tex_map_obj;
- /** How to map the texture (using MOD_DISP_MAP_* enums). */
- int mask_tex_mapping;
- /** Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */
- char mask_tex_uvlayer_name[64];
-
- /* Padding... */
- char _pad0[4];
+ ModifierData modifier;
+
+ /** Name of vertex group to edit. MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+
+ /** Using MOD_WVG_EDIT_* flags. */
+ short edit_flags;
+ /** Using MOD_WVG_MAPPING_* defines. */
+ short falloff_type;
+ /** Weight for vertices not in vgroup. */
+ float default_weight;
+
+ /* Mapping stuff. */
+ /** The custom mapping curve!. */
+ struct CurveMapping *cmap_curve;
+
+ /* The add/remove vertices weight thresholds. */
+ float add_threshold, rem_threshold;
+
+ /* Masking options. */
+ /** The global "influence", if no vgroup nor tex is used as mask. */
+ float mask_constant;
+ /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */
+ char mask_defgrp_name[64];
+
+ /* Texture masking. */
+ /** Which channel to use as weightf. */
+ int mask_tex_use_channel;
+ /** The texture. */
+ struct Tex *mask_texture;
+ /** Name of the map object. */
+ struct Object *mask_tex_map_obj;
+ /** How to map the texture (using MOD_DISP_MAP_* enums). */
+ int mask_tex_mapping;
+ /** Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */
+ char mask_tex_uvlayer_name[64];
+
+ /* Padding... */
+ char _pad0[4];
} WeightVGEditModifierData;
/* WeightVGEdit flags. */
enum {
- /* (1 << 0), (1 << 1) and (1 << 2) are free for future use! */
- /** Add vertices with higher weight than threshold to vgroup. */
- MOD_WVG_EDIT_ADD2VG = (1 << 3),
- /** Remove vertices with lower weight than threshold from vgroup. */
- MOD_WVG_EDIT_REMFVG = (1 << 4),
+ /* (1 << 0), (1 << 1) and (1 << 2) are free for future use! */
+ /** Add vertices with higher weight than threshold to vgroup. */
+ MOD_WVG_EDIT_ADD2VG = (1 << 3),
+ /** Remove vertices with lower weight than threshold from vgroup. */
+ MOD_WVG_EDIT_REMFVG = (1 << 4),
};
typedef struct WeightVGMixModifierData {
- ModifierData modifier;
-
- /** Name of vertex group to modify/weight. MAX_VGROUP_NAME. */
- char defgrp_name_a[64];
- /** Name of other vertex group to mix in. MAX_VGROUP_NAME. */
- char defgrp_name_b[64];
- /** Default weight value for first vgroup. */
- float default_weight_a;
- /** Default weight value to mix in. */
- float default_weight_b;
- /** How second vgroups weights affect first ones. */
- char mix_mode;
- /** What vertices to affect. */
- char mix_set;
-
- char _pad0[6];
-
- /* Masking options. */
- /** The global "influence", if no vgroup nor tex is used as mask. */
- float mask_constant;
- /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */
- char mask_defgrp_name[64];
-
- /* Texture masking. */
- /** Which channel to use as weightf. */
- int mask_tex_use_channel;
- /** The texture. */
- struct Tex *mask_texture;
- /** Name of the map object. */
- struct Object *mask_tex_map_obj;
- /** How to map the texture!. */
- int mask_tex_mapping;
- /** Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */
- char mask_tex_uvlayer_name[64];
-
- /* Padding... */
- char _pad1[4];
+ ModifierData modifier;
+
+ /** Name of vertex group to modify/weight. MAX_VGROUP_NAME. */
+ char defgrp_name_a[64];
+ /** Name of other vertex group to mix in. MAX_VGROUP_NAME. */
+ char defgrp_name_b[64];
+ /** Default weight value for first vgroup. */
+ float default_weight_a;
+ /** Default weight value to mix in. */
+ float default_weight_b;
+ /** How second vgroups weights affect first ones. */
+ char mix_mode;
+ /** What vertices to affect. */
+ char mix_set;
+
+ char _pad0[6];
+
+ /* Masking options. */
+ /** The global "influence", if no vgroup nor tex is used as mask. */
+ float mask_constant;
+ /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */
+ char mask_defgrp_name[64];
+
+ /* Texture masking. */
+ /** Which channel to use as weightf. */
+ int mask_tex_use_channel;
+ /** The texture. */
+ struct Tex *mask_texture;
+ /** Name of the map object. */
+ struct Object *mask_tex_map_obj;
+ /** How to map the texture!. */
+ int mask_tex_mapping;
+ /** Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */
+ char mask_tex_uvlayer_name[64];
+
+ /* Padding... */
+ char _pad1[4];
} WeightVGMixModifierData;
/* How second vgroup's weights affect first ones. */
enum {
- /** Second weights replace weights. */
- MOD_WVG_MIX_SET = 1,
- /** Second weights are added to weights. */
- MOD_WVG_MIX_ADD = 2,
- /** Second weights are subtracted from weights. */
- MOD_WVG_MIX_SUB = 3,
- /** Second weights are multiplied with weights. */
- MOD_WVG_MIX_MUL = 4,
- /** Second weights divide weights. */
- MOD_WVG_MIX_DIV = 5,
- /** Difference between second weights and weights. */
- MOD_WVG_MIX_DIF = 6,
- /** Average of both weights. */
- MOD_WVG_MIX_AVG = 7,
+ /** Second weights replace weights. */
+ MOD_WVG_MIX_SET = 1,
+ /** Second weights are added to weights. */
+ MOD_WVG_MIX_ADD = 2,
+ /** Second weights are subtracted from weights. */
+ MOD_WVG_MIX_SUB = 3,
+ /** Second weights are multiplied with weights. */
+ MOD_WVG_MIX_MUL = 4,
+ /** Second weights divide weights. */
+ MOD_WVG_MIX_DIV = 5,
+ /** Difference between second weights and weights. */
+ MOD_WVG_MIX_DIF = 6,
+ /** Average of both weights. */
+ MOD_WVG_MIX_AVG = 7,
};
/* What vertices to affect. */
enum {
- /** Affect all vertices. */
- MOD_WVG_SET_ALL = 1,
- /** Affect only vertices in first vgroup. */
- MOD_WVG_SET_A = 2,
- /** Affect only vertices in second vgroup. */
- MOD_WVG_SET_B = 3,
- /** Affect only vertices in one vgroup or the other. */
- MOD_WVG_SET_OR = 4,
- /** Affect only vertices in both vgroups. */
- MOD_WVG_SET_AND = 5,
+ /** Affect all vertices. */
+ MOD_WVG_SET_ALL = 1,
+ /** Affect only vertices in first vgroup. */
+ MOD_WVG_SET_A = 2,
+ /** Affect only vertices in second vgroup. */
+ MOD_WVG_SET_B = 3,
+ /** Affect only vertices in one vgroup or the other. */
+ MOD_WVG_SET_OR = 4,
+ /** Affect only vertices in both vgroups. */
+ MOD_WVG_SET_AND = 5,
};
typedef struct WeightVGProximityModifierData {
- ModifierData modifier;
-
- /** Name of vertex group to modify/weight. MAX_VGROUP_NAME. */
- char defgrp_name[64];
-
- /* Proximity modes. */
- int proximity_mode;
- int proximity_flags;
-
- /* Target object from which to calculate vertices distances. */
- struct Object *proximity_ob_target;
-
- /* Masking options. */
- /** The global "influence", if no vgroup nor tex is used as mask. */
- float mask_constant;
- /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */
- char mask_defgrp_name[64];
-
- /* Texture masking. */
- /** Which channel to use as weightf. */
- int mask_tex_use_channel;
- /** The texture. */
- struct Tex *mask_texture;
- /** Name of the map object. */
- struct Object *mask_tex_map_obj;
- /** How to map the texture!. */
- int mask_tex_mapping;
- /** Name of the UV Map. MAX_CUSTOMDATA_LAYER_NAME. */
- char mask_tex_uvlayer_name[64];
-
- /** Distances mapping to 0.0/1.0 weights. */
- float min_dist, max_dist;
-
- /* Put here to avoid breaking existing struct... */
- /** Using MOD_WVG_MAPPING_* enums. */
- short falloff_type;
-
- /* Padding... */
- char _pad0[2];
+ ModifierData modifier;
+
+ /** Name of vertex group to modify/weight. MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+
+ /* Proximity modes. */
+ int proximity_mode;
+ int proximity_flags;
+
+ /* Target object from which to calculate vertices distances. */
+ struct Object *proximity_ob_target;
+
+ /* Masking options. */
+ /** The global "influence", if no vgroup nor tex is used as mask. */
+ float mask_constant;
+ /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */
+ char mask_defgrp_name[64];
+
+ /* Texture masking. */
+ /** Which channel to use as weightf. */
+ int mask_tex_use_channel;
+ /** The texture. */
+ struct Tex *mask_texture;
+ /** Name of the map object. */
+ struct Object *mask_tex_map_obj;
+ /** How to map the texture!. */
+ int mask_tex_mapping;
+ /** Name of the UV Map. MAX_CUSTOMDATA_LAYER_NAME. */
+ char mask_tex_uvlayer_name[64];
+
+ /** Distances mapping to 0.0/1.0 weights. */
+ float min_dist, max_dist;
+
+ /* Put here to avoid breaking existing struct... */
+ /** Using MOD_WVG_MAPPING_* enums. */
+ short falloff_type;
+
+ /* Padding... */
+ char _pad0[2];
} WeightVGProximityModifierData;
/* Modes of proximity weighting. */
enum {
- MOD_WVG_PROXIMITY_OBJECT = 1, /* source vertex to other location */
- MOD_WVG_PROXIMITY_GEOMETRY = 2, /* source vertex to other geometry */
+ MOD_WVG_PROXIMITY_OBJECT = 1, /* source vertex to other location */
+ MOD_WVG_PROXIMITY_GEOMETRY = 2, /* source vertex to other geometry */
};
/* Flags options for proximity weighting. */
enum {
- /* Use nearest vertices of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
- MOD_WVG_PROXIMITY_GEOM_VERTS = (1 << 0),
- /* Use nearest edges of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
- MOD_WVG_PROXIMITY_GEOM_EDGES = (1 << 1),
- /* Use nearest faces of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
- MOD_WVG_PROXIMITY_GEOM_FACES = (1 << 2),
+ /* Use nearest vertices of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
+ MOD_WVG_PROXIMITY_GEOM_VERTS = (1 << 0),
+ /* Use nearest edges of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
+ MOD_WVG_PROXIMITY_GEOM_EDGES = (1 << 1),
+ /* Use nearest faces of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
+ MOD_WVG_PROXIMITY_GEOM_FACES = (1 << 2),
};
/* Defines common to all WeightVG modifiers. */
/* Mapping modes. */
enum {
- MOD_WVG_MAPPING_NONE = 0,
- MOD_WVG_MAPPING_CURVE = 1,
- MOD_WVG_MAPPING_SHARP = 2, /* PROP_SHARP */
- MOD_WVG_MAPPING_SMOOTH = 3, /* PROP_SMOOTH */
- MOD_WVG_MAPPING_ROOT = 4, /* PROP_ROOT */
- /* PROP_LIN not used (same as NONE, here...). */
- /* PROP_CONST not used. */
- MOD_WVG_MAPPING_SPHERE = 7, /* PROP_SPHERE */
- MOD_WVG_MAPPING_RANDOM = 8, /* PROP_RANDOM */
- MOD_WVG_MAPPING_STEP = 9, /* Median Step. */
+ MOD_WVG_MAPPING_NONE = 0,
+ MOD_WVG_MAPPING_CURVE = 1,
+ MOD_WVG_MAPPING_SHARP = 2, /* PROP_SHARP */
+ MOD_WVG_MAPPING_SMOOTH = 3, /* PROP_SMOOTH */
+ MOD_WVG_MAPPING_ROOT = 4, /* PROP_ROOT */
+ /* PROP_LIN not used (same as NONE, here...). */
+ /* PROP_CONST not used. */
+ MOD_WVG_MAPPING_SPHERE = 7, /* PROP_SPHERE */
+ MOD_WVG_MAPPING_RANDOM = 8, /* PROP_RANDOM */
+ MOD_WVG_MAPPING_STEP = 9, /* Median Step. */
};
/* Tex channel to be used as mask. */
enum {
- MOD_WVG_MASK_TEX_USE_INT = 1,
- MOD_WVG_MASK_TEX_USE_RED = 2,
- MOD_WVG_MASK_TEX_USE_GREEN = 3,
- MOD_WVG_MASK_TEX_USE_BLUE = 4,
- MOD_WVG_MASK_TEX_USE_HUE = 5,
- MOD_WVG_MASK_TEX_USE_SAT = 6,
- MOD_WVG_MASK_TEX_USE_VAL = 7,
- MOD_WVG_MASK_TEX_USE_ALPHA = 8,
+ MOD_WVG_MASK_TEX_USE_INT = 1,
+ MOD_WVG_MASK_TEX_USE_RED = 2,
+ MOD_WVG_MASK_TEX_USE_GREEN = 3,
+ MOD_WVG_MASK_TEX_USE_BLUE = 4,
+ MOD_WVG_MASK_TEX_USE_HUE = 5,
+ MOD_WVG_MASK_TEX_USE_SAT = 6,
+ MOD_WVG_MASK_TEX_USE_VAL = 7,
+ MOD_WVG_MASK_TEX_USE_ALPHA = 8,
};
typedef struct DynamicPaintModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- struct DynamicPaintCanvasSettings *canvas;
- struct DynamicPaintBrushSettings *brush;
- /** UI display: canvas / brush. */
- int type;
- char _pad[4];
+ struct DynamicPaintCanvasSettings *canvas;
+ struct DynamicPaintBrushSettings *brush;
+ /** UI display: canvas / brush. */
+ int type;
+ char _pad[4];
} DynamicPaintModifierData;
/* Dynamic paint modifier flags */
enum {
- MOD_DYNAMICPAINT_TYPE_CANVAS = (1 << 0),
- MOD_DYNAMICPAINT_TYPE_BRUSH = (1 << 1),
+ MOD_DYNAMICPAINT_TYPE_CANVAS = (1 << 0),
+ MOD_DYNAMICPAINT_TYPE_BRUSH = (1 << 1),
};
/* Remesh modifier */
typedef enum eRemeshModifierFlags {
- MOD_REMESH_FLOOD_FILL = (1 << 0),
- MOD_REMESH_SMOOTH_SHADING = (1 << 1),
+ MOD_REMESH_FLOOD_FILL = (1 << 0),
+ MOD_REMESH_SMOOTH_SHADING = (1 << 1),
} RemeshModifierFlags;
typedef enum eRemeshModifierMode {
- /* blocky */
- MOD_REMESH_CENTROID = 0,
- /* smooth */
- MOD_REMESH_MASS_POINT = 1,
- /* keeps sharp edges */
- MOD_REMESH_SHARP_FEATURES = 2,
+ /* blocky */
+ MOD_REMESH_CENTROID = 0,
+ /* smooth */
+ MOD_REMESH_MASS_POINT = 1,
+ /* keeps sharp edges */
+ MOD_REMESH_SHARP_FEATURES = 2,
} eRemeshModifierMode;
typedef struct RemeshModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /* floodfill option, controls how small components can be before they are removed */
- float threshold;
+ /* floodfill option, controls how small components can be before they are removed */
+ float threshold;
- /* ratio between size of model and grid */
- float scale;
+ /* ratio between size of model and grid */
+ float scale;
- float hermite_num;
+ float hermite_num;
- /* octree depth */
- char depth;
+ /* octree depth */
+ char depth;
- char flag;
- char mode;
- char _pad;
+ char flag;
+ char mode;
+ char _pad;
} RemeshModifierData;
/* Skin modifier */
typedef struct SkinModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- float branch_smoothing;
+ float branch_smoothing;
- char flag;
+ char flag;
- char symmetry_axes;
+ char symmetry_axes;
- char _pad[2];
+ char _pad[2];
} SkinModifierData;
/* SkinModifierData.symmetry_axes */
enum {
- MOD_SKIN_SYMM_X = (1 << 0),
- MOD_SKIN_SYMM_Y = (1 << 1),
- MOD_SKIN_SYMM_Z = (1 << 2),
+ MOD_SKIN_SYMM_X = (1 << 0),
+ MOD_SKIN_SYMM_Y = (1 << 1),
+ MOD_SKIN_SYMM_Z = (1 << 2),
};
/* SkinModifierData.flag */
enum {
- MOD_SKIN_SMOOTH_SHADING = 1,
+ MOD_SKIN_SMOOTH_SHADING = 1,
};
/* Triangulate modifier */
typedef struct TriangulateModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- int flag;
- int quad_method;
- int ngon_method;
- int min_vertices;
+ int flag;
+ int quad_method;
+ int ngon_method;
+ int min_vertices;
} TriangulateModifierData;
/* TriangulateModifierData.flag */
enum {
#ifdef DNA_DEPRECATED
- MOD_TRIANGULATE_BEAUTY = (1 << 0), /* deprecated */
+ MOD_TRIANGULATE_BEAUTY = (1 << 0), /* deprecated */
#endif
- MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS = 1 << 1,
+ MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS = 1 << 1,
};
/* Triangulate methods - NGons */
enum {
- MOD_TRIANGULATE_NGON_BEAUTY = 0,
- MOD_TRIANGULATE_NGON_EARCLIP,
+ MOD_TRIANGULATE_NGON_BEAUTY = 0,
+ MOD_TRIANGULATE_NGON_EARCLIP,
};
/* Triangulate methods - Quads */
enum {
- MOD_TRIANGULATE_QUAD_BEAUTY = 0,
- MOD_TRIANGULATE_QUAD_FIXED,
- MOD_TRIANGULATE_QUAD_ALTERNATE,
- MOD_TRIANGULATE_QUAD_SHORTEDGE,
+ MOD_TRIANGULATE_QUAD_BEAUTY = 0,
+ MOD_TRIANGULATE_QUAD_FIXED,
+ MOD_TRIANGULATE_QUAD_ALTERNATE,
+ MOD_TRIANGULATE_QUAD_SHORTEDGE,
};
typedef struct LaplacianSmoothModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- float lambda, lambda_border;
- char _pad1[4];
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- short flag, repeat;
+ float lambda, lambda_border;
+ char _pad1[4];
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ short flag, repeat;
} LaplacianSmoothModifierData;
/* Smooth modifier flags */
enum {
- MOD_LAPLACIANSMOOTH_X = (1 << 1),
- MOD_LAPLACIANSMOOTH_Y = (1 << 2),
- MOD_LAPLACIANSMOOTH_Z = (1 << 3),
- MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME = (1 << 4),
- MOD_LAPLACIANSMOOTH_NORMALIZED = (1 << 5),
+ MOD_LAPLACIANSMOOTH_X = (1 << 1),
+ MOD_LAPLACIANSMOOTH_Y = (1 << 2),
+ MOD_LAPLACIANSMOOTH_Z = (1 << 3),
+ MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME = (1 << 4),
+ MOD_LAPLACIANSMOOTH_NORMALIZED = (1 << 5),
};
-
typedef struct CorrectiveSmoothModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /* positions set during 'bind' operator
- * use for MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND */
- float (*bind_coords)[3];
+ /* positions set during 'bind' operator
+ * use for MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND */
+ float (*bind_coords)[3];
- /* note: -1 is used to bind */
- unsigned int bind_coords_num;
+ /* note: -1 is used to bind */
+ unsigned int bind_coords_num;
- float lambda;
- short repeat, flag;
- char smooth_type, rest_source;
- char _pad[2];
+ float lambda;
+ short repeat, flag;
+ char smooth_type, rest_source;
+ char _pad[2];
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
- /* runtime-only cache (delta's between),
- * delta's between the original positions and the smoothed positions */
- float (*delta_cache)[3];
- unsigned int delta_cache_num;
- char _pad2[4];
+ /* runtime-only cache (delta's between),
+ * delta's between the original positions and the smoothed positions */
+ float (*delta_cache)[3];
+ unsigned int delta_cache_num;
+ char _pad2[4];
} CorrectiveSmoothModifierData;
enum {
- MOD_CORRECTIVESMOOTH_SMOOTH_SIMPLE = 0,
- MOD_CORRECTIVESMOOTH_SMOOTH_LENGTH_WEIGHT = 1,
+ MOD_CORRECTIVESMOOTH_SMOOTH_SIMPLE = 0,
+ MOD_CORRECTIVESMOOTH_SMOOTH_LENGTH_WEIGHT = 1,
};
enum {
- MOD_CORRECTIVESMOOTH_RESTSOURCE_ORCO = 0,
- MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND = 1,
+ MOD_CORRECTIVESMOOTH_RESTSOURCE_ORCO = 0,
+ MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND = 1,
};
/* Corrective Smooth modifier flags */
enum {
- MOD_CORRECTIVESMOOTH_INVERT_VGROUP = (1 << 0),
- MOD_CORRECTIVESMOOTH_ONLY_SMOOTH = (1 << 1),
- MOD_CORRECTIVESMOOTH_PIN_BOUNDARY = (1 << 2),
+ MOD_CORRECTIVESMOOTH_INVERT_VGROUP = (1 << 0),
+ MOD_CORRECTIVESMOOTH_ONLY_SMOOTH = (1 << 1),
+ MOD_CORRECTIVESMOOTH_PIN_BOUNDARY = (1 << 2),
};
typedef struct UVWarpModifierData {
- ModifierData modifier;
-
- char axis_u, axis_v;
- char _pad[6];
- /** Used for rotate/scale. */
- float center[2];
-
- /** Source. */
- struct Object *object_src;
- /** Optional name of bone target, MAX_ID_NAME-2. */
- char bone_src[64];
- /** Target. */
- struct Object *object_dst;
- /** Optional name of bone target, MAX_ID_NAME-2. */
- char bone_dst[64];
-
- /** Optional vertexgroup name, MAX_VGROUP_NAME. */
- char vgroup_name[64];
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
+ ModifierData modifier;
+
+ char axis_u, axis_v;
+ char _pad[6];
+ /** Used for rotate/scale. */
+ float center[2];
+
+ /** Source. */
+ struct Object *object_src;
+ /** Optional name of bone target, MAX_ID_NAME-2. */
+ char bone_src[64];
+ /** Target. */
+ struct Object *object_dst;
+ /** Optional name of bone target, MAX_ID_NAME-2. */
+ char bone_dst[64];
+
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgroup_name[64];
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
} UVWarpModifierData;
/* cache modifier */
typedef struct MeshCacheModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- char flag;
- /** File format. */
- char type;
- char time_mode;
- char play_mode;
+ char flag;
+ /** File format. */
+ char type;
+ char time_mode;
+ char play_mode;
- /* axis conversion */
- char forward_axis;
- char up_axis;
- char flip_axis;
+ /* axis conversion */
+ char forward_axis;
+ char up_axis;
+ char flip_axis;
- char interp;
+ char interp;
- float factor;
- char deform_mode;
- char _pad[7];
+ float factor;
+ char deform_mode;
+ char _pad[7];
- /* play_mode == MOD_MESHCACHE_PLAY_CFEA */
- float frame_start;
- float frame_scale;
+ /* play_mode == MOD_MESHCACHE_PLAY_CFEA */
+ float frame_start;
+ float frame_scale;
- /* play_mode == MOD_MESHCACHE_PLAY_EVAL */
- /* we could use one float for all these but their purpose is very different */
- float eval_frame;
- float eval_time;
- float eval_factor;
+ /* play_mode == MOD_MESHCACHE_PLAY_EVAL */
+ /* we could use one float for all these but their purpose is very different */
+ float eval_frame;
+ float eval_time;
+ float eval_factor;
- /** FILE_MAX. */
- char filepath[1024];
+ /** FILE_MAX. */
+ char filepath[1024];
} MeshCacheModifierData;
enum {
- MOD_MESHCACHE_TYPE_MDD = 1,
- MOD_MESHCACHE_TYPE_PC2 = 2,
+ MOD_MESHCACHE_TYPE_MDD = 1,
+ MOD_MESHCACHE_TYPE_PC2 = 2,
};
enum {
- MOD_MESHCACHE_DEFORM_OVERWRITE = 0,
- MOD_MESHCACHE_DEFORM_INTEGRATE = 1,
+ MOD_MESHCACHE_DEFORM_OVERWRITE = 0,
+ MOD_MESHCACHE_DEFORM_INTEGRATE = 1,
};
enum {
- MOD_MESHCACHE_INTERP_NONE = 0,
- MOD_MESHCACHE_INTERP_LINEAR = 1,
-/* MOD_MESHCACHE_INTERP_CARDINAL = 2, */
+ MOD_MESHCACHE_INTERP_NONE = 0,
+ MOD_MESHCACHE_INTERP_LINEAR = 1,
+ /* MOD_MESHCACHE_INTERP_CARDINAL = 2, */
};
enum {
- MOD_MESHCACHE_TIME_FRAME = 0,
- MOD_MESHCACHE_TIME_SECONDS = 1,
- MOD_MESHCACHE_TIME_FACTOR = 2,
+ MOD_MESHCACHE_TIME_FRAME = 0,
+ MOD_MESHCACHE_TIME_SECONDS = 1,
+ MOD_MESHCACHE_TIME_FACTOR = 2,
};
enum {
- MOD_MESHCACHE_PLAY_CFEA = 0,
- MOD_MESHCACHE_PLAY_EVAL = 1,
+ MOD_MESHCACHE_PLAY_CFEA = 0,
+ MOD_MESHCACHE_PLAY_EVAL = 1,
};
-
typedef struct LaplacianDeformModifierData {
- ModifierData modifier;
- /** MAX_VGROUP_NAME. */
- char anchor_grp_name[64];
- int total_verts, repeat;
- float *vertexco;
- /** Runtime only. */
- void *cache_system;
- short flag;
- char _pad[6];
+ ModifierData modifier;
+ /** MAX_VGROUP_NAME. */
+ char anchor_grp_name[64];
+ int total_verts, repeat;
+ float *vertexco;
+ /** Runtime only. */
+ void *cache_system;
+ short flag;
+ char _pad[6];
} LaplacianDeformModifierData;
/* Laplacian Deform modifier flags */
enum {
- MOD_LAPLACIANDEFORM_BIND = 1 << 0,
+ MOD_LAPLACIANDEFORM_BIND = 1 << 0,
};
/* many of these options match 'solidify' */
typedef struct WireframeModifierData {
- ModifierData modifier;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- float offset;
- float offset_fac;
- float offset_fac_vg;
- float crease_weight;
- short flag, mat_ofs;
- char _pad[4];
+ ModifierData modifier;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ float offset;
+ float offset_fac;
+ float offset_fac_vg;
+ float crease_weight;
+ short flag, mat_ofs;
+ char _pad[4];
} WireframeModifierData;
enum {
- MOD_WIREFRAME_INVERT_VGROUP = (1 << 0),
- MOD_WIREFRAME_REPLACE = (1 << 1),
- MOD_WIREFRAME_BOUNDARY = (1 << 2),
- MOD_WIREFRAME_OFS_EVEN = (1 << 3),
- MOD_WIREFRAME_OFS_RELATIVE = (1 << 4),
- MOD_WIREFRAME_CREASE = (1 << 5),
+ MOD_WIREFRAME_INVERT_VGROUP = (1 << 0),
+ MOD_WIREFRAME_REPLACE = (1 << 1),
+ MOD_WIREFRAME_BOUNDARY = (1 << 2),
+ MOD_WIREFRAME_OFS_EVEN = (1 << 3),
+ MOD_WIREFRAME_OFS_RELATIVE = (1 << 4),
+ MOD_WIREFRAME_CREASE = (1 << 5),
};
-
typedef struct DataTransferModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- struct Object *ob_source;
+ struct Object *ob_source;
- /** See DT_TYPE_ enum in ED_object.h. */
- int data_types;
+ /** See DT_TYPE_ enum in ED_object.h. */
+ int data_types;
- /* See MREMAP_MODE_ enum in BKE_mesh_mapping.h */
- int vmap_mode;
- int emap_mode;
- int lmap_mode;
- int pmap_mode;
+ /* See MREMAP_MODE_ enum in BKE_mesh_mapping.h */
+ int vmap_mode;
+ int emap_mode;
+ int lmap_mode;
+ int pmap_mode;
- float map_max_distance;
- float map_ray_radius;
- float islands_precision;
+ float map_max_distance;
+ float map_ray_radius;
+ float islands_precision;
- char _pad1[4];
+ char _pad1[4];
- /** DT_MULTILAYER_INDEX_MAX; See DT_FROMLAYERS_ enum in ED_object.h. */
- int layers_select_src[4];
- /** DT_MULTILAYER_INDEX_MAX; See DT_TOLAYERS_ enum in ED_object.h. */
- int layers_select_dst[4];
+ /** DT_MULTILAYER_INDEX_MAX; See DT_FROMLAYERS_ enum in ED_object.h. */
+ int layers_select_src[4];
+ /** DT_MULTILAYER_INDEX_MAX; See DT_TOLAYERS_ enum in ED_object.h. */
+ int layers_select_dst[4];
- /** See CDT_MIX_ enum in BKE_customdata.h. */
- int mix_mode;
- float mix_factor;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
+ /** See CDT_MIX_ enum in BKE_customdata.h. */
+ int mix_mode;
+ float mix_factor;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
- int flags;
+ int flags;
} DataTransferModifierData;
/* DataTransferModifierData.flags */
enum {
- MOD_DATATRANSFER_OBSRC_TRANSFORM = 1 << 0,
- MOD_DATATRANSFER_MAP_MAXDIST = 1 << 1,
- MOD_DATATRANSFER_INVERT_VGROUP = 1 << 2,
+ MOD_DATATRANSFER_OBSRC_TRANSFORM = 1 << 0,
+ MOD_DATATRANSFER_MAP_MAXDIST = 1 << 1,
+ MOD_DATATRANSFER_INVERT_VGROUP = 1 << 2,
- /* Only for UI really. */
- MOD_DATATRANSFER_USE_VERT = 1 << 28,
- MOD_DATATRANSFER_USE_EDGE = 1 << 29,
- MOD_DATATRANSFER_USE_LOOP = 1 << 30,
- MOD_DATATRANSFER_USE_POLY = 1u << 31,
+ /* Only for UI really. */
+ MOD_DATATRANSFER_USE_VERT = 1 << 28,
+ MOD_DATATRANSFER_USE_EDGE = 1 << 29,
+ MOD_DATATRANSFER_USE_LOOP = 1 << 30,
+ MOD_DATATRANSFER_USE_POLY = 1u << 31,
};
/* Set Split Normals modifier */
typedef struct NormalEditModifierData {
- ModifierData modifier;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- /** Source of normals, or center of ellipsoid. */
- struct Object *target;
- short mode;
- short flag;
- short mix_mode;
- char _pad[2];
- float mix_factor;
- float mix_limit;
- float offset[3];
- char _pad0[4];
+ ModifierData modifier;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ /** Source of normals, or center of ellipsoid. */
+ struct Object *target;
+ short mode;
+ short flag;
+ short mix_mode;
+ char _pad[2];
+ float mix_factor;
+ float mix_limit;
+ float offset[3];
+ char _pad0[4];
} NormalEditModifierData;
/* NormalEditModifierData.mode */
enum {
- MOD_NORMALEDIT_MODE_RADIAL = 0,
- MOD_NORMALEDIT_MODE_DIRECTIONAL = 1,
+ MOD_NORMALEDIT_MODE_RADIAL = 0,
+ MOD_NORMALEDIT_MODE_DIRECTIONAL = 1,
};
/* NormalEditModifierData.flags */
enum {
- MOD_NORMALEDIT_INVERT_VGROUP = (1 << 0),
- MOD_NORMALEDIT_USE_DIRECTION_PARALLEL = (1 << 1),
- MOD_NORMALEDIT_NO_POLYNORS_FIX = (1 << 2),
+ MOD_NORMALEDIT_INVERT_VGROUP = (1 << 0),
+ MOD_NORMALEDIT_USE_DIRECTION_PARALLEL = (1 << 1),
+ MOD_NORMALEDIT_NO_POLYNORS_FIX = (1 << 2),
};
/* NormalEditModifierData.mix_mode */
enum {
- MOD_NORMALEDIT_MIX_COPY = 0,
- MOD_NORMALEDIT_MIX_ADD = 1,
- MOD_NORMALEDIT_MIX_SUB = 2,
- MOD_NORMALEDIT_MIX_MUL = 3,
+ MOD_NORMALEDIT_MIX_COPY = 0,
+ MOD_NORMALEDIT_MIX_ADD = 1,
+ MOD_NORMALEDIT_MIX_SUB = 2,
+ MOD_NORMALEDIT_MIX_MUL = 3,
};
typedef struct MeshSeqCacheModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- struct CacheFile *cache_file;
- struct CacheReader *reader;
- /** 1024 = FILE_MAX. */
- char object_path[1024];
+ struct CacheFile *cache_file;
+ struct CacheReader *reader;
+ /** 1024 = FILE_MAX. */
+ char object_path[1024];
- char read_flag;
- char _pad[7];
+ char read_flag;
+ char _pad[7];
} MeshSeqCacheModifierData;
/* MeshSeqCacheModifierData.read_flag */
enum {
- MOD_MESHSEQ_READ_VERT = (1 << 0),
- MOD_MESHSEQ_READ_POLY = (1 << 1),
- MOD_MESHSEQ_READ_UV = (1 << 2),
- MOD_MESHSEQ_READ_COLOR = (1 << 3),
+ MOD_MESHSEQ_READ_VERT = (1 << 0),
+ MOD_MESHSEQ_READ_POLY = (1 << 1),
+ MOD_MESHSEQ_READ_UV = (1 << 2),
+ MOD_MESHSEQ_READ_COLOR = (1 << 3),
};
typedef struct SDefBind {
- unsigned int *vert_inds;
- unsigned int numverts;
- int mode;
- float *vert_weights;
- float normal_dist;
- float influence;
+ unsigned int *vert_inds;
+ unsigned int numverts;
+ int mode;
+ float *vert_weights;
+ float normal_dist;
+ float influence;
} SDefBind;
typedef struct SDefVert {
- SDefBind *binds;
- unsigned int numbinds;
- char _pad[4];
+ SDefBind *binds;
+ unsigned int numbinds;
+ char _pad[4];
} SDefVert;
typedef struct SurfaceDeformModifierData {
- ModifierData modifier;
-
- struct Depsgraph *depsgraph;
- /** Bind target object. */
- struct Object *target;
- /** Vertex bind data. */
- SDefVert *verts;
- float falloff;
- unsigned int numverts, numpoly;
- int flags;
- float mat[4][4];
+ ModifierData modifier;
+
+ struct Depsgraph *depsgraph;
+ /** Bind target object. */
+ struct Object *target;
+ /** Vertex bind data. */
+ SDefVert *verts;
+ float falloff;
+ unsigned int numverts, numpoly;
+ int flags;
+ float mat[4][4];
} SurfaceDeformModifierData;
/* Surface Deform modifier flags */
enum {
- /* This indicates "do bind on next modifier evaluation" as well as "is bound". */
- MOD_SDEF_BIND = (1 << 0),
+ /* This indicates "do bind on next modifier evaluation" as well as "is bound". */
+ MOD_SDEF_BIND = (1 << 0),
- MOD_SDEF_USES_LOOPTRI = (1 << 1),
- MOD_SDEF_HAS_CONCAVE = (1 << 2),
+ MOD_SDEF_USES_LOOPTRI = (1 << 1),
+ MOD_SDEF_HAS_CONCAVE = (1 << 2),
};
/* Surface Deform vertex bind modes */
enum {
- MOD_SDEF_MODE_LOOPTRI = 0,
- MOD_SDEF_MODE_NGON = 1,
- MOD_SDEF_MODE_CENTROID = 2,
+ MOD_SDEF_MODE_LOOPTRI = 0,
+ MOD_SDEF_MODE_NGON = 1,
+ MOD_SDEF_MODE_CENTROID = 2,
};
typedef struct WeightedNormalModifierData {
- ModifierData modifier;
+ ModifierData modifier;
- /** MAX_VGROUP_NAME. */
- char defgrp_name[64];
- char mode, flag;
- short weight;
- float thresh;
+ /** MAX_VGROUP_NAME. */
+ char defgrp_name[64];
+ char mode, flag;
+ short weight;
+ float thresh;
} WeightedNormalModifierData;
/* Name/id of the generic PROP_INT cdlayer storing face weights. */
@@ -1930,19 +1928,19 @@ typedef struct WeightedNormalModifierData {
/* WeightedNormalModifierData.mode */
enum {
- MOD_WEIGHTEDNORMAL_MODE_FACE = 0,
- MOD_WEIGHTEDNORMAL_MODE_ANGLE = 1,
- MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE = 2,
+ MOD_WEIGHTEDNORMAL_MODE_FACE = 0,
+ MOD_WEIGHTEDNORMAL_MODE_ANGLE = 1,
+ MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE = 2,
};
/* WeightedNormalModifierData.flag */
enum {
- MOD_WEIGHTEDNORMAL_KEEP_SHARP = (1 << 0),
- MOD_WEIGHTEDNORMAL_INVERT_VGROUP = (1 << 1),
- MOD_WEIGHTEDNORMAL_FACE_INFLUENCE = (1 << 2),
+ MOD_WEIGHTEDNORMAL_KEEP_SHARP = (1 << 0),
+ MOD_WEIGHTEDNORMAL_INVERT_VGROUP = (1 << 1),
+ MOD_WEIGHTEDNORMAL_FACE_INFLUENCE = (1 << 2),
};
#define MOD_MESHSEQ_READ_ALL \
- (MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR)
+ (MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR)
-#endif /* __DNA_MODIFIER_TYPES_H__ */
+#endif /* __DNA_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h
index 342bad4e067..38ef17f4545 100644
--- a/source/blender/makesdna/DNA_movieclip_types.h
+++ b/source/blender/makesdna/DNA_movieclip_types.h
@@ -26,7 +26,7 @@
#include "DNA_ID.h"
#include "DNA_tracking_types.h"
-#include "DNA_color_types.h" /* for color management */
+#include "DNA_color_types.h" /* for color management */
struct AnimData;
struct ImBuf;
@@ -37,161 +37,161 @@ struct anim;
struct bGPdata;
typedef struct MovieClipUser {
- /** Current frame number. */
- int framenr;
- /** Proxy render size. */
- short render_size, render_flag;
+ /** Current frame number. */
+ int framenr;
+ /** Proxy render size. */
+ short render_size, render_flag;
} MovieClipUser;
typedef struct MovieClipProxy {
- /** 768=FILE_MAXDIR custom directory for index and proxy files (defaults to BL_proxy). */
- char dir[768];
-
- /** Time code in use. */
- short tc;
- /** Proxy build quality. */
- short quality;
- /** Size flags (see below) of all proxies to build. */
- short build_size_flag;
- /** Time code flags (see below) of all tc indices to build. */
- short build_tc_flag;
+ /** 768=FILE_MAXDIR custom directory for index and proxy files (defaults to BL_proxy). */
+ char dir[768];
+
+ /** Time code in use. */
+ short tc;
+ /** Proxy build quality. */
+ short quality;
+ /** Size flags (see below) of all proxies to build. */
+ short build_size_flag;
+ /** Time code flags (see below) of all tc indices to build. */
+ short build_tc_flag;
} MovieClipProxy;
typedef struct MovieClip {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- /** File path, 1024 = FILE_MAX. */
- char name[1024];
-
- /** Sequence or movie. */
- int source;
- /** Last accessed frame number. */
- int lastframe;
- /** Size of last accessed frame. */
- int lastsize[2];
-
- /** Display aspect. */
- float aspx, aspy;
-
- /** Movie source data. */
- struct anim *anim;
- /** Cache for different stuff, not in file. */
- struct MovieClipCache *cache;
- /** Grease pencil data. */
- struct bGPdata *gpd;
-
- /** Data for SfM tracking. */
- struct MovieTracking tracking;
- /**
- * Context of tracking job used to synchronize data
- * like framenumber in SpaceClip clip user.
- */
- void *tracking_context;
-
- /** Proxy to clip data. */
- struct MovieClipProxy proxy;
- int flag;
-
- /** Length of movie. */
- int len;
-
- /**
- * Scene frame number footage starts playing at affects all data
- * which is associated with a clip such as motion tracking,
- * camera reconstruciton and so.
- */
- int start_frame;
- /**
- * 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;
-
- /* color management */
- ColorManagedColorspaceSettings colorspace_settings;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ /** File path, 1024 = FILE_MAX. */
+ char name[1024];
+
+ /** Sequence or movie. */
+ int source;
+ /** Last accessed frame number. */
+ int lastframe;
+ /** Size of last accessed frame. */
+ int lastsize[2];
+
+ /** Display aspect. */
+ float aspx, aspy;
+
+ /** Movie source data. */
+ struct anim *anim;
+ /** Cache for different stuff, not in file. */
+ struct MovieClipCache *cache;
+ /** Grease pencil data. */
+ struct bGPdata *gpd;
+
+ /** Data for SfM tracking. */
+ struct MovieTracking tracking;
+ /**
+ * Context of tracking job used to synchronize data
+ * like framenumber in SpaceClip clip user.
+ */
+ void *tracking_context;
+
+ /** Proxy to clip data. */
+ struct MovieClipProxy proxy;
+ int flag;
+
+ /** Length of movie. */
+ int len;
+
+ /**
+ * Scene frame number footage starts playing at affects all data
+ * which is associated with a clip such as motion tracking,
+ * camera reconstruciton and so.
+ */
+ int start_frame;
+ /**
+ * 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;
+
+ /* color management */
+ ColorManagedColorspaceSettings colorspace_settings;
} MovieClip;
typedef struct MovieClipScopes {
- /** 1 means scopes are ok and recalculation is unneeded. */
- short ok;
- /** Whether track's mask should be applied on preview. */
- short use_track_mask;
- /** Height of track preview widget. */
- int track_preview_height;
- /** Width and height of frame for which scopes are calculated. */
- int frame_width, frame_height;
- /** Undistorted position of marker used for pattern sampling. */
- struct MovieTrackingMarker undist_marker;
- /** Search area of a track. */
- struct ImBuf *track_search;
- /** #ImBuf displayed in track preview. */
- struct ImBuf *track_preview;
- /** Sub-pizel position of marker in track ImBuf. */
- float track_pos[2];
- /** Active track is disabled, special notifier should be drawn. */
- short track_disabled;
- /** Active track is locked, no transformation should be allowed. */
- short track_locked;
- /** Frame number scopes are created for. */
- int framenr;
- /** Track scopes are created for. */
- struct MovieTrackingTrack *track;
- /** Marker scopes are created for. */
- struct MovieTrackingMarker *marker;
- /** Scale used for sliding from previewe area. */
- float slide_scale[2];
+ /** 1 means scopes are ok and recalculation is unneeded. */
+ short ok;
+ /** Whether track's mask should be applied on preview. */
+ short use_track_mask;
+ /** Height of track preview widget. */
+ int track_preview_height;
+ /** Width and height of frame for which scopes are calculated. */
+ int frame_width, frame_height;
+ /** Undistorted position of marker used for pattern sampling. */
+ struct MovieTrackingMarker undist_marker;
+ /** Search area of a track. */
+ struct ImBuf *track_search;
+ /** #ImBuf displayed in track preview. */
+ struct ImBuf *track_preview;
+ /** Sub-pizel position of marker in track ImBuf. */
+ float track_pos[2];
+ /** Active track is disabled, special notifier should be drawn. */
+ short track_disabled;
+ /** Active track is locked, no transformation should be allowed. */
+ short track_locked;
+ /** Frame number scopes are created for. */
+ int framenr;
+ /** Track scopes are created for. */
+ struct MovieTrackingTrack *track;
+ /** Marker scopes are created for. */
+ struct MovieTrackingMarker *marker;
+ /** Scale used for sliding from previewe area. */
+ float slide_scale[2];
} MovieClipScopes;
/* MovieClipProxy->build_size_flag */
enum {
- 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),
+ 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),
};
/* MovieClip->source */
enum {
- MCLIP_SRC_SEQUENCE = 1,
- MCLIP_SRC_MOVIE = 2,
+ MCLIP_SRC_SEQUENCE = 1,
+ MCLIP_SRC_MOVIE = 2,
};
/* MovieClip->selection types */
enum {
- MCLIP_SEL_NONE = 0,
- MCLIP_SEL_TRACK = 1,
+ MCLIP_SEL_NONE = 0,
+ MCLIP_SEL_TRACK = 1,
};
/* MovieClip->flag */
enum {
- 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_USE_PROXY = (1 << 0),
+ MCLIP_USE_PROXY_CUSTOM_DIR = (1 << 1),
+ /* MCLIP_CUSTOM_START_FRAME = (1 << 2), */ /* UNUSED */
+ MCLIP_DATA_EXPAND = (1 << 3),
- MCLIP_TIMECODE_FLAGS = (MCLIP_USE_PROXY | MCLIP_USE_PROXY_CUSTOM_DIR),
+ MCLIP_TIMECODE_FLAGS = (MCLIP_USE_PROXY | MCLIP_USE_PROXY_CUSTOM_DIR),
};
/* MovieClip->render_size */
enum {
- 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,
+ 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,
};
/* MovieClip->render_flag */
enum {
- MCLIP_PROXY_RENDER_UNDISTORT = 1,
- /** Use original, if proxy is not found. */
- MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER = 2,
+ MCLIP_PROXY_RENDER_UNDISTORT = 1,
+ /** Use original, if proxy is not found. */
+ MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER = 2,
};
#endif
diff --git a/source/blender/makesdna/DNA_nla_types.h b/source/blender/makesdna/DNA_nla_types.h
index 4095a5dc99b..f634e7af5d0 100644
--- a/source/blender/makesdna/DNA_nla_types.h
+++ b/source/blender/makesdna/DNA_nla_types.h
@@ -32,82 +32,82 @@ struct bAction;
/* simple uniform modifier structure, assumed it can hold all type info */
typedef struct bActionModifier {
- struct bActionModifier *next, *prev;
- short type, flag;
- char channel[32];
+ struct bActionModifier *next, *prev;
+ short type, flag;
+ char channel[32];
- /* noise modifier */
- float noisesize, turbul;
- short channels;
+ /* noise modifier */
+ float noisesize, turbul;
+ short channels;
- /* path deform modifier */
- short no_rot_axis;
- struct Object *ob;
+ /* path deform modifier */
+ short no_rot_axis;
+ struct Object *ob;
} bActionModifier;
/* NLA-Modifier Types (UNUSED) */
-// #define ACTSTRIP_MOD_DEFORM 0
-// #define ACTSTRIP_MOD_NOISE 1
+// #define ACTSTRIP_MOD_DEFORM 0
+// #define ACTSTRIP_MOD_NOISE 1
typedef struct bActionStrip {
- struct bActionStrip *next, *prev;
- short flag, mode;
- /** Axis 0=x, 1=y, 2=z. */
- short stride_axis;
- /** Current modifier for buttons. */
- short curmod;
-
- /** Blending ipo - was used for some old NAN era experiments. Non-functional currently. */
- struct Ipo *ipo;
- /** The action referenced by this strip. */
- struct bAction *act;
- /** For groups, the actual object being nla'ed. */
- struct Object *object;
- /** The range of frames covered by this strip. */
- float start, end;
- /** The range of frames taken from the action. */
- float actstart, actend;
- /** Offset within action, for cycles and striding. */
- float actoffs;
- /** The stridelength (considered when flag & ACT_USESTRIDE). */
- float stridelen;
- /** The number of times to repeat the action range. */
- float repeat;
- /** The amount the action range is scaled by. */
- float scale;
-
- /** The number of frames on either end of the strip's length to fade in/out. */
- float blendin, blendout;
-
- /** 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. */
- ListBase modifiers;
+ struct bActionStrip *next, *prev;
+ short flag, mode;
+ /** Axis 0=x, 1=y, 2=z. */
+ short stride_axis;
+ /** Current modifier for buttons. */
+ short curmod;
+
+ /** Blending ipo - was used for some old NAN era experiments. Non-functional currently. */
+ struct Ipo *ipo;
+ /** The action referenced by this strip. */
+ struct bAction *act;
+ /** For groups, the actual object being nla'ed. */
+ struct Object *object;
+ /** The range of frames covered by this strip. */
+ float start, end;
+ /** The range of frames taken from the action. */
+ float actstart, actend;
+ /** Offset within action, for cycles and striding. */
+ float actoffs;
+ /** The stridelength (considered when flag & ACT_USESTRIDE). */
+ float stridelen;
+ /** The number of times to repeat the action range. */
+ float repeat;
+ /** The amount the action range is scaled by. */
+ float scale;
+
+ /** The number of frames on either end of the strip's length to fade in/out. */
+ float blendin, blendout;
+
+ /** 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. */
+ ListBase modifiers;
} bActionStrip;
/* strip->mode (these defines aren't really used, but are here for reference) */
-#define ACTSTRIPMODE_BLEND 0
-#define ACTSTRIPMODE_ADD 1
+#define ACTSTRIPMODE_BLEND 0
+#define ACTSTRIPMODE_ADD 1
/* strip->flag */
typedef enum eActStrip_Flag {
- ACTSTRIP_SELECT = (1 << 0),
- ACTSTRIP_USESTRIDE = (1 << 1),
- /* Not implemented. Is not used anywhere */
- ACTSTRIP_BLENDTONEXT = (1 << 2),
- 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_CYCLIC_USEX = (1 << 8),
- ACTSTRIP_CYCLIC_USEY = (1 << 9),
- ACTSTRIP_CYCLIC_USEZ = (1 << 10),
- ACTSTRIP_AUTO_BLENDS = (1 << 11),
+ ACTSTRIP_SELECT = (1 << 0),
+ ACTSTRIP_USESTRIDE = (1 << 1),
+ /* Not implemented. Is not used anywhere */
+ ACTSTRIP_BLENDTONEXT = (1 << 2),
+ 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_CYCLIC_USEX = (1 << 8),
+ ACTSTRIP_CYCLIC_USEY = (1 << 9),
+ ACTSTRIP_CYCLIC_USEZ = (1 << 10),
+ ACTSTRIP_AUTO_BLENDS = (1 << 11),
} eActStrip_Flag;
#endif
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 0f06aed8bca..905cd4764ad 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -51,301 +51,301 @@ struct uiBlock;
#define NODE_MAXSTR 64
typedef struct bNodeStack {
- float vec[4];
- float min, max;
- void *data;
- /** When input has link, tagged before executing. */
- short hasinput;
- /** When output is linked, tagged before executing. */
- short hasoutput;
- /** Type of data pointer. */
- short datatype;
- /** Type of socket stack comes from, to remap linking different sockets. */
- short sockettype;
- /** Data is a copy of external data (no freeing). */
- short is_copy;
- /** Data is used by external nodes (no freeing). */
- short external;
- char _pad[4];
+ float vec[4];
+ float min, max;
+ void *data;
+ /** When input has link, tagged before executing. */
+ short hasinput;
+ /** When output is linked, tagged before executing. */
+ short hasoutput;
+ /** Type of data pointer. */
+ short datatype;
+ /** Type of socket stack comes from, to remap linking different sockets. */
+ short sockettype;
+ /** Data is a copy of external data (no freeing). */
+ short is_copy;
+ /** Data is used by external nodes (no freeing). */
+ short external;
+ char _pad[4];
} bNodeStack;
/* ns->datatype, shadetree only */
-#define NS_OSA_VECTORS 1
-#define NS_OSA_VALUES 2
+#define NS_OSA_VECTORS 1
+#define NS_OSA_VALUES 2
/* node socket/node socket type -b conversion rules */
-#define NS_CR_CENTER 0
-#define NS_CR_NONE 1
-#define NS_CR_FIT_WIDTH 2
-#define NS_CR_FIT_HEIGHT 3
-#define NS_CR_FIT 4
-#define NS_CR_STRETCH 5
+#define NS_CR_CENTER 0
+#define NS_CR_NONE 1
+#define NS_CR_FIT_WIDTH 2
+#define NS_CR_FIT_HEIGHT 3
+#define NS_CR_FIT 4
+#define NS_CR_STRETCH 5
typedef struct bNodeSocket {
- struct bNodeSocket *next, *prev, *new_sock;
-
- /** User-defined properties. */
- IDProperty *prop;
-
- /** Unique identifier for mapping. */
- char identifier[64];
-
- /** MAX_NAME. */
- char name[64];
-
- /* XXX deprecated, only used for the Image and OutputFile nodes,
- * should be removed at some point.
- */
- /** Custom storage. */
- void *storage;
-
- short type, flag;
- /** Max. number of links. */
- short limit;
- /** Input/output type. */
- short in_out;
- /** Runtime type information. */
- struct bNodeSocketType *typeinfo;
- /** Runtime type identifier. */
- char idname[64];
-
- float locx, locy;
-
- /** Default input value used for unlinked sockets. */
- void *default_value;
-
- /* execution data */
- /** Local stack index. */
- short stack_index;
- /* XXX deprecated, kept for forward compatibility */
- short stack_type DNA_DEPRECATED;
- char draw_shape;
- char _pad[3];
-
- /** Cached data from execution. */
- void *cache;
-
- /* internal data to retrieve relations and groups
- * DEPRECATED, now uses the generic identifier string instead
- */
- /** Group socket identifiers, to find matching pairs after reading files. */
- int own_index DNA_DEPRECATED;
- /* XXX deprecated, only used for restoring old group node links */
- int to_index DNA_DEPRECATED;
- /* XXX deprecated, still forward compatible since verification
- * restores pointer from matching own_index. */
- struct bNodeSocket *groupsock DNA_DEPRECATED;
-
- /** A link pointer, set in ntreeUpdateTree. */
- struct bNodeLink *link;
-
- /* XXX deprecated, socket input values are stored in default_value now.
- * kept for forward compatibility */
- /** Custom data for inputs, only UI writes in this. */
- bNodeStack ns DNA_DEPRECATED;
+ struct bNodeSocket *next, *prev, *new_sock;
+
+ /** User-defined properties. */
+ IDProperty *prop;
+
+ /** Unique identifier for mapping. */
+ char identifier[64];
+
+ /** MAX_NAME. */
+ char name[64];
+
+ /* XXX deprecated, only used for the Image and OutputFile nodes,
+ * should be removed at some point.
+ */
+ /** Custom storage. */
+ void *storage;
+
+ short type, flag;
+ /** Max. number of links. */
+ short limit;
+ /** Input/output type. */
+ short in_out;
+ /** Runtime type information. */
+ struct bNodeSocketType *typeinfo;
+ /** Runtime type identifier. */
+ char idname[64];
+
+ float locx, locy;
+
+ /** Default input value used for unlinked sockets. */
+ void *default_value;
+
+ /* execution data */
+ /** Local stack index. */
+ short stack_index;
+ /* XXX deprecated, kept for forward compatibility */
+ short stack_type DNA_DEPRECATED;
+ char draw_shape;
+ char _pad[3];
+
+ /** Cached data from execution. */
+ void *cache;
+
+ /* internal data to retrieve relations and groups
+ * DEPRECATED, now uses the generic identifier string instead
+ */
+ /** Group socket identifiers, to find matching pairs after reading files. */
+ int own_index DNA_DEPRECATED;
+ /* XXX deprecated, only used for restoring old group node links */
+ int to_index DNA_DEPRECATED;
+ /* XXX deprecated, still forward compatible since verification
+ * restores pointer from matching own_index. */
+ struct bNodeSocket *groupsock DNA_DEPRECATED;
+
+ /** A link pointer, set in ntreeUpdateTree. */
+ struct bNodeLink *link;
+
+ /* XXX deprecated, socket input values are stored in default_value now.
+ * kept for forward compatibility */
+ /** Custom data for inputs, only UI writes in this. */
+ bNodeStack ns DNA_DEPRECATED;
} bNodeSocket;
/* sock->type */
typedef enum eNodeSocketDatatype {
- SOCK_CUSTOM = -1, /* socket has no integer type */
- SOCK_FLOAT = 0,
- SOCK_VECTOR = 1,
- SOCK_RGBA = 2,
- SOCK_SHADER = 3,
- SOCK_BOOLEAN = 4,
- __SOCK_MESH = 5, /* deprecated */
- SOCK_INT = 6,
- SOCK_STRING = 7,
+ SOCK_CUSTOM = -1, /* socket has no integer type */
+ SOCK_FLOAT = 0,
+ SOCK_VECTOR = 1,
+ SOCK_RGBA = 2,
+ SOCK_SHADER = 3,
+ SOCK_BOOLEAN = 4,
+ __SOCK_MESH = 5, /* deprecated */
+ SOCK_INT = 6,
+ SOCK_STRING = 7,
} eNodeSocketDatatype;
/* socket shape */
typedef enum eNodeSocketDrawShape {
- SOCK_DRAW_SHAPE_CIRCLE = 0,
- SOCK_DRAW_SHAPE_SQUARE = 1,
- SOCK_DRAW_SHAPE_DIAMOND = 2,
+ SOCK_DRAW_SHAPE_CIRCLE = 0,
+ SOCK_DRAW_SHAPE_SQUARE = 1,
+ SOCK_DRAW_SHAPE_DIAMOND = 2,
} eNodeSocketDrawShape;
/* socket side (input/output) */
typedef enum eNodeSocketInOut {
- SOCK_IN = 1,
- SOCK_OUT = 2,
+ SOCK_IN = 1,
+ SOCK_OUT = 2,
} eNodeSocketInOut;
/* sock->flag, first bit is select */
typedef enum eNodeSocketFlag {
- /** hidden is user defined, to hide unused */
- SOCK_HIDDEN = (1 << 1),
- /** for quick check if socket is linked */
- SOCK_IN_USE = (1 << 2),
- /** unavailable is for dynamic sockets */
- SOCK_UNAVAIL = (1 << 3),
- // /** DEPRECATED dynamic socket (can be modified by user) */
- // SOCK_DYNAMIC = (1 << 4),
- // /** DEPRECATED group socket should not be exposed */
- // SOCK_INTERNAL = (1 << 5),
- /** socket collapsed in UI */
- SOCK_COLLAPSED = (1 << 6),
- /** hide socket value, if it gets auto default */
- SOCK_HIDE_VALUE = (1 << 7),
- /** socket hidden automatically, to distinguish from manually hidden */
- SOCK_AUTO_HIDDEN__DEPRECATED = (1 << 8),
- SOCK_NO_INTERNAL_LINK = (1 << 9),
+ /** hidden is user defined, to hide unused */
+ SOCK_HIDDEN = (1 << 1),
+ /** for quick check if socket is linked */
+ SOCK_IN_USE = (1 << 2),
+ /** unavailable is for dynamic sockets */
+ SOCK_UNAVAIL = (1 << 3),
+ // /** DEPRECATED dynamic socket (can be modified by user) */
+ // SOCK_DYNAMIC = (1 << 4),
+ // /** DEPRECATED group socket should not be exposed */
+ // SOCK_INTERNAL = (1 << 5),
+ /** socket collapsed in UI */
+ SOCK_COLLAPSED = (1 << 6),
+ /** hide socket value, if it gets auto default */
+ SOCK_HIDE_VALUE = (1 << 7),
+ /** socket hidden automatically, to distinguish from manually hidden */
+ SOCK_AUTO_HIDDEN__DEPRECATED = (1 << 8),
+ SOCK_NO_INTERNAL_LINK = (1 << 9),
} eNodeSocketFlag;
/* limit data in bNode to what we want to see saved? */
typedef struct bNode {
- struct bNode *next, *prev, *new_node;
-
- /** User-defined properties. */
- IDProperty *prop;
-
- /** Runtime type information. */
- struct bNodeType *typeinfo;
- /** Runtime type identifier. */
- char idname[64];
-
- /** MAX_NAME. */
- char name[64];
- int flag;
- short type;
- char _pad[2];
- /** Both for dependency and sorting. */
- short done, level;
- /** Lasty: check preview render status, menunr: browse ID blocks. */
- short lasty, menunr;
- /** For groupnode, offset in global caller stack. */
- short stack_index;
- /** Number of this node in list, used for UI exec events. */
- short nr;
- /** Custom user-defined color. */
- float color[3];
-
- ListBase inputs, outputs;
- /** Parent node. */
- struct bNode *parent;
- /** Optional link to libdata. */
- struct ID *id;
- /** Custom data, must be struct, for storage in file. */
- void *storage;
- /** The original node in the tree (for localized tree). */
- struct bNode *original;
- /** List of cached internal links (input to output), for muted nodes and operators. */
- ListBase internal_links;
-
- /** Root offset for drawing (parent space). */
- float locx, locy;
- /** Node custom width and height. */
- float width, height;
- /** Node width if hidden. */
- float miniwidth;
- /** Additional offset from loc. */
- float offsetx, offsety;
- /** Initial locx for insert offset animation. */
- float anim_init_locx;
- /** Offset that will be added to locx for insert offset animation. */
- float anim_ofsx;
-
- /** Update flags. */
- int update;
-
- /** Custom user-defined label, MAX_NAME. */
- char label[64];
- /** To be abused for buttons. */
- short custom1, custom2;
- float custom3, custom4;
-
- /** Need_exec is set as UI execution event, exec is flag during exec. */
- short need_exec, exec;
- /** Optional extra storage for use in thread (read only then!). */
- void *threaddata;
- /** Entire boundbox (worldspace). */
- rctf totr;
- /** Optional buttons area. */
- rctf butr;
- /** Optional preview area. */
- rctf prvr;
- /* XXX TODO
- * Node totr size depends on the prvr size, which in turn is determined from preview size.
- * In earlier versions bNodePreview was stored directly in nodes, but since now there can be
- * multiple instances using different preview images it is possible that required node size varies between instances.
- * preview_xsize, preview_ysize defines a common reserved size for preview rect for now,
- * could be replaced by more accurate node instance drawing, but that requires removing totr from DNA
- * and replacing all uses with per-instance data.
- */
- /** Reserved size of the preview rect. */
- short preview_xsize, preview_ysize;
- /** Used at runtime when going through the tree. Initialize before use. */
- short tmp_flag;
- char _pad2[2];
- /** Runtime during drawing. */
- struct uiBlock *block;
-
- /**
- * XXX: eevee only, id of screen space reflection layer,
- * needs to be a float to feed GPU_uniform.
- */
- float ssr_id;
- /**
- * XXX: eevee only, id of screen subsurface scatter layer,
- * needs to be a float to feed GPU_uniform.
- */
- float sss_id;
+ struct bNode *next, *prev, *new_node;
+
+ /** User-defined properties. */
+ IDProperty *prop;
+
+ /** Runtime type information. */
+ struct bNodeType *typeinfo;
+ /** Runtime type identifier. */
+ char idname[64];
+
+ /** MAX_NAME. */
+ char name[64];
+ int flag;
+ short type;
+ char _pad[2];
+ /** Both for dependency and sorting. */
+ short done, level;
+ /** Lasty: check preview render status, menunr: browse ID blocks. */
+ short lasty, menunr;
+ /** For groupnode, offset in global caller stack. */
+ short stack_index;
+ /** Number of this node in list, used for UI exec events. */
+ short nr;
+ /** Custom user-defined color. */
+ float color[3];
+
+ ListBase inputs, outputs;
+ /** Parent node. */
+ struct bNode *parent;
+ /** Optional link to libdata. */
+ struct ID *id;
+ /** Custom data, must be struct, for storage in file. */
+ void *storage;
+ /** The original node in the tree (for localized tree). */
+ struct bNode *original;
+ /** List of cached internal links (input to output), for muted nodes and operators. */
+ ListBase internal_links;
+
+ /** Root offset for drawing (parent space). */
+ float locx, locy;
+ /** Node custom width and height. */
+ float width, height;
+ /** Node width if hidden. */
+ float miniwidth;
+ /** Additional offset from loc. */
+ float offsetx, offsety;
+ /** Initial locx for insert offset animation. */
+ float anim_init_locx;
+ /** Offset that will be added to locx for insert offset animation. */
+ float anim_ofsx;
+
+ /** Update flags. */
+ int update;
+
+ /** Custom user-defined label, MAX_NAME. */
+ char label[64];
+ /** To be abused for buttons. */
+ short custom1, custom2;
+ float custom3, custom4;
+
+ /** Need_exec is set as UI execution event, exec is flag during exec. */
+ short need_exec, exec;
+ /** Optional extra storage for use in thread (read only then!). */
+ void *threaddata;
+ /** Entire boundbox (worldspace). */
+ rctf totr;
+ /** Optional buttons area. */
+ rctf butr;
+ /** Optional preview area. */
+ rctf prvr;
+ /* XXX TODO
+ * Node totr size depends on the prvr size, which in turn is determined from preview size.
+ * In earlier versions bNodePreview was stored directly in nodes, but since now there can be
+ * multiple instances using different preview images it is possible that required node size varies between instances.
+ * preview_xsize, preview_ysize defines a common reserved size for preview rect for now,
+ * could be replaced by more accurate node instance drawing, but that requires removing totr from DNA
+ * and replacing all uses with per-instance data.
+ */
+ /** Reserved size of the preview rect. */
+ short preview_xsize, preview_ysize;
+ /** Used at runtime when going through the tree. Initialize before use. */
+ short tmp_flag;
+ char _pad2[2];
+ /** Runtime during drawing. */
+ struct uiBlock *block;
+
+ /**
+ * XXX: eevee only, id of screen space reflection layer,
+ * needs to be a float to feed GPU_uniform.
+ */
+ float ssr_id;
+ /**
+ * XXX: eevee only, id of screen subsurface scatter layer,
+ * needs to be a float to feed GPU_uniform.
+ */
+ float sss_id;
} bNode;
/* node->flag */
-#define NODE_SELECT 1
-#define NODE_OPTIONS 2
-#define NODE_PREVIEW 4
-#define NODE_HIDDEN 8
-#define NODE_ACTIVE 16
-#define NODE_ACTIVE_ID 32
-#define NODE_DO_OUTPUT 64
-#define __NODE_GROUP_EDIT 128 /* DEPRECATED */
- /* free test flag, undefined */
-#define NODE_TEST 256
- /* node is disabled */
-#define NODE_MUTED 512
-// #define NODE_CUSTOM_NAME 1024 /* deprecated! */
- /* group node types: use const outputs by default */
-#define NODE_CONST_OUTPUT (1 << 11)
- /* node is always behind others */
-#define NODE_BACKGROUND (1 << 12)
- /* automatic flag for nodes included in transforms */
-#define NODE_TRANSFORM (1 << 13)
- /* node is active texture */
-
- /* note: take care with this flag since its possible it gets
- * `stuck` inside/outside the active group - which makes buttons
- * window texture not update, we try to avoid it by clearing the
- * flag when toggling group editing - Campbell */
-#define NODE_ACTIVE_TEXTURE (1 << 14)
- /* use a custom color for the node */
-#define NODE_CUSTOM_COLOR (1 << 15)
- /* Node has been initialized
- * This flag indicates the node->typeinfo->init function has been called.
- * In case of undefined type at creation time this can be delayed until
- * until the node type is registered.
- */
-#define NODE_INIT (1 << 16)
-
- /* do recalc of output, used to skip recalculation of unwanted
- * composite out nodes when editing tree
- */
-#define NODE_DO_OUTPUT_RECALC (1 << 17)
+#define NODE_SELECT 1
+#define NODE_OPTIONS 2
+#define NODE_PREVIEW 4
+#define NODE_HIDDEN 8
+#define NODE_ACTIVE 16
+#define NODE_ACTIVE_ID 32
+#define NODE_DO_OUTPUT 64
+#define __NODE_GROUP_EDIT 128 /* DEPRECATED */
+/* free test flag, undefined */
+#define NODE_TEST 256
+/* node is disabled */
+#define NODE_MUTED 512
+// #define NODE_CUSTOM_NAME 1024 /* deprecated! */
+/* group node types: use const outputs by default */
+#define NODE_CONST_OUTPUT (1 << 11)
+/* node is always behind others */
+#define NODE_BACKGROUND (1 << 12)
+/* automatic flag for nodes included in transforms */
+#define NODE_TRANSFORM (1 << 13)
+/* node is active texture */
+
+/* note: take care with this flag since its possible it gets
+ * `stuck` inside/outside the active group - which makes buttons
+ * window texture not update, we try to avoid it by clearing the
+ * flag when toggling group editing - Campbell */
+#define NODE_ACTIVE_TEXTURE (1 << 14)
+/* use a custom color for the node */
+#define NODE_CUSTOM_COLOR (1 << 15)
+/* Node has been initialized
+ * This flag indicates the node->typeinfo->init function has been called.
+ * In case of undefined type at creation time this can be delayed until
+ * until the node type is registered.
+ */
+#define NODE_INIT (1 << 16)
+
+/* do recalc of output, used to skip recalculation of unwanted
+ * composite out nodes when editing tree
+ */
+#define NODE_DO_OUTPUT_RECALC (1 << 17)
/* node->update */
/* XXX NODE_UPDATE is a generic update flag. More fine-grained updates
* might be used in the future, but currently all work the same way.
*/
-#define NODE_UPDATE 0xFFFF /* generic update flag (includes all others) */
-#define NODE_UPDATE_ID 1 /* associated id data block has changed */
-#define NODE_UPDATE_OPERATOR 2 /* node update triggered from update operator */
+#define NODE_UPDATE 0xFFFF /* generic update flag (includes all others) */
+#define NODE_UPDATE_ID 1 /* associated id data block has changed */
+#define NODE_UPDATE_OPERATOR 2 /* node update triggered from update operator */
/* Unique hash key for identifying node instances
* Defined as a struct because DNA does not support other typedefs.
*/
typedef struct bNodeInstanceKey {
- unsigned int value;
+ unsigned int value;
} bNodeInstanceKey;
/* Base struct for entries in node instance hash.
@@ -355,43 +355,41 @@ typedef struct bNodeInstanceKey {
#
#
typedef struct bNodeInstanceHashEntry {
- bNodeInstanceKey key;
+ bNodeInstanceKey key;
- /* tags for cleaning the cache */
- short tag;
+ /* tags for cleaning the cache */
+ short tag;
} bNodeInstanceHashEntry;
-
#
#
typedef struct bNodePreview {
- /** Must be first. */
- bNodeInstanceHashEntry hash_entry;
+ /** Must be first. */
+ bNodeInstanceHashEntry hash_entry;
- unsigned char *rect;
- short xsize, ysize;
+ unsigned char *rect;
+ short xsize, ysize;
} bNodePreview;
-
typedef struct bNodeLink {
- struct bNodeLink *next, *prev;
+ struct bNodeLink *next, *prev;
- bNode *fromnode, *tonode;
- bNodeSocket *fromsock, *tosock;
+ bNode *fromnode, *tonode;
+ bNodeSocket *fromsock, *tosock;
- int flag;
- char _pad[4];
+ int flag;
+ char _pad[4];
} bNodeLink;
/* link->flag */
-#define NODE_LINKFLAG_HILITE (1 << 0) /* link has been successfully validated */
-#define NODE_LINK_VALID (1 << 1)
-#define NODE_LINK_TEST (1 << 2) /* free test flag, undefined */
+#define NODE_LINKFLAG_HILITE (1 << 0) /* link has been successfully validated */
+#define NODE_LINK_VALID (1 << 1)
+#define NODE_LINK_TEST (1 << 2) /* free test flag, undefined */
/* tree->edit_quality/tree->render_quality */
-#define NTREE_QUALITY_HIGH 0
-#define NTREE_QUALITY_MEDIUM 1
-#define NTREE_QUALITY_LOW 2
+#define NTREE_QUALITY_HIGH 0
+#define NTREE_QUALITY_MEDIUM 1
+#define NTREE_QUALITY_LOW 2
/* tree->chunksize */
#define NTREE_CHUNCKSIZE_32 32
@@ -405,855 +403,854 @@ typedef struct bNodeLink {
/* only re-usable node trees are in the library though,
* materials and textures allocate own tree struct */
typedef struct bNodeTree {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- /** Runtime type information. */
- struct bNodeTreeType *typeinfo;
- /** Runtime type identifier. */
- char idname[64];
-
- /** Runtime RNA type of the group interface. */
- struct StructRNA *interface_type;
-
- /** Grease pencil data. */
- struct bGPdata *gpd;
- /** Node tree stores own offset for consistent editor view. */
- float view_center[2];
-
- ListBase nodes, links;
-
- /** Set init on fileread. */
- int type, init;
- /**
- * Sockets in groups have unique identifiers, adding new sockets always
- * will increase this counter.
- */
- int cur_index;
- int flag;
- /** Update flags. */
- int update;
- /** Flag to prevent reentrant update calls. */
- short is_updating;
- /** Generic temporary flag for recursion check (DFS/BFS). */
- short done;
- char _pad2[4];
-
- /** Specific node type this tree is used for. */
- int nodetype DNA_DEPRECATED;
-
- /** Quality setting when editing. */
- short edit_quality;
- /** Quality setting when rendering. */
- short render_quality;
- /** Tile size for compositor engine. */
- int chunksize;
-
- rctf viewer_border;
-
- /* Lists of bNodeSocket to hold default values and own_index.
- * Warning! Don't make links to these sockets, input/output nodes are used for that.
- * These sockets are used only for generating external interfaces.
- */
- ListBase inputs, outputs;
-
- /* Node preview hash table
- * Only available in base node trees (e.g. scene->node_tree)
- */
- struct bNodeInstanceHash *previews;
- /* Defines the node tree instance to use for the "active" context,
- * in case multiple different editors are used and make context ambiguous.
- */
- bNodeInstanceKey active_viewer_key;
- char _pad[4];
-
- /* execution data */
- /* XXX It would be preferable to completely move this data out of the underlying node tree,
- * so node tree execution could finally run independent of the tree itself. This would allow node trees
- * to be merely linked by other data (materials, textures, etc.), as ID data is supposed to.
- * Execution data is generated from the tree once at execution start and can then be used
- * as long as necessary, even while the tree is being modified.
- */
- struct bNodeTreeExec *execdata;
-
- /* callbacks */
- void (*progress)(void *, float progress);
- /** \warning may be called by different threads */
- void (*stats_draw)(void *, const char *str);
- int (*test_break)(void *);
- void (*update_draw)(void *);
- void *tbh, *prh, *sdh, *udh;
-
- void *duplilock;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ /** Runtime type information. */
+ struct bNodeTreeType *typeinfo;
+ /** Runtime type identifier. */
+ char idname[64];
+
+ /** Runtime RNA type of the group interface. */
+ struct StructRNA *interface_type;
+
+ /** Grease pencil data. */
+ struct bGPdata *gpd;
+ /** Node tree stores own offset for consistent editor view. */
+ float view_center[2];
+
+ ListBase nodes, links;
+
+ /** Set init on fileread. */
+ int type, init;
+ /**
+ * Sockets in groups have unique identifiers, adding new sockets always
+ * will increase this counter.
+ */
+ int cur_index;
+ int flag;
+ /** Update flags. */
+ int update;
+ /** Flag to prevent reentrant update calls. */
+ short is_updating;
+ /** Generic temporary flag for recursion check (DFS/BFS). */
+ short done;
+ char _pad2[4];
+
+ /** Specific node type this tree is used for. */
+ int nodetype DNA_DEPRECATED;
+
+ /** Quality setting when editing. */
+ short edit_quality;
+ /** Quality setting when rendering. */
+ short render_quality;
+ /** Tile size for compositor engine. */
+ int chunksize;
+
+ rctf viewer_border;
+
+ /* Lists of bNodeSocket to hold default values and own_index.
+ * Warning! Don't make links to these sockets, input/output nodes are used for that.
+ * These sockets are used only for generating external interfaces.
+ */
+ ListBase inputs, outputs;
+
+ /* Node preview hash table
+ * Only available in base node trees (e.g. scene->node_tree)
+ */
+ struct bNodeInstanceHash *previews;
+ /* Defines the node tree instance to use for the "active" context,
+ * in case multiple different editors are used and make context ambiguous.
+ */
+ bNodeInstanceKey active_viewer_key;
+ char _pad[4];
+
+ /* execution data */
+ /* XXX It would be preferable to completely move this data out of the underlying node tree,
+ * so node tree execution could finally run independent of the tree itself. This would allow node trees
+ * to be merely linked by other data (materials, textures, etc.), as ID data is supposed to.
+ * Execution data is generated from the tree once at execution start and can then be used
+ * as long as necessary, even while the tree is being modified.
+ */
+ struct bNodeTreeExec *execdata;
+
+ /* callbacks */
+ void (*progress)(void *, float progress);
+ /** \warning may be called by different threads */
+ void (*stats_draw)(void *, const char *str);
+ int (*test_break)(void *);
+ void (*update_draw)(void *);
+ void *tbh, *prh, *sdh, *udh;
+
+ void *duplilock;
} bNodeTree;
/* ntree->type, index */
-#define NTREE_CUSTOM -1 /* for dynamically registered custom types */
-#define NTREE_SHADER 0
-#define NTREE_COMPOSIT 1
-#define NTREE_TEXTURE 2
+#define NTREE_CUSTOM -1 /* for dynamically registered custom types */
+#define NTREE_SHADER 0
+#define NTREE_COMPOSIT 1
+#define NTREE_TEXTURE 2
/* ntree->init, flag */
-#define NTREE_TYPE_INIT 1
+#define NTREE_TYPE_INIT 1
/* ntree->flag */
-#define NTREE_DS_EXPAND (1 << 0) /* for animation editors */
-#define NTREE_COM_OPENCL (1 << 1) /* use opencl */
-#define NTREE_TWO_PASS (1 << 2) /* two pass */
-#define NTREE_COM_GROUPNODE_BUFFER (1 << 3) /* use groupnode buffers */
-#define NTREE_VIEWER_BORDER (1 << 4) /* use a border for viewer nodes */
+#define NTREE_DS_EXPAND (1 << 0) /* for animation editors */
+#define NTREE_COM_OPENCL (1 << 1) /* use opencl */
+#define NTREE_TWO_PASS (1 << 2) /* two pass */
+#define NTREE_COM_GROUPNODE_BUFFER (1 << 3) /* use groupnode buffers */
+#define NTREE_VIEWER_BORDER (1 << 4) /* use a border for viewer nodes */
/* NOTE: DEPRECATED, use (id->tag & LIB_TAG_LOCALIZED) instead. */
/* tree is localized copy, free when deleting node groups */
-/* #define NTREE_IS_LOCALIZED (1 << 5) */
+/* #define NTREE_IS_LOCALIZED (1 << 5) */
/* XXX not nice, but needed as a temporary flags
* for group updates after library linking.
*/
/* changes from r35033 */
-#define NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2 (1 << 10)
+#define NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2 (1 << 10)
/* custom_nodes branch: remove links to node tree sockets */
-#define NTREE_DO_VERSIONS_CUSTOMNODES_GROUP (1 << 11)
+#define NTREE_DO_VERSIONS_CUSTOMNODES_GROUP (1 << 11)
/* custom_nodes branch: create group input/output nodes */
-#define NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE (1 << 12)
+#define NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE (1 << 12)
/* ntree->update */
typedef enum eNodeTreeUpdate {
- NTREE_UPDATE = 0xFFFF, /* generic update flag (includes all others) */
- NTREE_UPDATE_LINKS = (1 << 0), /* links have been added or removed */
- NTREE_UPDATE_NODES = (1 << 1), /* nodes or sockets have been added or removed */
- NTREE_UPDATE_GROUP_IN = (1 << 4), /* group inputs have changed */
- NTREE_UPDATE_GROUP_OUT = (1 << 5), /* group outputs have changed */
- /* group has changed (generic flag including all other group flags) */
- NTREE_UPDATE_GROUP = (NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_GROUP_OUT),
+ NTREE_UPDATE = 0xFFFF, /* generic update flag (includes all others) */
+ NTREE_UPDATE_LINKS = (1 << 0), /* links have been added or removed */
+ NTREE_UPDATE_NODES = (1 << 1), /* nodes or sockets have been added or removed */
+ NTREE_UPDATE_GROUP_IN = (1 << 4), /* group inputs have changed */
+ NTREE_UPDATE_GROUP_OUT = (1 << 5), /* group outputs have changed */
+ /* group has changed (generic flag including all other group flags) */
+ NTREE_UPDATE_GROUP = (NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_GROUP_OUT),
} eNodeTreeUpdate;
-
/* socket value structs for input buttons
* DEPRECATED now using ID properties
*/
typedef struct bNodeSocketValueInt {
- /** RNA subtype. */
- int subtype;
- int value;
- int min, max;
+ /** RNA subtype. */
+ int subtype;
+ int value;
+ int min, max;
} bNodeSocketValueInt;
typedef struct bNodeSocketValueFloat {
- /** RNA subtype. */
- int subtype;
- float value;
- float min, max;
+ /** RNA subtype. */
+ int subtype;
+ float value;
+ float min, max;
} bNodeSocketValueFloat;
typedef struct bNodeSocketValueBoolean {
- char value;
- char _pad[3];
+ char value;
+ char _pad[3];
} bNodeSocketValueBoolean;
typedef struct bNodeSocketValueVector {
- /** RNA subtype. */
- int subtype;
- float value[3];
- float min, max;
+ /** RNA subtype. */
+ int subtype;
+ float value[3];
+ float min, max;
} bNodeSocketValueVector;
typedef struct bNodeSocketValueRGBA {
- float value[4];
+ float value[4];
} bNodeSocketValueRGBA;
typedef struct bNodeSocketValueString {
- int subtype;
- char _pad[4];
- /** 1024 = FILEMAX. */
- char value[1024];
+ int subtype;
+ char _pad[4];
+ /** 1024 = FILEMAX. */
+ char value[1024];
} bNodeSocketValueString;
/* data structs, for node->storage */
enum {
- CMP_NODE_MASKTYPE_ADD = 0,
- CMP_NODE_MASKTYPE_SUBTRACT = 1,
- CMP_NODE_MASKTYPE_MULTIPLY = 2,
- CMP_NODE_MASKTYPE_NOT = 3,
+ CMP_NODE_MASKTYPE_ADD = 0,
+ CMP_NODE_MASKTYPE_SUBTRACT = 1,
+ CMP_NODE_MASKTYPE_MULTIPLY = 2,
+ CMP_NODE_MASKTYPE_NOT = 3,
};
enum {
- CMP_NODE_LENSFLARE_GHOST = (1 << 0),
- CMP_NODE_LENSFLARE_GLOW = (1 << 1),
- CMP_NODE_LENSFLARE_CIRCLE = (1 << 2),
- CMP_NODE_LENSFLARE_STREAKS = (1 << 3),
+ CMP_NODE_LENSFLARE_GHOST = (1 << 0),
+ CMP_NODE_LENSFLARE_GLOW = (1 << 1),
+ CMP_NODE_LENSFLARE_CIRCLE = (1 << 2),
+ CMP_NODE_LENSFLARE_STREAKS = (1 << 3),
};
enum {
- CMP_NODE_DILATEERODE_STEP = 0,
- CMP_NODE_DILATEERODE_DISTANCE_THRESH = 1,
- CMP_NODE_DILATEERODE_DISTANCE = 2,
- CMP_NODE_DILATEERODE_DISTANCE_FEATHER = 3,
+ CMP_NODE_DILATEERODE_STEP = 0,
+ CMP_NODE_DILATEERODE_DISTANCE_THRESH = 1,
+ CMP_NODE_DILATEERODE_DISTANCE = 2,
+ CMP_NODE_DILATEERODE_DISTANCE_FEATHER = 3,
};
enum {
- CMP_NODE_INPAINT_SIMPLE = 0,
+ CMP_NODE_INPAINT_SIMPLE = 0,
};
enum {
- /* CMP_NODEFLAG_MASK_AA = (1 << 0), */ /* DEPRECATED */
- CMP_NODEFLAG_MASK_NO_FEATHER = (1 << 1),
- CMP_NODEFLAG_MASK_MOTION_BLUR = (1 << 2),
+ /* CMP_NODEFLAG_MASK_AA = (1 << 0), */ /* DEPRECATED */
+ CMP_NODEFLAG_MASK_NO_FEATHER = (1 << 1),
+ CMP_NODEFLAG_MASK_MOTION_BLUR = (1 << 2),
- /* we may want multiple aspect options, exposed as an rna enum */
- CMP_NODEFLAG_MASK_FIXED = (1 << 8),
- CMP_NODEFLAG_MASK_FIXED_SCENE = (1 << 9),
+ /* we may want multiple aspect options, exposed as an rna enum */
+ CMP_NODEFLAG_MASK_FIXED = (1 << 8),
+ CMP_NODEFLAG_MASK_FIXED_SCENE = (1 << 9),
};
enum {
- CMP_NODEFLAG_BLUR_VARIABLE_SIZE = (1 << 0),
- CMP_NODEFLAG_BLUR_EXTEND_BOUNDS = (1 << 1),
+ CMP_NODEFLAG_BLUR_VARIABLE_SIZE = (1 << 0),
+ CMP_NODEFLAG_BLUR_EXTEND_BOUNDS = (1 << 1),
};
typedef struct NodeFrame {
- short flag;
- short label_size;
+ short flag;
+ short label_size;
} NodeFrame;
/* this one has been replaced with ImageUser, keep it for do_versions() */
typedef struct NodeImageAnim {
- int frames DNA_DEPRECATED;
- int sfra DNA_DEPRECATED;
- int nr DNA_DEPRECATED;
- char cyclic DNA_DEPRECATED;
- char movie DNA_DEPRECATED;
- char _pad[2];
+ int frames DNA_DEPRECATED;
+ int sfra DNA_DEPRECATED;
+ int nr DNA_DEPRECATED;
+ char cyclic DNA_DEPRECATED;
+ char movie DNA_DEPRECATED;
+ char _pad[2];
} NodeImageAnim;
typedef struct ColorCorrectionData {
- float saturation;
- float contrast;
- float gamma;
- float gain;
- float lift;
- char _pad[4];
+ float saturation;
+ float contrast;
+ float gamma;
+ float gain;
+ float lift;
+ char _pad[4];
} ColorCorrectionData;
typedef struct NodeColorCorrection {
- ColorCorrectionData master;
- ColorCorrectionData shadows;
- ColorCorrectionData midtones;
- ColorCorrectionData highlights;
- float startmidtones;
- float endmidtones;
+ ColorCorrectionData master;
+ ColorCorrectionData shadows;
+ ColorCorrectionData midtones;
+ ColorCorrectionData highlights;
+ float startmidtones;
+ float endmidtones;
} NodeColorCorrection;
typedef struct NodeBokehImage {
- float angle;
- int flaps;
- float rounding;
- float catadioptric;
- float lensshift;
+ float angle;
+ int flaps;
+ float rounding;
+ float catadioptric;
+ float lensshift;
} NodeBokehImage;
typedef struct NodeBoxMask {
- float x;
- float y;
- float rotation;
- float height;
- float width;
- char _pad[4];
+ float x;
+ float y;
+ float rotation;
+ float height;
+ float width;
+ char _pad[4];
} NodeBoxMask;
typedef struct NodeEllipseMask {
- float x;
- float y;
- float rotation;
- float height;
- float width;
- char _pad[4];
+ float x;
+ float y;
+ float rotation;
+ float height;
+ float width;
+ char _pad[4];
} NodeEllipseMask;
/* layer info for image node outputs */
typedef struct NodeImageLayer {
- /* index in the Image->layers->passes lists */
- int pass_index DNA_DEPRECATED;
- /* render pass name */
- /** Amount defined in openexr_multi.h. */
- char pass_name[64];
+ /* index in the Image->layers->passes lists */
+ int pass_index DNA_DEPRECATED;
+ /* render pass name */
+ /** Amount defined in openexr_multi.h. */
+ char pass_name[64];
} NodeImageLayer;
typedef struct NodeBlurData {
- short sizex, sizey;
- short samples, maxspeed, minspeed, relative, aspect;
- short curved;
- float fac, percentx, percenty;
- short filtertype;
- char bokeh, gamma;
- /** Needed for absolute/relative conversions. */
- int image_in_width, image_in_height;
+ short sizex, sizey;
+ short samples, maxspeed, minspeed, relative, aspect;
+ short curved;
+ float fac, percentx, percenty;
+ short filtertype;
+ char bokeh, gamma;
+ /** Needed for absolute/relative conversions. */
+ int image_in_width, image_in_height;
} NodeBlurData;
typedef struct NodeDBlurData {
- float center_x, center_y, distance, angle, spin, zoom;
- short iter;
- char wrap, _pad;
+ float center_x, center_y, distance, angle, spin, zoom;
+ short iter;
+ char wrap, _pad;
} NodeDBlurData;
typedef struct NodeBilateralBlurData {
- float sigma_color, sigma_space;
- short iter;
- char _pad[2];
+ float sigma_color, sigma_space;
+ short iter;
+ char _pad[2];
} NodeBilateralBlurData;
/* NOTE: Only for do-version code. */
typedef struct NodeHueSat {
- float hue, sat, val;
+ float hue, sat, val;
} NodeHueSat;
typedef struct NodeImageFile {
- /** 1024 = FILE_MAX. */
- char name[1024];
- struct ImageFormatData im_format;
- int sfra, efra;
+ /** 1024 = FILE_MAX. */
+ char name[1024];
+ struct ImageFormatData im_format;
+ int sfra, efra;
} NodeImageFile;
/* XXX first struct fields should match NodeImageFile to ensure forward compatibility */
typedef struct NodeImageMultiFile {
- /** 1024 = FILE_MAX. */
- char base_path[1024];
- ImageFormatData format;
- /** XXX old frame rand values from NodeImageFile for forward compatibility. */
- int sfra DNA_DEPRECATED, efra DNA_DEPRECATED;
- /** Selected input in details view list. */
- int active_input;
- char _pad[4];
+ /** 1024 = FILE_MAX. */
+ char base_path[1024];
+ ImageFormatData format;
+ /** XXX old frame rand values from NodeImageFile for forward compatibility. */
+ int sfra DNA_DEPRECATED, efra DNA_DEPRECATED;
+ /** Selected input in details view list. */
+ int active_input;
+ char _pad[4];
} NodeImageMultiFile;
typedef struct NodeImageMultiFileSocket {
- /* single layer file output */
- short use_render_format DNA_DEPRECATED;
- /** Use overall node image format. */
- short use_node_format;
- char _pad1[4];
- /** 1024 = FILE_MAX. */
- char path[1024];
- ImageFormatData format;
-
- /* multilayer output */
- /** EXR_TOT_MAXNAME-2 ('.' and channel char are appended). */
- char layer[30];
- char _pad2[2];
+ /* single layer file output */
+ short use_render_format DNA_DEPRECATED;
+ /** Use overall node image format. */
+ short use_node_format;
+ char _pad1[4];
+ /** 1024 = FILE_MAX. */
+ char path[1024];
+ ImageFormatData format;
+
+ /* multilayer output */
+ /** EXR_TOT_MAXNAME-2 ('.' and channel char are appended). */
+ char layer[30];
+ char _pad2[2];
} NodeImageMultiFileSocket;
typedef struct NodeChroma {
- float t1, t2, t3;
- float fsize, fstrength, falpha;
- float key[4];
- short algorithm, channel;
+ float t1, t2, t3;
+ float fsize, fstrength, falpha;
+ float key[4];
+ short algorithm, channel;
} NodeChroma;
typedef struct NodeTwoXYs {
- short x1, x2, y1, y2;
- float fac_x1, fac_x2, fac_y1, fac_y2;
+ short x1, x2, y1, y2;
+ float fac_x1, fac_x2, fac_y1, fac_y2;
} NodeTwoXYs;
typedef struct NodeTwoFloats {
- float x, y;
+ float x, y;
} NodeTwoFloats;
typedef struct NodeVertexCol {
- char name[64];
+ char name[64];
} NodeVertexCol;
/* qdn: Defocus blur node */
typedef struct NodeDefocus {
- char bktype, _pad0, preview, gamco;
- short samples, no_zbuf;
- float fstop, maxblur, bthresh, scale;
- float rotation;
- char _pad1[4];
+ char bktype, _pad0, preview, gamco;
+ short samples, no_zbuf;
+ float fstop, maxblur, bthresh, scale;
+ float rotation;
+ char _pad1[4];
} NodeDefocus;
typedef struct NodeScriptDict {
- /** For PyObject *dict. */
- void *dict;
- /** For BPy_Node *node. */
- void *node;
+ /** For PyObject *dict. */
+ void *dict;
+ /** For BPy_Node *node. */
+ void *node;
} NodeScriptDict;
/* qdn: glare node */
typedef struct NodeGlare {
- char quality, type, iter;
- /* XXX angle is only kept for backward/forward compatibility,
- * was used for two different things, see T50736. */
- char angle DNA_DEPRECATED, _pad0, size, star_45, streaks;
- float colmod, mix, threshold, fade;
- float angle_ofs;
- char _pad1[4];
+ char quality, type, iter;
+ /* XXX angle is only kept for backward/forward compatibility,
+ * was used for two different things, see T50736. */
+ char angle DNA_DEPRECATED, _pad0, size, star_45, streaks;
+ float colmod, mix, threshold, fade;
+ float angle_ofs;
+ char _pad1[4];
} NodeGlare;
/* qdn: tonemap node */
typedef struct NodeTonemap {
- float key, offset, gamma;
- float f, m, a, c;
- int type;
+ float key, offset, gamma;
+ float f, m, a, c;
+ int type;
} NodeTonemap;
/* qdn: lens distortion node */
typedef struct NodeLensDist {
- short jit, proj, fit;
- char _pad[2];
+ short jit, proj, fit;
+ char _pad[2];
} NodeLensDist;
typedef struct NodeColorBalance {
- /* ASC CDL parameters */
- float slope[3];
- float offset[3];
- float power[3];
- float offset_basis;
- char _pad[4];
-
- /* LGG parameters */
- float lift[3];
- float gamma[3];
- float gain[3];
+ /* ASC CDL parameters */
+ float slope[3];
+ float offset[3];
+ float power[3];
+ float offset_basis;
+ char _pad[4];
+
+ /* LGG parameters */
+ float lift[3];
+ float gamma[3];
+ float gain[3];
} NodeColorBalance;
typedef struct NodeColorspill {
- short limchan, unspill;
- float limscale;
- float uspillr, uspillg, uspillb;
+ short limchan, unspill;
+ float limscale;
+ float uspillr, uspillg, uspillb;
} NodeColorspill;
typedef struct NodeDilateErode {
- char falloff;
- char _pad[7];
+ char falloff;
+ char _pad[7];
} NodeDilateErode;
typedef struct NodeMask {
- int size_x, size_y;
+ int size_x, size_y;
} NodeMask;
typedef struct NodeTexBase {
- TexMapping tex_mapping;
- ColorMapping color_mapping;
+ TexMapping tex_mapping;
+ ColorMapping color_mapping;
} NodeTexBase;
typedef struct NodeTexSky {
- NodeTexBase base;
- int sky_model;
- float sun_direction[3];
- float turbidity;
- float ground_albedo;
+ NodeTexBase base;
+ int sky_model;
+ float sun_direction[3];
+ float turbidity;
+ float ground_albedo;
} NodeTexSky;
typedef struct NodeTexImage {
- NodeTexBase base;
- ImageUser iuser;
- int color_space;
- int projection;
- float projection_blend;
- int interpolation;
- int extension;
- char _pad[4];
+ NodeTexBase base;
+ ImageUser iuser;
+ int color_space;
+ int projection;
+ float projection_blend;
+ int interpolation;
+ int extension;
+ char _pad[4];
} NodeTexImage;
typedef struct NodeTexChecker {
- NodeTexBase base;
+ NodeTexBase base;
} NodeTexChecker;
typedef struct NodeTexBrick {
- NodeTexBase base;
- int offset_freq, squash_freq;
- float offset, squash;
+ NodeTexBase base;
+ int offset_freq, squash_freq;
+ float offset, squash;
} NodeTexBrick;
typedef struct NodeTexEnvironment {
- NodeTexBase base;
- ImageUser iuser;
- int color_space;
- int projection;
- int interpolation;
- char _pad[4];
+ NodeTexBase base;
+ ImageUser iuser;
+ int color_space;
+ int projection;
+ int interpolation;
+ char _pad[4];
} NodeTexEnvironment;
typedef struct NodeTexGradient {
- NodeTexBase base;
- int gradient_type;
- char _pad[4];
+ NodeTexBase base;
+ int gradient_type;
+ char _pad[4];
} NodeTexGradient;
typedef struct NodeTexNoise {
- NodeTexBase base;
+ NodeTexBase base;
} NodeTexNoise;
typedef struct NodeTexVoronoi {
- NodeTexBase base;
- int coloring;
- int distance;
- int feature;
- char _pad[4];
+ NodeTexBase base;
+ int coloring;
+ int distance;
+ int feature;
+ char _pad[4];
} NodeTexVoronoi;
typedef struct NodeTexMusgrave {
- NodeTexBase base;
- int musgrave_type;
- char _pad[4];
+ NodeTexBase base;
+ int musgrave_type;
+ char _pad[4];
} NodeTexMusgrave;
typedef struct NodeTexWave {
- NodeTexBase base;
- int wave_type;
- int wave_profile;
+ NodeTexBase base;
+ int wave_type;
+ int wave_profile;
} NodeTexWave;
typedef struct NodeTexMagic {
- NodeTexBase base;
- int depth;
- char _pad[4];
+ NodeTexBase base;
+ int depth;
+ char _pad[4];
} NodeTexMagic;
typedef struct NodeShaderAttribute {
- char name[64];
+ char name[64];
} NodeShaderAttribute;
typedef struct NodeShaderVectTransform {
- int type;
- int convert_from, convert_to;
- char _pad[4];
+ int type;
+ int convert_from, convert_to;
+ char _pad[4];
} NodeShaderVectTransform;
typedef struct NodeShaderTexPointDensity {
- NodeTexBase base;
- short point_source;
- char _pad[2];
- int particle_system;
- float radius;
- int resolution;
- short space;
- short interpolation;
- short color_source;
- short ob_color_source;
- /** Vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME. */
- char vertex_attribute_name[64];
- /* Used at runtime only by sampling RNA API. */
- PointDensity pd;
- int cached_resolution;
- char _pad2[4];
+ NodeTexBase base;
+ short point_source;
+ char _pad[2];
+ int particle_system;
+ float radius;
+ int resolution;
+ short space;
+ short interpolation;
+ short color_source;
+ short ob_color_source;
+ /** Vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME. */
+ char vertex_attribute_name[64];
+ /* Used at runtime only by sampling RNA API. */
+ PointDensity pd;
+ int cached_resolution;
+ char _pad2[4];
} NodeShaderTexPointDensity;
/* TEX_output */
typedef struct TexNodeOutput {
- char name[64];
+ char name[64];
} TexNodeOutput;
typedef struct NodeKeyingScreenData {
- char tracking_object[64];
+ char tracking_object[64];
} NodeKeyingScreenData;
typedef struct NodeKeyingData {
- float screen_balance;
- float despill_factor;
- float despill_balance;
- int edge_kernel_radius;
- float edge_kernel_tolerance;
- float clip_black, clip_white;
- int dilate_distance;
- int feather_distance;
- int feather_falloff;
- int blur_pre, blur_post;
+ float screen_balance;
+ float despill_factor;
+ float despill_balance;
+ int edge_kernel_radius;
+ float edge_kernel_tolerance;
+ float clip_black, clip_white;
+ int dilate_distance;
+ int feather_distance;
+ int feather_falloff;
+ int blur_pre, blur_post;
} NodeKeyingData;
typedef struct NodeTrackPosData {
- char tracking_object[64];
- char track_name[64];
+ char tracking_object[64];
+ char track_name[64];
} NodeTrackPosData;
typedef struct NodeTranslateData {
- char wrap_axis;
- char relative;
- char _pad[6];
+ char wrap_axis;
+ char relative;
+ char _pad[6];
} NodeTranslateData;
typedef struct NodePlaneTrackDeformData {
- char tracking_object[64];
- char plane_track_name[64];
- char flag;
- char motion_blur_samples;
- char _pad[2];
- float motion_blur_shutter;
+ char tracking_object[64];
+ char plane_track_name[64];
+ char flag;
+ char motion_blur_samples;
+ char _pad[2];
+ float motion_blur_shutter;
} NodePlaneTrackDeformData;
typedef struct NodeShaderScript {
- int mode;
- int flag;
+ int mode;
+ int flag;
- /** 1024 = FILE_MAX. */
- char filepath[1024];
+ /** 1024 = FILE_MAX. */
+ char filepath[1024];
- char bytecode_hash[64];
- char *bytecode;
+ char bytecode_hash[64];
+ char *bytecode;
} NodeShaderScript;
typedef struct NodeShaderTangent {
- int direction_type;
- int axis;
- char uv_map[64];
+ int direction_type;
+ int axis;
+ char uv_map[64];
} NodeShaderTangent;
typedef struct NodeShaderNormalMap {
- int space;
- char uv_map[64];
+ int space;
+ char uv_map[64];
} NodeShaderNormalMap;
typedef struct NodeShaderUVMap {
- char uv_map[64];
+ char uv_map[64];
} NodeShaderUVMap;
typedef struct NodeShaderTexIES {
- int mode;
+ int mode;
- /** 1024 = FILE_MAX. */
- char filepath[1024];
+ /** 1024 = FILE_MAX. */
+ char filepath[1024];
} NodeShaderTexIES;
typedef struct NodeSunBeams {
- float source[2];
+ float source[2];
- float ray_length;
+ float ray_length;
} NodeSunBeams;
typedef struct NodeCryptomatte {
- float add[3];
- float remove[3];
- char *matte_id;
- int num_inputs;
- char _pad[4];
+ float add[3];
+ float remove[3];
+ char *matte_id;
+ int num_inputs;
+ char _pad[4];
} NodeCryptomatte;
/* script node mode */
-#define NODE_SCRIPT_INTERNAL 0
-#define NODE_SCRIPT_EXTERNAL 1
+#define NODE_SCRIPT_INTERNAL 0
+#define NODE_SCRIPT_EXTERNAL 1
/* script node flag */
-#define NODE_SCRIPT_AUTO_UPDATE 1
+#define NODE_SCRIPT_AUTO_UPDATE 1
/* ies node mode */
-#define NODE_IES_INTERNAL 0
-#define NODE_IES_EXTERNAL 1
+#define NODE_IES_INTERNAL 0
+#define NODE_IES_EXTERNAL 1
/* frame node flags */
-#define NODE_FRAME_SHRINK 1 /* keep the bounding box minimal */
-#define NODE_FRAME_RESIZEABLE 2 /* test flag, if frame can be resized by user */
+#define NODE_FRAME_SHRINK 1 /* keep the bounding box minimal */
+#define NODE_FRAME_RESIZEABLE 2 /* test flag, if frame can be resized by user */
/* proxy node flags */
-#define NODE_PROXY_AUTOTYPE 1 /* automatically change output type based on link */
+#define NODE_PROXY_AUTOTYPE 1 /* automatically change output type based on link */
/* comp channel matte */
-#define CMP_NODE_CHANNEL_MATTE_CS_RGB 1
-#define CMP_NODE_CHANNEL_MATTE_CS_HSV 2
-#define CMP_NODE_CHANNEL_MATTE_CS_YUV 3
-#define CMP_NODE_CHANNEL_MATTE_CS_YCC 4
+#define CMP_NODE_CHANNEL_MATTE_CS_RGB 1
+#define CMP_NODE_CHANNEL_MATTE_CS_HSV 2
+#define CMP_NODE_CHANNEL_MATTE_CS_YUV 3
+#define CMP_NODE_CHANNEL_MATTE_CS_YCC 4
/* glossy distributions */
-#define SHD_GLOSSY_BECKMANN 0
-#define SHD_GLOSSY_SHARP 1
-#define SHD_GLOSSY_GGX 2
-#define SHD_GLOSSY_ASHIKHMIN_SHIRLEY 3
-#define SHD_GLOSSY_MULTI_GGX 4
+#define SHD_GLOSSY_BECKMANN 0
+#define SHD_GLOSSY_SHARP 1
+#define SHD_GLOSSY_GGX 2
+#define SHD_GLOSSY_ASHIKHMIN_SHIRLEY 3
+#define SHD_GLOSSY_MULTI_GGX 4
/* vector transform */
-#define SHD_VECT_TRANSFORM_TYPE_VECTOR 0
-#define SHD_VECT_TRANSFORM_TYPE_POINT 1
-#define SHD_VECT_TRANSFORM_TYPE_NORMAL 2
+#define SHD_VECT_TRANSFORM_TYPE_VECTOR 0
+#define SHD_VECT_TRANSFORM_TYPE_POINT 1
+#define SHD_VECT_TRANSFORM_TYPE_NORMAL 2
-#define SHD_VECT_TRANSFORM_SPACE_WORLD 0
-#define SHD_VECT_TRANSFORM_SPACE_OBJECT 1
-#define SHD_VECT_TRANSFORM_SPACE_CAMERA 2
+#define SHD_VECT_TRANSFORM_SPACE_WORLD 0
+#define SHD_VECT_TRANSFORM_SPACE_OBJECT 1
+#define SHD_VECT_TRANSFORM_SPACE_CAMERA 2
/* toon modes */
-#define SHD_TOON_DIFFUSE 0
-#define SHD_TOON_GLOSSY 1
+#define SHD_TOON_DIFFUSE 0
+#define SHD_TOON_GLOSSY 1
/* hair components */
-#define SHD_HAIR_REFLECTION 0
-#define SHD_HAIR_TRANSMISSION 1
+#define SHD_HAIR_REFLECTION 0
+#define SHD_HAIR_TRANSMISSION 1
/* principled hair parametrization */
-#define SHD_PRINCIPLED_HAIR_REFLECTANCE 0
-#define SHD_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION 1
-#define SHD_PRINCIPLED_HAIR_DIRECT_ABSORPTION 2
+#define SHD_PRINCIPLED_HAIR_REFLECTANCE 0
+#define SHD_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION 1
+#define SHD_PRINCIPLED_HAIR_DIRECT_ABSORPTION 2
/* blend texture */
-#define SHD_BLEND_LINEAR 0
-#define SHD_BLEND_QUADRATIC 1
-#define SHD_BLEND_EASING 2
-#define SHD_BLEND_DIAGONAL 3
-#define SHD_BLEND_RADIAL 4
-#define SHD_BLEND_QUADRATIC_SPHERE 5
-#define SHD_BLEND_SPHERICAL 6
+#define SHD_BLEND_LINEAR 0
+#define SHD_BLEND_QUADRATIC 1
+#define SHD_BLEND_EASING 2
+#define SHD_BLEND_DIAGONAL 3
+#define SHD_BLEND_RADIAL 4
+#define SHD_BLEND_QUADRATIC_SPHERE 5
+#define SHD_BLEND_SPHERICAL 6
/* noise basis for textures */
-#define SHD_NOISE_PERLIN 0
-#define SHD_NOISE_VORONOI_F1 1
-#define SHD_NOISE_VORONOI_F2 2
-#define SHD_NOISE_VORONOI_F3 3
-#define SHD_NOISE_VORONOI_F4 4
-#define SHD_NOISE_VORONOI_F2_F1 5
-#define SHD_NOISE_VORONOI_CRACKLE 6
-#define SHD_NOISE_CELL_NOISE 7
-
-#define SHD_NOISE_SOFT 0
-#define SHD_NOISE_HARD 1
+#define SHD_NOISE_PERLIN 0
+#define SHD_NOISE_VORONOI_F1 1
+#define SHD_NOISE_VORONOI_F2 2
+#define SHD_NOISE_VORONOI_F3 3
+#define SHD_NOISE_VORONOI_F4 4
+#define SHD_NOISE_VORONOI_F2_F1 5
+#define SHD_NOISE_VORONOI_CRACKLE 6
+#define SHD_NOISE_CELL_NOISE 7
+
+#define SHD_NOISE_SOFT 0
+#define SHD_NOISE_HARD 1
/* voronoi texture */
-#define SHD_VORONOI_DISTANCE 0
-#define SHD_VORONOI_MANHATTAN 1
-#define SHD_VORONOI_CHEBYCHEV 2
-#define SHD_VORONOI_MINKOWSKI 3
+#define SHD_VORONOI_DISTANCE 0
+#define SHD_VORONOI_MANHATTAN 1
+#define SHD_VORONOI_CHEBYCHEV 2
+#define SHD_VORONOI_MINKOWSKI 3
-#define SHD_VORONOI_INTENSITY 0
-#define SHD_VORONOI_CELLS 1
+#define SHD_VORONOI_INTENSITY 0
+#define SHD_VORONOI_CELLS 1
-#define SHD_VORONOI_F1 0
-#define SHD_VORONOI_F2 1
-#define SHD_VORONOI_F3 2
-#define SHD_VORONOI_F4 3
-#define SHD_VORONOI_F2F1 4
+#define SHD_VORONOI_F1 0
+#define SHD_VORONOI_F2 1
+#define SHD_VORONOI_F3 2
+#define SHD_VORONOI_F4 3
+#define SHD_VORONOI_F2F1 4
/* musgrave texture */
-#define SHD_MUSGRAVE_MULTIFRACTAL 0
-#define SHD_MUSGRAVE_FBM 1
-#define SHD_MUSGRAVE_HYBRID_MULTIFRACTAL 2
-#define SHD_MUSGRAVE_RIDGED_MULTIFRACTAL 3
-#define SHD_MUSGRAVE_HETERO_TERRAIN 4
+#define SHD_MUSGRAVE_MULTIFRACTAL 0
+#define SHD_MUSGRAVE_FBM 1
+#define SHD_MUSGRAVE_HYBRID_MULTIFRACTAL 2
+#define SHD_MUSGRAVE_RIDGED_MULTIFRACTAL 3
+#define SHD_MUSGRAVE_HETERO_TERRAIN 4
/* wave texture */
-#define SHD_WAVE_BANDS 0
-#define SHD_WAVE_RINGS 1
+#define SHD_WAVE_BANDS 0
+#define SHD_WAVE_RINGS 1
-#define SHD_WAVE_PROFILE_SIN 0
-#define SHD_WAVE_PROFILE_SAW 1
+#define SHD_WAVE_PROFILE_SIN 0
+#define SHD_WAVE_PROFILE_SAW 1
/* sky texture */
-#define SHD_SKY_OLD 0
-#define SHD_SKY_NEW 1
+#define SHD_SKY_OLD 0
+#define SHD_SKY_NEW 1
/* image/environment texture */
-#define SHD_COLORSPACE_NONE 0
-#define SHD_COLORSPACE_COLOR 1
+#define SHD_COLORSPACE_NONE 0
+#define SHD_COLORSPACE_COLOR 1
/* environment texture */
-#define SHD_PROJ_EQUIRECTANGULAR 0
-#define SHD_PROJ_MIRROR_BALL 1
+#define SHD_PROJ_EQUIRECTANGULAR 0
+#define SHD_PROJ_MIRROR_BALL 1
-#define SHD_IMAGE_EXTENSION_REPEAT 0
-#define SHD_IMAGE_EXTENSION_EXTEND 1
-#define SHD_IMAGE_EXTENSION_CLIP 2
+#define SHD_IMAGE_EXTENSION_REPEAT 0
+#define SHD_IMAGE_EXTENSION_EXTEND 1
+#define SHD_IMAGE_EXTENSION_CLIP 2
/* image texture */
-#define SHD_PROJ_FLAT 0
-#define SHD_PROJ_BOX 1
-#define SHD_PROJ_SPHERE 2
-#define SHD_PROJ_TUBE 3
+#define SHD_PROJ_FLAT 0
+#define SHD_PROJ_BOX 1
+#define SHD_PROJ_SPHERE 2
+#define SHD_PROJ_TUBE 3
/* image texture interpolation */
-#define SHD_INTERP_LINEAR 0
-#define SHD_INTERP_CLOSEST 1
-#define SHD_INTERP_CUBIC 2
-#define SHD_INTERP_SMART 3
+#define SHD_INTERP_LINEAR 0
+#define SHD_INTERP_CLOSEST 1
+#define SHD_INTERP_CUBIC 2
+#define SHD_INTERP_SMART 3
/* tangent */
-#define SHD_TANGENT_RADIAL 0
-#define SHD_TANGENT_UVMAP 1
+#define SHD_TANGENT_RADIAL 0
+#define SHD_TANGENT_UVMAP 1
/* tangent */
-#define SHD_TANGENT_AXIS_X 0
-#define SHD_TANGENT_AXIS_Y 1
-#define SHD_TANGENT_AXIS_Z 2
+#define SHD_TANGENT_AXIS_X 0
+#define SHD_TANGENT_AXIS_Y 1
+#define SHD_TANGENT_AXIS_Z 2
/* normal map, displacement space */
-#define SHD_SPACE_TANGENT 0
-#define SHD_SPACE_OBJECT 1
-#define SHD_SPACE_WORLD 2
-#define SHD_SPACE_BLENDER_OBJECT 3
-#define SHD_SPACE_BLENDER_WORLD 4
+#define SHD_SPACE_TANGENT 0
+#define SHD_SPACE_OBJECT 1
+#define SHD_SPACE_WORLD 2
+#define SHD_SPACE_BLENDER_OBJECT 3
+#define SHD_SPACE_BLENDER_WORLD 4
-#define SHD_AO_INSIDE 1
-#define SHD_AO_LOCAL 2
+#define SHD_AO_INSIDE 1
+#define SHD_AO_LOCAL 2
/* math node clamp */
-#define SHD_MATH_CLAMP 1
+#define SHD_MATH_CLAMP 1
/* Math node operation/ */
enum {
- NODE_MATH_ADD = 0,
- NODE_MATH_SUB = 1,
- NODE_MATH_MUL = 2,
- NODE_MATH_DIVIDE = 3,
- NODE_MATH_SIN = 4,
- NODE_MATH_COS = 5,
- NODE_MATH_TAN = 6,
- NODE_MATH_ASIN = 7,
- NODE_MATH_ACOS = 8,
- NODE_MATH_ATAN = 9,
- NODE_MATH_POW = 10,
- NODE_MATH_LOG = 11,
- NODE_MATH_MIN = 12,
- NODE_MATH_MAX = 13,
- NODE_MATH_ROUND = 14,
- NODE_MATH_LESS = 15,
- NODE_MATH_GREATER = 16,
- NODE_MATH_MOD = 17,
- NODE_MATH_ABS = 18,
- NODE_MATH_ATAN2 = 19,
- NODE_MATH_FLOOR = 20,
- NODE_MATH_CEIL = 21,
- NODE_MATH_FRACT = 22,
- NODE_MATH_SQRT = 23,
+ NODE_MATH_ADD = 0,
+ NODE_MATH_SUB = 1,
+ NODE_MATH_MUL = 2,
+ NODE_MATH_DIVIDE = 3,
+ NODE_MATH_SIN = 4,
+ NODE_MATH_COS = 5,
+ NODE_MATH_TAN = 6,
+ NODE_MATH_ASIN = 7,
+ NODE_MATH_ACOS = 8,
+ NODE_MATH_ATAN = 9,
+ NODE_MATH_POW = 10,
+ NODE_MATH_LOG = 11,
+ NODE_MATH_MIN = 12,
+ NODE_MATH_MAX = 13,
+ NODE_MATH_ROUND = 14,
+ NODE_MATH_LESS = 15,
+ NODE_MATH_GREATER = 16,
+ NODE_MATH_MOD = 17,
+ NODE_MATH_ABS = 18,
+ NODE_MATH_ATAN2 = 19,
+ NODE_MATH_FLOOR = 20,
+ NODE_MATH_CEIL = 21,
+ NODE_MATH_FRACT = 22,
+ NODE_MATH_SQRT = 23,
};
/* mix rgb node flags */
-#define SHD_MIXRGB_USE_ALPHA 1
-#define SHD_MIXRGB_CLAMP 2
+#define SHD_MIXRGB_USE_ALPHA 1
+#define SHD_MIXRGB_CLAMP 2
/* subsurface */
enum {
#ifdef DNA_DEPRECATED
- SHD_SUBSURFACE_COMPATIBLE = 0, // Deprecated
+ SHD_SUBSURFACE_COMPATIBLE = 0, // Deprecated
#endif
- SHD_SUBSURFACE_CUBIC = 1,
- SHD_SUBSURFACE_GAUSSIAN = 2,
- SHD_SUBSURFACE_BURLEY = 3,
- SHD_SUBSURFACE_RANDOM_WALK = 4,
+ SHD_SUBSURFACE_CUBIC = 1,
+ SHD_SUBSURFACE_GAUSSIAN = 2,
+ SHD_SUBSURFACE_BURLEY = 3,
+ SHD_SUBSURFACE_RANDOM_WALK = 4,
};
/* blur node */
-#define CMP_NODE_BLUR_ASPECT_NONE 0
-#define CMP_NODE_BLUR_ASPECT_Y 1
-#define CMP_NODE_BLUR_ASPECT_X 2
+#define CMP_NODE_BLUR_ASPECT_NONE 0
+#define CMP_NODE_BLUR_ASPECT_Y 1
+#define CMP_NODE_BLUR_ASPECT_X 2
/* wrapping */
-#define CMP_NODE_WRAP_NONE 0
-#define CMP_NODE_WRAP_X 1
-#define CMP_NODE_WRAP_Y 2
-#define CMP_NODE_WRAP_XY 3
+#define CMP_NODE_WRAP_NONE 0
+#define CMP_NODE_WRAP_X 1
+#define CMP_NODE_WRAP_Y 2
+#define CMP_NODE_WRAP_XY 3
#define CMP_NODE_MASK_MBLUR_SAMPLES_MAX 64
/* image */
-#define CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT 1
+#define CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT 1
/* viewer and cmposite output */
-#define CMP_NODE_OUTPUT_IGNORE_ALPHA 1
+#define CMP_NODE_OUTPUT_IGNORE_ALPHA 1
/* Plane track deform node */
enum {
- CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR = 1,
+ CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR = 1,
};
/* Stabilization node */
enum {
- CMP_NODEFLAG_STABILIZE_INVERSE = 1,
+ CMP_NODEFLAG_STABILIZE_INVERSE = 1,
};
#define CMP_NODE_PLANETRACKDEFORM_MBLUR_SAMPLES_MAX 64
@@ -1261,33 +1258,33 @@ enum {
/* Point Density shader node */
enum {
- SHD_POINTDENSITY_SOURCE_PSYS = 0,
- SHD_POINTDENSITY_SOURCE_OBJECT = 1,
+ SHD_POINTDENSITY_SOURCE_PSYS = 0,
+ SHD_POINTDENSITY_SOURCE_OBJECT = 1,
};
enum {
- SHD_POINTDENSITY_SPACE_OBJECT = 0,
- SHD_POINTDENSITY_SPACE_WORLD = 1,
+ SHD_POINTDENSITY_SPACE_OBJECT = 0,
+ SHD_POINTDENSITY_SPACE_WORLD = 1,
};
enum {
- SHD_POINTDENSITY_COLOR_PARTAGE = 1,
- SHD_POINTDENSITY_COLOR_PARTSPEED = 2,
- SHD_POINTDENSITY_COLOR_PARTVEL = 3,
+ SHD_POINTDENSITY_COLOR_PARTAGE = 1,
+ SHD_POINTDENSITY_COLOR_PARTSPEED = 2,
+ SHD_POINTDENSITY_COLOR_PARTVEL = 3,
};
enum {
- SHD_POINTDENSITY_COLOR_VERTCOL = 0,
- SHD_POINTDENSITY_COLOR_VERTWEIGHT = 1,
- SHD_POINTDENSITY_COLOR_VERTNOR = 2,
+ SHD_POINTDENSITY_COLOR_VERTCOL = 0,
+ SHD_POINTDENSITY_COLOR_VERTWEIGHT = 1,
+ SHD_POINTDENSITY_COLOR_VERTNOR = 2,
};
/* Output shader node */
typedef enum NodeShaderOutputTarget {
- SHD_OUTPUT_ALL = 0,
- SHD_OUTPUT_EEVEE = 1,
- SHD_OUTPUT_CYCLES = 2,
+ SHD_OUTPUT_ALL = 0,
+ SHD_OUTPUT_EEVEE = 1,
+ SHD_OUTPUT_CYCLES = 2,
} NodeShaderOutputTarget;
#endif
diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h
index 77f474eab1e..debf4c2ea6c 100644
--- a/source/blender/makesdna/DNA_object_enums.h
+++ b/source/blender/makesdna/DNA_object_enums.h
@@ -25,30 +25,32 @@
/* Object.mode */
typedef enum eObjectMode {
- 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 = 1 << 7,
- OB_MODE_PAINT_GPENCIL = 1 << 8,
- OB_MODE_SCULPT_GPENCIL = 1 << 9,
- OB_MODE_WEIGHT_GPENCIL = 1 << 10,
+ 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 = 1 << 7,
+ OB_MODE_PAINT_GPENCIL = 1 << 8,
+ OB_MODE_SCULPT_GPENCIL = 1 << 9,
+ OB_MODE_WEIGHT_GPENCIL = 1 << 10,
} eObjectMode;
/* 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 \
+ (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)
-#define OB_MODE_ALL_PAINT_GPENCIL (OB_MODE_PAINT_GPENCIL | OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL)
+#define OB_MODE_ALL_PAINT_GPENCIL \
+ (OB_MODE_PAINT_GPENCIL | OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL)
/* Any mode that uses Object.sculpt. */
#define OB_MODE_ALL_SCULPT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)
/* Any mode that has data 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_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE)
-#endif /* __DNA_OBJECT_ENUMS_H__ */
+#endif /* __DNA_OBJECT_ENUMS_H__ */
diff --git a/source/blender/makesdna/DNA_object_fluidsim_types.h b/source/blender/makesdna/DNA_object_fluidsim_types.h
index 843a9ae5c5b..40502fc27c9 100644
--- a/source/blender/makesdna/DNA_object_fluidsim_types.h
+++ b/source/blender/makesdna/DNA_object_fluidsim_types.h
@@ -35,156 +35,156 @@ struct Ipo;
struct Mesh;
typedef struct FluidVertexVelocity {
- float vel[3];
+ float vel[3];
} FluidVertexVelocity;
typedef struct FluidsimSettings {
- /** For fast RNA access. */
- struct FluidsimModifierData *fmd;
- /* threadcont the calculation is done with */
- int threads;
- char _pad1[4];
- /* domain, fluid or obstacle */
- short type;
- /* display advanced options in fluid sim tab (on=1, off=0)*/
- short show_advancedoptions;
-
- /* domain object settings */
- /* resolutions */
- short resolutionxyz;
- short previewresxyz;
- /* size of the domain in real units (meters along largest resolution x, y, z extent) */
- float realsize;
- /* show original meshes, preview or final sim */
- short guiDisplayMode;
- short renderDisplayMode;
-
- /* fluid properties */
- float viscosityValue;
- short viscosityMode DNA_DEPRECATED;
- short viscosityExponent;
- /* gravity strength */
- float grav[3];
- /* anim start end time (in seconds) */
- float animStart, animEnd;
- /* bake start end time (in blender frames) */
- int bakeStart, bakeEnd;
- /* offset for baked frames */
- int frameOffset;
- char _pad2[4];
- /* g star param (LBM compressibility) */
- float gstar;
- /* activate refinement? */
- int maxRefine;
-
- /* fluid object type settings */
- /* gravity strength */
- float iniVelx, iniVely, iniVelz;
-
- /* store output path, and file prefix for baked fluid surface */
- /* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
- char surfdataPath[1024];
-
- /* store start coords of axis aligned bounding box together with size */
- /* values are inited during derived mesh display */
- float bbStart[3], bbSize[3];
-
- /* animated params */
- struct Ipo *ipo;
-
- /* additional flags depending on the type, lower short contains flags
- * to check validity, higher short additional flags */
- short typeFlags;
- /**
- * Switch off velocity generation,
- * volume init type for fluid/obstacles (volume=1, shell=2, both=3).
- */
- char domainNovecgen, volumeInitType;
-
- /* boundary "stickiness" for part slip values */
- float partSlipValue;
-
- /* number of tracers to generate */
- int generateTracers;
- /* particle generation - on if >0, then determines amount (experimental...) */
- float generateParticles;
- /* smooth fluid surface? */
- float surfaceSmoothing;
- /** Number of surface subdivisions. */
- int surfaceSubdivs;
- /** GUI flags. */
- int flag;
-
- /** Particle display - size scaling, and alpha influence. */
- float particleInfSize, particleInfAlpha;
- /* testing vars */
- float farFieldSize;
-
- /** Vertex velocities of simulated fluid mesh. */
- struct FluidVertexVelocity *meshVelocities;
- /** Number of vertices in simulated fluid mesh. */
- int totvert;
-
- /* Fluid control settings */
- float cpsTimeStart;
- float cpsTimeEnd;
- float cpsQuality;
-
- float attractforceStrength;
- float attractforceRadius;
- float velocityforceStrength;
- float velocityforceRadius;
-
- int lastgoodframe;
-
- /** Simulation/flow rate control (i.e. old "Fac-Time"). */
- float animRate;
+ /** For fast RNA access. */
+ struct FluidsimModifierData *fmd;
+ /* threadcont the calculation is done with */
+ int threads;
+ char _pad1[4];
+ /* domain, fluid or obstacle */
+ short type;
+ /* display advanced options in fluid sim tab (on=1, off=0)*/
+ short show_advancedoptions;
+
+ /* domain object settings */
+ /* resolutions */
+ short resolutionxyz;
+ short previewresxyz;
+ /* size of the domain in real units (meters along largest resolution x, y, z extent) */
+ float realsize;
+ /* show original meshes, preview or final sim */
+ short guiDisplayMode;
+ short renderDisplayMode;
+
+ /* fluid properties */
+ float viscosityValue;
+ short viscosityMode DNA_DEPRECATED;
+ short viscosityExponent;
+ /* gravity strength */
+ float grav[3];
+ /* anim start end time (in seconds) */
+ float animStart, animEnd;
+ /* bake start end time (in blender frames) */
+ int bakeStart, bakeEnd;
+ /* offset for baked frames */
+ int frameOffset;
+ char _pad2[4];
+ /* g star param (LBM compressibility) */
+ float gstar;
+ /* activate refinement? */
+ int maxRefine;
+
+ /* fluid object type settings */
+ /* gravity strength */
+ float iniVelx, iniVely, iniVelz;
+
+ /* store output path, and file prefix for baked fluid surface */
+ /* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
+ char surfdataPath[1024];
+
+ /* store start coords of axis aligned bounding box together with size */
+ /* values are inited during derived mesh display */
+ float bbStart[3], bbSize[3];
+
+ /* animated params */
+ struct Ipo *ipo;
+
+ /* additional flags depending on the type, lower short contains flags
+ * to check validity, higher short additional flags */
+ short typeFlags;
+ /**
+ * Switch off velocity generation,
+ * volume init type for fluid/obstacles (volume=1, shell=2, both=3).
+ */
+ char domainNovecgen, volumeInitType;
+
+ /* boundary "stickiness" for part slip values */
+ float partSlipValue;
+
+ /* number of tracers to generate */
+ int generateTracers;
+ /* particle generation - on if >0, then determines amount (experimental...) */
+ float generateParticles;
+ /* smooth fluid surface? */
+ float surfaceSmoothing;
+ /** Number of surface subdivisions. */
+ int surfaceSubdivs;
+ /** GUI flags. */
+ int flag;
+
+ /** Particle display - size scaling, and alpha influence. */
+ float particleInfSize, particleInfAlpha;
+ /* testing vars */
+ float farFieldSize;
+
+ /** Vertex velocities of simulated fluid mesh. */
+ struct FluidVertexVelocity *meshVelocities;
+ /** Number of vertices in simulated fluid mesh. */
+ int totvert;
+
+ /* Fluid control settings */
+ float cpsTimeStart;
+ float cpsTimeEnd;
+ float cpsQuality;
+
+ float attractforceStrength;
+ float attractforceRadius;
+ float velocityforceStrength;
+ float velocityforceRadius;
+
+ int lastgoodframe;
+
+ /** Simulation/flow rate control (i.e. old "Fac-Time"). */
+ float animRate;
} FluidsimSettings;
/* ob->fluidsimSettings defines */
-#define OB_FLUIDSIM_ENABLE 1
-#define OB_FLUIDSIM_DOMAIN 2
-#define OB_FLUIDSIM_FLUID 4
-#define OB_FLUIDSIM_OBSTACLE 8
-#define OB_FLUIDSIM_INFLOW 16
-#define OB_FLUIDSIM_OUTFLOW 32
-#define OB_FLUIDSIM_PARTICLE 64
-#define OB_FLUIDSIM_CONTROL 128
-
-#define OB_TYPEFLAG_START 7
-#define OB_FSGEO_THIN (1 << (OB_TYPEFLAG_START + 1))
-#define OB_FSBND_NOSLIP (1 << (OB_TYPEFLAG_START + 2))
-#define OB_FSBND_PARTSLIP (1 << (OB_TYPEFLAG_START + 3))
-#define OB_FSBND_FREESLIP (1 << (OB_TYPEFLAG_START + 4))
-#define OB_FSINFLOW_LOCALCOORD (1 << (OB_TYPEFLAG_START + 5))
+#define OB_FLUIDSIM_ENABLE 1
+#define OB_FLUIDSIM_DOMAIN 2
+#define OB_FLUIDSIM_FLUID 4
+#define OB_FLUIDSIM_OBSTACLE 8
+#define OB_FLUIDSIM_INFLOW 16
+#define OB_FLUIDSIM_OUTFLOW 32
+#define OB_FLUIDSIM_PARTICLE 64
+#define OB_FLUIDSIM_CONTROL 128
+
+#define OB_TYPEFLAG_START 7
+#define OB_FSGEO_THIN (1 << (OB_TYPEFLAG_START + 1))
+#define OB_FSBND_NOSLIP (1 << (OB_TYPEFLAG_START + 2))
+#define OB_FSBND_PARTSLIP (1 << (OB_TYPEFLAG_START + 3))
+#define OB_FSBND_FREESLIP (1 << (OB_TYPEFLAG_START + 4))
+#define OB_FSINFLOW_LOCALCOORD (1 << (OB_TYPEFLAG_START + 5))
/* surface generation flag (part of enabling chapter 6 of
* "Free Surface Flows with Moving and Deforming Objects for LBM") */
-#define OB_FSSG_NOOBS (1 << (OB_TYPEFLAG_START + 6))
+#define OB_FSSG_NOOBS (1 << (OB_TYPEFLAG_START + 6))
// guiDisplayMode particle flags
-#define OB_FSDOM_GEOM 1
-#define OB_FSDOM_PREVIEW 2
-#define OB_FSDOM_FINAL 3
-#define OB_FSPART_BUBBLE (1 << 1)
-#define OB_FSPART_DROP (1 << 2)
+#define OB_FSDOM_GEOM 1
+#define OB_FSDOM_PREVIEW 2
+#define OB_FSDOM_FINAL 3
+#define OB_FSPART_BUBBLE (1 << 1)
+#define OB_FSPART_DROP (1 << 2)
#define OB_FSPART_NEWPART (1 << 3)
-#define OB_FSPART_FLOAT (1 << 4)
-#define OB_FSPART_TRACER (1 << 5)
+#define OB_FSPART_FLOAT (1 << 4)
+#define OB_FSPART_TRACER (1 << 5)
// new fluid bit flags for fss->flags
-#define OB_FLUIDSIM_REVERSE (1 << 0)
-#define OB_FLUIDSIM_ACTIVE (1 << 1)
-#define OB_FLUIDSIM_OVERRIDE_TIME (1 << 2)
+#define OB_FLUIDSIM_REVERSE (1 << 0)
+#define OB_FLUIDSIM_ACTIVE (1 << 1)
+#define OB_FLUIDSIM_OVERRIDE_TIME (1 << 2)
#define OB_FLUIDSIM_SURF_DIR_DEFAULT "cache_fluid"
#define OB_FLUIDSIM_SURF_PREVIEW_OBJ_FNAME "fluidsurface_preview_####.bobj.gz"
-#define OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME "fluidsurface_final_####.bobj.gz"
-#define OB_FLUIDSIM_SURF_FINAL_VEL_FNAME "fluidsurface_final_####.bvel.gz"
-#define OB_FLUIDSIM_SURF_PARTICLES_FNAME "fluidsurface_particles_####.gz"
+#define OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME "fluidsurface_final_####.bobj.gz"
+#define OB_FLUIDSIM_SURF_FINAL_VEL_FNAME "fluidsurface_final_####.bvel.gz"
+#define OB_FLUIDSIM_SURF_PARTICLES_FNAME "fluidsurface_particles_####.gz"
#ifdef __cplusplus
}
#endif
-#endif /* __DNA_OBJECT_FLUIDSIM_TYPES_H__ */
+#endif /* __DNA_OBJECT_FLUIDSIM_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index df77bbc5744..7b3dfc4f4f3 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -33,157 +33,157 @@ extern "C" {
/* pd->forcefield: Effector Fields types */
typedef enum ePFieldType {
- /** (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_gTurbulence. */
- PFIELD_TURBULENCE = 11,
- /** Linear & quadratic drag. */
- PFIELD_DRAG = 12,
- /** Force based on smoke simulation air flow. */
- PFIELD_SMOKEFLOW = 13,
-
- NUM_PFIELD_TYPES,
+ /** (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_gTurbulence. */
+ PFIELD_TURBULENCE = 11,
+ /** Linear & quadratic drag. */
+ PFIELD_DRAG = 12,
+ /** Force based on smoke simulation air flow. */
+ PFIELD_SMOKEFLOW = 13,
+
+ NUM_PFIELD_TYPES,
} ePFieldType;
typedef struct PartDeflect {
- /** General settings flag. */
- int flag;
- /** Deflection flag - does mesh deflect particles. */
- short deflect;
- /** Force field type, do the vertices attract / repel particles? */
- short forcefield;
- /** Fall-off type. */
- short falloff;
- /** Point, plane or surface. */
- short shape;
- /** Texture effector. */
- short tex_mode;
- /** For curve guide. */
- short kink, kink_axis;
- short zdir;
-
- /* Main effector values */
- /** The strength of the force (+ or - ). */
- float f_strength;
- /** Damping ratio of the harmonic effector. */
- float f_damp;
- /**
- * How much force is converted into "air flow", i.e.
- * force used as the velocity of surrounding medium. */
- float f_flow;
-
- /** Noise size for noise effector, restlength for harmonic effector. */
- float f_size;
-
- /* fall-off */
- /** The power law - real gravitation is 2 (square). */
- float f_power;
- /** If indicated, use this maximum. */
- float maxdist;
- /** If indicated, use this minimum. */
- float mindist;
- /** Radial fall-off power. */
- float f_power_r;
- /** Radial versions of above. */
- float maxrad;
- float minrad;
-
- /* particle collisions */
- /** Damping factor for particle deflection. */
- float pdef_damp;
- /** Random element of damping for deflection. */
- float pdef_rdamp;
- /** Chance of particle passing through mesh. */
- float pdef_perm;
- /** Friction factor for particle deflection. */
- float pdef_frict;
- /** Random element of friction for deflection. */
- float pdef_rfrict;
- /** Surface particle stickiness. */
- float pdef_stickness;
-
- /** Used for forces. */
- float absorption;
-
- /* softbody collisions */
- /** Damping factor for softbody deflection. */
- float pdef_sbdamp;
- /** Inner face thickness for softbody deflection. */
- float pdef_sbift;
- /** Outer face thickness for softbody deflection. */
- float pdef_sboft;
-
- /* guide curve, same as for particle child effects */
- float clump_fac, clump_pow;
- float kink_freq, kink_shape, kink_amp, free_end;
-
- /* texture effector */
- /** Used for calculating partial derivatives. */
- float tex_nabla;
- /** Texture of the texture effector. */
- struct Tex *tex;
-
- /* effector noise */
- /** Random noise generator for e.g. wind. */
- struct RNG *rng;
- /** Noise of force. */
- float f_noise;
- /** Noise random seed. */
- int seed;
-
- /* 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;
-
- /** Friction of cloth collisions. */
- float pdef_cfrict;
- char _pad[4];
+ /** General settings flag. */
+ int flag;
+ /** Deflection flag - does mesh deflect particles. */
+ short deflect;
+ /** Force field type, do the vertices attract / repel particles? */
+ short forcefield;
+ /** Fall-off type. */
+ short falloff;
+ /** Point, plane or surface. */
+ short shape;
+ /** Texture effector. */
+ short tex_mode;
+ /** For curve guide. */
+ short kink, kink_axis;
+ short zdir;
+
+ /* Main effector values */
+ /** The strength of the force (+ or - ). */
+ float f_strength;
+ /** Damping ratio of the harmonic effector. */
+ float f_damp;
+ /**
+ * How much force is converted into "air flow", i.e.
+ * force used as the velocity of surrounding medium. */
+ float f_flow;
+
+ /** Noise size for noise effector, restlength for harmonic effector. */
+ float f_size;
+
+ /* fall-off */
+ /** The power law - real gravitation is 2 (square). */
+ float f_power;
+ /** If indicated, use this maximum. */
+ float maxdist;
+ /** If indicated, use this minimum. */
+ float mindist;
+ /** Radial fall-off power. */
+ float f_power_r;
+ /** Radial versions of above. */
+ float maxrad;
+ float minrad;
+
+ /* particle collisions */
+ /** Damping factor for particle deflection. */
+ float pdef_damp;
+ /** Random element of damping for deflection. */
+ float pdef_rdamp;
+ /** Chance of particle passing through mesh. */
+ float pdef_perm;
+ /** Friction factor for particle deflection. */
+ float pdef_frict;
+ /** Random element of friction for deflection. */
+ float pdef_rfrict;
+ /** Surface particle stickiness. */
+ float pdef_stickness;
+
+ /** Used for forces. */
+ float absorption;
+
+ /* softbody collisions */
+ /** Damping factor for softbody deflection. */
+ float pdef_sbdamp;
+ /** Inner face thickness for softbody deflection. */
+ float pdef_sbift;
+ /** Outer face thickness for softbody deflection. */
+ float pdef_sboft;
+
+ /* guide curve, same as for particle child effects */
+ float clump_fac, clump_pow;
+ float kink_freq, kink_shape, kink_amp, free_end;
+
+ /* texture effector */
+ /** Used for calculating partial derivatives. */
+ float tex_nabla;
+ /** Texture of the texture effector. */
+ struct Tex *tex;
+
+ /* effector noise */
+ /** Random noise generator for e.g. wind. */
+ struct RNG *rng;
+ /** Noise of force. */
+ float f_noise;
+ /** Noise random seed. */
+ int seed;
+
+ /* 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;
+
+ /** Friction of cloth collisions. */
+ float pdef_cfrict;
+ char _pad[4];
} PartDeflect;
typedef struct EffectorWeights {
- /** Only use effectors from this group of objects. */
- struct Collection *group;
-
- /** Effector type specific weights. */
- float weight[14];
- float global_gravity;
- short flag, rt[3];
- char _pad[4];
+ /** Only use effectors from this group of objects. */
+ struct Collection *group;
+
+ /** Effector type specific weights. */
+ float weight[14];
+ float global_gravity;
+ short flag, rt[3];
+ char _pad[4];
} EffectorWeights;
/* EffectorWeights->flag */
-#define EFF_WEIGHT_DO_HAIR 1
+#define EFF_WEIGHT_DO_HAIR 1
/**
* Point cache file data types:
@@ -192,105 +192,105 @@ typedef struct EffectorWeights {
* - #BKE_ptcache_data_size()
* - #ptcache_file_pointers_init()
*/
-#define BPHYS_DATA_INDEX 0
-#define BPHYS_DATA_LOCATION 1
-#define BPHYS_DATA_SMOKE_LOW 1
-#define BPHYS_DATA_VELOCITY 2
-#define BPHYS_DATA_SMOKE_HIGH 2
-#define BPHYS_DATA_ROTATION 3
+#define BPHYS_DATA_INDEX 0
+#define BPHYS_DATA_LOCATION 1
+#define BPHYS_DATA_SMOKE_LOW 1
+#define BPHYS_DATA_VELOCITY 2
+#define BPHYS_DATA_SMOKE_HIGH 2
+#define BPHYS_DATA_ROTATION 3
#define BPHYS_DATA_DYNAMICPAINT 3
-#define BPHYS_DATA_AVELOCITY 4 /* used for particles */
-#define BPHYS_DATA_XCONST 4 /* used for cloth */
-#define BPHYS_DATA_SIZE 5
-#define BPHYS_DATA_TIMES 6
-#define BPHYS_DATA_BOIDS 7
+#define BPHYS_DATA_AVELOCITY 4 /* used for particles */
+#define BPHYS_DATA_XCONST 4 /* used for cloth */
+#define BPHYS_DATA_SIZE 5
+#define BPHYS_DATA_TIMES 6
+#define BPHYS_DATA_BOIDS 7
-#define BPHYS_TOT_DATA 8
+#define BPHYS_TOT_DATA 8
-#define BPHYS_EXTRA_FLUID_SPRINGS 1
+#define BPHYS_EXTRA_FLUID_SPRINGS 1
typedef struct PTCacheExtra {
- struct PTCacheExtra *next, *prev;
- unsigned int type, totdata;
- void *data;
+ struct PTCacheExtra *next, *prev;
+ unsigned int type, totdata;
+ void *data;
} PTCacheExtra;
typedef struct PTCacheMem {
- struct PTCacheMem *next, *prev;
- unsigned int frame, totpoint;
- unsigned int data_types, flag;
+ struct PTCacheMem *next, *prev;
+ unsigned int frame, totpoint;
+ unsigned int data_types, flag;
- /** BPHYS_TOT_DATA. */
- void *data[8];
- /** BPHYS_TOT_DATA. */
- void *cur[8];
+ /** BPHYS_TOT_DATA. */
+ void *data[8];
+ /** BPHYS_TOT_DATA. */
+ void *cur[8];
- struct ListBase extradata;
+ struct ListBase extradata;
} PTCacheMem;
typedef struct PointCache {
- struct PointCache *next, *prev;
- /** Generic flag. */
- int flag;
-
- /**
- * The number of frames between cached frames.
- * This should probably be an upper bound for a per point adaptive step in the future,
- * buf 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;
-
- /** Current frame of simulation (only if SIMULATION_VALID). */
- int simframe;
- /** Simulation start frame. */
- int startframe;
- /** Simulation end frame. */
- int endframe;
- /** Frame being edited (runtime only). */
- int editframe;
- /** Last exact frame that's cached. */
- int last_exact;
- /** Used for editing cache - what is the last baked frame. */
- int last_valid;
- char _pad[4];
-
- /* for external cache files */
- /** Number of cached points. */
- int totpoint;
- /** Modifier stack index. */
- int index;
- short compression, rt;
-
- char name[64];
- char prev_name[64];
- char info[64];
- /** File path, 1024 = FILE_MAX. */
- char path[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;
- int cached_frames_len;
- char _pad1[4];
-
- struct ListBase mem_cache;
-
- struct PTCacheEdit *edit;
- /** Free callback. */
- void (*free_edit)(struct PTCacheEdit *edit);
+ struct PointCache *next, *prev;
+ /** Generic flag. */
+ int flag;
+
+ /**
+ * The number of frames between cached frames.
+ * This should probably be an upper bound for a per point adaptive step in the future,
+ * buf 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;
+
+ /** Current frame of simulation (only if SIMULATION_VALID). */
+ int simframe;
+ /** Simulation start frame. */
+ int startframe;
+ /** Simulation end frame. */
+ int endframe;
+ /** Frame being edited (runtime only). */
+ int editframe;
+ /** Last exact frame that's cached. */
+ int last_exact;
+ /** Used for editing cache - what is the last baked frame. */
+ int last_valid;
+ char _pad[4];
+
+ /* for external cache files */
+ /** Number of cached points. */
+ int totpoint;
+ /** Modifier stack index. */
+ int index;
+ short compression, rt;
+
+ char name[64];
+ char prev_name[64];
+ char info[64];
+ /** File path, 1024 = FILE_MAX. */
+ char path[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;
+ int cached_frames_len;
+ char _pad1[4];
+
+ struct ListBase mem_cache;
+
+ struct PTCacheEdit *edit;
+ /** Free callback. */
+ void (*free_edit)(struct PTCacheEdit *edit);
} PointCache;
typedef struct SBVertex {
- float vec[4];
+ float vec[4];
} SBVertex;
/* Container for data that is shared among CoW copies.
@@ -298,243 +298,242 @@ typedef struct SBVertex {
* This is placed in a separate struct so that values can be changed
* without having to update all CoW copies. */
typedef struct SoftBody_Shared {
- struct PointCache *pointcache;
- struct ListBase ptcaches;
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
} SoftBody_Shared;
typedef struct SoftBody {
- /* dynamic data */
- int totpoint, totspring;
- /** Not saved in file. */
- struct BodyPoint *bpoint;
- /** Not saved in file. */
- struct BodySpring *bspring;
- char _pad;
- char msg_lock;
- short msg_value;
-
- /* part of UI: */
-
- /* general options */
- /** Softbody mass of *vertex*. */
- float nodemass;
- /**
- * 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.
- * MAX_VGROUP_NAME */
- char namedVG_Mass[64];
- /** Softbody amount of gravitaion to apply. */
- float grav;
- /** Friction to env. */
- float mediafrict;
- /** Error limit for ODE solver. */
- float rklimit;
- /** User control over simulation speed. */
- float physics_speed;
-
- /* goal */
- /** Softbody goal springs. */
- float goalspring;
- /** Softbody goal springs friction. */
- float goalfrict;
- /** Quick limits for goal. */
- float mingoal;
- float maxgoal;
- /** Default goal for vertices without vgroup. */
- float defgoal;
- /** Index starting at 1. */
- short vertgroup;
- /**
- * Starting to fix old bug .. nastiness that VG are indexes
- * rather find them by name tag to find it -> jow20090613.
- * MAX_VGROUP_NAME */
- char namedVG_Softgoal[64];
-
- short fuzzyness;
-
- /* springs */
- /** Softbody inner springs. */
- float inspring;
- /** Softbody inner springs friction. */
- float infrict;
- /**
- * 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.
- * MAX_VGROUP_NAME
- */
- char namedVG_Spring_K[64];
-
- /* baking */
- int sfra, efra;
- int interval;
- /** Local==1: use local coords for baking. */
- short local, solverflags;
-
- /* -- these must be kept for backwards compatibility -- */
- /** Array of size totpointkey. */
- SBVertex **keys;
- /** If totpointkey != totpoint or totkey!- (efra-sfra)/interval -> free keys. */
- int totpointkey, totkey;
- /* ---------------------------------------------------- */
- float secondspring;
-
- /* self collision*/
- /** Fixed collision ball size if > 0. */
- float colball;
- /** Cooling down collision response. */
- float balldamp;
- /** Pressure the ball is loaded with. */
- float ballstiff;
- short sbc_mode;
- short aeroedge;
- short minloops;
- short maxloops;
- short choke;
- short solver_ID;
- short plastic;
- short springpreload;
-
- /** Scratchpad/cache on live time not saved in file. */
- struct SBScratch *scratch;
- float shearstiff;
- float inpush;
-
- struct SoftBody_Shared *shared;
- /** Moved to SoftBody_Shared. */
- struct PointCache *pointcache DNA_DEPRECATED;
- /** Moved to SoftBody_Shared. */
- struct ListBase ptcaches DNA_DEPRECATED;
-
- struct Collection *collision_group;
-
- struct EffectorWeights *effector_weights;
- /* reverse esimated obmatrix .. no need to store in blend file .. how ever who cares */
- float lcom[3];
- float lrot[3][3];
- float lscale[3][3];
-
- int last_frame;
+ /* dynamic data */
+ int totpoint, totspring;
+ /** Not saved in file. */
+ struct BodyPoint *bpoint;
+ /** Not saved in file. */
+ struct BodySpring *bspring;
+ char _pad;
+ char msg_lock;
+ short msg_value;
+
+ /* part of UI: */
+
+ /* general options */
+ /** Softbody mass of *vertex*. */
+ float nodemass;
+ /**
+ * 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.
+ * MAX_VGROUP_NAME */
+ char namedVG_Mass[64];
+ /** Softbody amount of gravitaion to apply. */
+ float grav;
+ /** Friction to env. */
+ float mediafrict;
+ /** Error limit for ODE solver. */
+ float rklimit;
+ /** User control over simulation speed. */
+ float physics_speed;
+
+ /* goal */
+ /** Softbody goal springs. */
+ float goalspring;
+ /** Softbody goal springs friction. */
+ float goalfrict;
+ /** Quick limits for goal. */
+ float mingoal;
+ float maxgoal;
+ /** Default goal for vertices without vgroup. */
+ float defgoal;
+ /** Index starting at 1. */
+ short vertgroup;
+ /**
+ * Starting to fix old bug .. nastiness that VG are indexes
+ * rather find them by name tag to find it -> jow20090613.
+ * MAX_VGROUP_NAME */
+ char namedVG_Softgoal[64];
+
+ short fuzzyness;
+
+ /* springs */
+ /** Softbody inner springs. */
+ float inspring;
+ /** Softbody inner springs friction. */
+ float infrict;
+ /**
+ * 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.
+ * MAX_VGROUP_NAME
+ */
+ char namedVG_Spring_K[64];
+
+ /* baking */
+ int sfra, efra;
+ int interval;
+ /** Local==1: use local coords for baking. */
+ short local, solverflags;
+
+ /* -- these must be kept for backwards compatibility -- */
+ /** Array of size totpointkey. */
+ SBVertex **keys;
+ /** If totpointkey != totpoint or totkey!- (efra-sfra)/interval -> free keys. */
+ int totpointkey, totkey;
+ /* ---------------------------------------------------- */
+ float secondspring;
+
+ /* self collision*/
+ /** Fixed collision ball size if > 0. */
+ float colball;
+ /** Cooling down collision response. */
+ float balldamp;
+ /** Pressure the ball is loaded with. */
+ float ballstiff;
+ short sbc_mode;
+ short aeroedge;
+ short minloops;
+ short maxloops;
+ short choke;
+ short solver_ID;
+ short plastic;
+ short springpreload;
+
+ /** Scratchpad/cache on live time not saved in file. */
+ struct SBScratch *scratch;
+ float shearstiff;
+ float inpush;
+
+ struct SoftBody_Shared *shared;
+ /** Moved to SoftBody_Shared. */
+ struct PointCache *pointcache DNA_DEPRECATED;
+ /** Moved to SoftBody_Shared. */
+ struct ListBase ptcaches DNA_DEPRECATED;
+
+ struct Collection *collision_group;
+
+ struct EffectorWeights *effector_weights;
+ /* reverse esimated obmatrix .. no need to store in blend file .. how ever who cares */
+ float lcom[3];
+ float lrot[3][3];
+ float lscale[3][3];
+
+ int last_frame;
} SoftBody;
-
/* pd->flag: various settings */
-#define PFIELD_USEMAX (1 << 0)
-/*#define PDEFLE_DEFORM (1 << 1)*/ /*UNUSED*/
+#define PFIELD_USEMAX (1 << 0)
+/*#define PDEFLE_DEFORM (1 << 1)*/ /*UNUSED*/
/** TODO: do_versions for below */
-#define PFIELD_GUIDE_PATH_ADD (1 << 2)
+#define PFIELD_GUIDE_PATH_ADD (1 << 2)
/** used for do_versions */
-#define PFIELD_PLANAR (1 << 3)
-#define PDEFLE_KILL_PART (1 << 4)
+#define PFIELD_PLANAR (1 << 3)
+#define PDEFLE_KILL_PART (1 << 4)
/** used for do_versions */
-#define PFIELD_POSZ (1 << 5)
-#define PFIELD_TEX_OBJECT (1 << 6)
+#define PFIELD_POSZ (1 << 5)
+#define PFIELD_TEX_OBJECT (1 << 6)
/** used for turbulence */
-#define PFIELD_GLOBAL_CO (1 << 6)
-#define PFIELD_TEX_2D (1 << 7)
+#define PFIELD_GLOBAL_CO (1 << 6)
+#define PFIELD_TEX_2D (1 << 7)
/** used for harmonic force */
#define PFIELD_MULTIPLE_SPRINGS (1 << 7)
-#define PFIELD_USEMIN (1 << 8)
-#define PFIELD_USEMAXR (1 << 9)
-#define PFIELD_USEMINR (1 << 10)
-#define PFIELD_TEX_ROOTCO (1 << 11)
+#define PFIELD_USEMIN (1 << 8)
+#define PFIELD_USEMAXR (1 << 9)
+#define PFIELD_USEMINR (1 << 10)
+#define PFIELD_TEX_ROOTCO (1 << 11)
/** used for do_versions */
-#define PFIELD_SURFACE (1 << 12)
-#define PFIELD_VISIBILITY (1 << 13)
-#define PFIELD_DO_LOCATION (1 << 14)
-#define PFIELD_DO_ROTATION (1 << 15)
+#define PFIELD_SURFACE (1 << 12)
+#define PFIELD_VISIBILITY (1 << 13)
+#define PFIELD_DO_LOCATION (1 << 14)
+#define PFIELD_DO_ROTATION (1 << 15)
/** apply curve weights */
#define PFIELD_GUIDE_PATH_WEIGHT (1 << 16)
/** multiply smoke force by density */
-#define PFIELD_SMOKE_DENSITY (1 << 17)
+#define PFIELD_SMOKE_DENSITY (1 << 17)
/** used for (simple) force */
-#define PFIELD_GRAVITATION (1 << 18)
+#define PFIELD_GRAVITATION (1 << 18)
/** Enable cloth collision side detection based on normal. */
#define PFIELD_CLOTH_USE_CULLING (1 << 19)
/** Replace collision direction with collider normal. */
#define PFIELD_CLOTH_USE_NORMAL (1 << 20)
/* pd->falloff */
-#define PFIELD_FALL_SPHERE 0
-#define PFIELD_FALL_TUBE 1
-#define PFIELD_FALL_CONE 2
+#define PFIELD_FALL_SPHERE 0
+#define PFIELD_FALL_TUBE 1
+#define PFIELD_FALL_CONE 2
/* pd->shape */
-#define PFIELD_SHAPE_POINT 0
-#define PFIELD_SHAPE_PLANE 1
-#define PFIELD_SHAPE_SURFACE 2
-#define PFIELD_SHAPE_POINTS 3
-#define PFIELD_SHAPE_LINE 4
+#define PFIELD_SHAPE_POINT 0
+#define PFIELD_SHAPE_PLANE 1
+#define PFIELD_SHAPE_SURFACE 2
+#define PFIELD_SHAPE_POINTS 3
+#define PFIELD_SHAPE_LINE 4
/* pd->tex_mode */
-#define PFIELD_TEX_RGB 0
-#define PFIELD_TEX_GRAD 1
-#define PFIELD_TEX_CURL 2
+#define PFIELD_TEX_RGB 0
+#define PFIELD_TEX_GRAD 1
+#define PFIELD_TEX_CURL 2
/* pd->zdir */
-#define PFIELD_Z_BOTH 0
-#define PFIELD_Z_POS 1
-#define PFIELD_Z_NEG 2
+#define PFIELD_Z_BOTH 0
+#define PFIELD_Z_POS 1
+#define PFIELD_Z_NEG 2
/* pointcache->flag */
-#define PTCACHE_BAKED (1 << 0)
-#define PTCACHE_OUTDATED (1 << 1)
-#define PTCACHE_SIMULATION_VALID (1 << 2)
-#define PTCACHE_BAKING (1 << 3)
+#define PTCACHE_BAKED (1 << 0)
+#define PTCACHE_OUTDATED (1 << 1)
+#define PTCACHE_SIMULATION_VALID (1 << 2)
+#define PTCACHE_BAKING (1 << 3)
//#define PTCACHE_BAKE_EDIT (1 << 4)
//#define PTCACHE_BAKE_EDIT_ACTIVE (1 << 5)
-#define PTCACHE_DISK_CACHE (1 << 6)
+#define PTCACHE_DISK_CACHE (1 << 6)
///* removed since 2.64 - [#30974], could be added back in a more useful way */
//#define PTCACHE_QUICK_CACHE (1 << 7)
-#define PTCACHE_FRAMES_SKIPPED (1 << 8)
-#define PTCACHE_EXTERNAL (1 << 9)
-#define PTCACHE_READ_INFO (1 << 10)
+#define PTCACHE_FRAMES_SKIPPED (1 << 8)
+#define PTCACHE_EXTERNAL (1 << 9)
+#define PTCACHE_READ_INFO (1 << 10)
/** don't use the filename of the blendfile the data is linked from (write a local cache) */
-#define PTCACHE_IGNORE_LIBPATH (1 << 11)
+#define 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 */
-#define PTCACHE_FAKE_SMOKE (1 << 12)
-#define PTCACHE_IGNORE_CLEAR (1 << 13)
+#define PTCACHE_FAKE_SMOKE (1 << 12)
+#define PTCACHE_IGNORE_CLEAR (1 << 13)
/* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */
-#define PTCACHE_REDO_NEEDED 258
+#define PTCACHE_REDO_NEEDED 258
-#define PTCACHE_COMPRESS_NO 0
-#define PTCACHE_COMPRESS_LZO 1
-#define PTCACHE_COMPRESS_LZMA 2
+#define PTCACHE_COMPRESS_NO 0
+#define PTCACHE_COMPRESS_LZO 1
+#define PTCACHE_COMPRESS_LZMA 2
/* ob->softflag */
-#define OB_SB_ENABLE 1 /* deprecated, use modifier */
-#define OB_SB_GOAL 2
-#define OB_SB_EDGES 4
-#define OB_SB_QUADS 8
-#define OB_SB_POSTDEF 16
-// #define OB_SB_REDO 32
-// #define OB_SB_BAKESET 64
-// #define OB_SB_BAKEDO 128
-// #define OB_SB_RESET 256
-#define OB_SB_SELF 512
-#define OB_SB_FACECOLL 1024
-#define OB_SB_EDGECOLL 2048
-/* #define OB_SB_COLLFINAL 4096 */ /* deprecated */
-/* #define OB_SB_BIG_UI 8192 */ /* deprecated */
-#define OB_SB_AERO_ANGLE 16384
+#define OB_SB_ENABLE 1 /* deprecated, use modifier */
+#define OB_SB_GOAL 2
+#define OB_SB_EDGES 4
+#define OB_SB_QUADS 8
+#define OB_SB_POSTDEF 16
+// #define OB_SB_REDO 32
+// #define OB_SB_BAKESET 64
+// #define OB_SB_BAKEDO 128
+// #define OB_SB_RESET 256
+#define OB_SB_SELF 512
+#define OB_SB_FACECOLL 1024
+#define OB_SB_EDGECOLL 2048
+/* #define OB_SB_COLLFINAL 4096 */ /* deprecated */
+/* #define OB_SB_BIG_UI 8192 */ /* deprecated */
+#define OB_SB_AERO_ANGLE 16384
/* sb->solverflags */
-#define SBSO_MONITOR 1
-#define SBSO_OLDERR 2
-#define SBSO_ESTIMATEIPO 4
+#define SBSO_MONITOR 1
+#define SBSO_OLDERR 2
+#define SBSO_ESTIMATEIPO 4
/* sb->sbc_mode */
-#define SBC_MODE_MANUAL 0
-#define SBC_MODE_AVG 1
-#define SBC_MODE_MIN 2
-#define SBC_MODE_MAX 3
-#define SBC_MODE_AVGMINMAX 4
+#define SBC_MODE_MANUAL 0
+#define SBC_MODE_AVG 1
+#define SBC_MODE_MIN 2
+#define SBC_MODE_MAX 3
+#define SBC_MODE_AVGMINMAX 4
#ifdef __cplusplus
}
#endif
-#endif /* __DNA_OBJECT_FORCE_TYPES_H__ */
+#endif /* __DNA_OBJECT_FORCE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index c8684f42963..dc23a6a1ee2 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -55,20 +55,20 @@ struct bGPdata;
/* Vertex Groups - Name Info */
typedef struct bDeformGroup {
- struct bDeformGroup *next, *prev;
- /** MAX_VGROUP_NAME. */
- char name[64];
- /* need this flag for locking weights */
- char flag, _pad0[7];
+ struct bDeformGroup *next, *prev;
+ /** MAX_VGROUP_NAME. */
+ char name[64];
+ /* need this flag for locking weights */
+ char flag, _pad0[7];
} bDeformGroup;
/* Face Maps*/
typedef struct bFaceMap {
- struct bFaceMap *next, *prev;
- /** MAX_VGROUP_NAME. */
- char name[64];
- char flag;
- char _pad0[7];
+ struct bFaceMap *next, *prev;
+ /** MAX_VGROUP_NAME. */
+ char name[64];
+ char flag;
+ char _pad0[7];
} bFaceMap;
#define MAX_VGROUP_NAME 64
@@ -98,24 +98,24 @@ typedef struct bFaceMap {
* </pre>
*/
typedef struct BoundBox {
- float vec[8][3];
- int flag;
- char _pad0[4];
+ float vec[8][3];
+ int flag;
+ char _pad0[4];
} BoundBox;
/* boundbox flag */
enum {
- BOUNDBOX_DISABLED = (1 << 0),
- BOUNDBOX_DIRTY = (1 << 1),
+ BOUNDBOX_DISABLED = (1 << 0),
+ BOUNDBOX_DIRTY = (1 << 1),
};
typedef struct LodLevel {
- struct LodLevel *next, *prev;
- struct Object *source;
- int flags;
- float distance;
- char _pad0[4];
- int obhysteresis;
+ struct LodLevel *next, *prev;
+ struct Object *source;
+ int flags;
+ float distance;
+ char _pad0[4];
+ int obhysteresis;
} LodLevel;
/* Forward declaration for cache bbone deformation information.
@@ -127,536 +127,541 @@ struct CustomData_MeshMasks;
/* Not saved in file! */
typedef struct Object_Runtime {
- /**
- * The custom data layer mask that was last used
- * to calculate mesh_eval and mesh_deform_eval.
- */
- CustomData_MeshMasks last_data_mask;
-
- /** Did last modifier stack generation need mapping support? */
- char last_need_mapping;
-
- char _pad0[3];
-
- /** Only used for drawing the parent/child help-line. */
- float parent_display_origin[3];
-
-
- /** Axis aligned boundbox (in localspace). */
- struct BoundBox *bb;
-
- /**
- * Original mesh pointer, before object->data was changed to point
- * to mesh_eval.
- * Is assigned by dependency graph's copy-on-write evaluation.
- */
- struct Mesh *mesh_orig;
- /**
- * Mesh structure created during object evaluation.
- * It has all modifiers applied.
- */
- struct Mesh *mesh_eval;
- /**
- * Mesh structure created during object evaluation.
- * It has deforemation only modifiers applied on it.
- */
- struct Mesh *mesh_deform_eval;
-
- /** Runtime evaluated curve-specific data, not stored in the file. */
- struct CurveCache *curve_cache;
-
- /** Runtime grease pencil drawing data */
- struct GpencilBatchCache *gpencil_cache;
-
- struct ObjectBBoneDeform *cached_bbone_deformation;
-
- void *_pad1;
+ /**
+ * The custom data layer mask that was last used
+ * to calculate mesh_eval and mesh_deform_eval.
+ */
+ CustomData_MeshMasks last_data_mask;
+
+ /** Did last modifier stack generation need mapping support? */
+ char last_need_mapping;
+
+ char _pad0[3];
+
+ /** Only used for drawing the parent/child help-line. */
+ float parent_display_origin[3];
+
+ /** Axis aligned boundbox (in localspace). */
+ struct BoundBox *bb;
+
+ /**
+ * Original mesh pointer, before object->data was changed to point
+ * to mesh_eval.
+ * Is assigned by dependency graph's copy-on-write evaluation.
+ */
+ struct Mesh *mesh_orig;
+ /**
+ * Mesh structure created during object evaluation.
+ * It has all modifiers applied.
+ */
+ struct Mesh *mesh_eval;
+ /**
+ * Mesh structure created during object evaluation.
+ * It has deforemation only modifiers applied on it.
+ */
+ struct Mesh *mesh_deform_eval;
+
+ /** Runtime evaluated curve-specific data, not stored in the file. */
+ struct CurveCache *curve_cache;
+
+ /** Runtime grease pencil drawing data */
+ struct GpencilBatchCache *gpencil_cache;
+
+ struct ObjectBBoneDeform *cached_bbone_deformation;
+
+ void *_pad1;
} Object_Runtime;
typedef struct Object {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
- /** Runtime (must be immediately after id for utilities to use it). */
- struct DrawDataList drawdata;
-
- struct SculptSession *sculpt;
-
- short type, partype;
- /** Can be vertexnrs. */
- int par1, par2, par3;
- /** String describing subobject info, MAX_ID_NAME-2. */
- char parsubstr[64];
- struct Object *parent, *track;
- /* if ob->proxy (or proxy_group), this object is proxy for object ob->proxy */
- /* proxy_from is set in target back to the proxy. */
- struct Object *proxy, *proxy_group, *proxy_from;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- /* struct Path *path; */
- struct bAction *action DNA_DEPRECATED; // XXX deprecated... old animation system
- struct bAction *poselib;
- /** Pose data, armature objects only. */
- struct bPose *pose;
- /** Pointer to objects data - an 'ID' or NULL. */
- void *data;
-
- /** Grease Pencil data. */
- struct bGPdata *gpd DNA_DEPRECATED; // 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;
- void *_pad0;
-
- ListBase constraintChannels DNA_DEPRECATED; // XXX deprecated... old animation system
- ListBase effect DNA_DEPRECATED; // XXX deprecated... keep for readfile
- /** List of bDeformGroup (vertex groups) names and flag only. */
- ListBase defbase;
- /** List of ModifierData structures. */
- ListBase modifiers;
- /** List of GpencilModifierData structures. */
- ListBase greasepencil_modifiers;
- /** List of facemaps. */
- ListBase fmaps;
- /** List of viewport effects. Actually only used by grease pencil. */
- ListBase shader_fx;
-
- /** Local object mode. */
- int mode;
- int restore_mode;
-
- /* materials */
- /** Material slots. */
- struct Material **mat;
- /** A boolean field, with each byte 1 if corresponding material is linked to object. */
- char *matbits;
- /** Copy of mesh, curve & meta struct member of same name (keep in sync). */
- int totcol;
- /** Currently selected material in the UI. */
- int actcol;
-
- /* rot en drot have to be together! (transform('r' en 's')) */
- float loc[3], dloc[3];
- /** Scale (can be negative). */
- float scale[3];
- /** DEPRECATED, 2.60 and older only. */
- float dsize[3] DNA_DEPRECATED ;
- /** Ack!, changing. */
- float dscale[3];
- /** Euler rotation. */
- float rot[3], drot[3];
- /** Quaternion rotation. */
- float quat[4], dquat[4];
- /** Axis angle rotation - axis part. */
- float rotAxis[3], drotAxis[3];
- /** Axis angle rotation - angle part. */
- float rotAngle, drotAngle;
- /** Final worldspace matrix with constraints & animsys applied. */
- float obmat[4][4];
- /** Inverse result of parent, so that object doesn't 'stick' to parent. */
- float parentinv[4][4];
- /** Inverse result of constraints.
- * doesn't include effect of parent or object local transform. */
- float constinv[4][4];
- /**
- * Inverse matrix of 'obmat' for any other use than rendering!
- *
- * \note this isn't assured to be valid as with 'obmat',
- * before using this value you should do...
- * invert_m4_m4(ob->imat, ob->obmat);
- */
- float imat[4][4];
-
- /* Previously 'imat' was used at render time, but as other places use it too
- * the interactive ui of 2.5 creates problems. So now only 'imat_ren' should
- * be used when ever the inverse of ob->obmat * re->viewmat is needed! - jahka
- */
- float imat_ren[4][4];
-
- /** Copy of Base's layer in the scene. */
- unsigned int lay DNA_DEPRECATED;
-
- /** Copy of Base. */
- short flag;
- /** Deprecated, use 'matbits'. */
- short colbits DNA_DEPRECATED;
-
- /** Transformation settings and transform locks . */
- short transflag, protectflag;
- short trackflag, upflag;
- /** Used for DopeSheet filtering settings (expanded/collapsed). */
- short nlaflag;
-
- char _pad1;
- char duplicator_visibility_flag;
-
- /* Depsgraph */
- /** Used by depsgraph, flushed from base. */
- short base_flag;
- /** Used by viewport, synced from base. */
- unsigned short base_local_view_bits;
-
- /** Collision mask settings */
- unsigned short col_group, col_mask;
-
- /** Rotation mode - uses defines set out in DNA_action_types.h for PoseChannel rotations.... */
- short rotmode;
-
- /** Bounding box use for drawing. */
- char boundtype;
- /** Bounding box type used for collision. */
- char collision_boundtype;
-
- /** Viewport draw extra settings. */
- short dtx;
- /** Viewport draw type. */
- char dt;
- char empty_drawtype;
- float empty_drawsize;
- /** Dupliface scale. */
- float instance_faces_scale;
-
- /** Custom index, for renderpasses. */
- short index;
- /** Current deformation group, note: index starts at 1. */
- unsigned short actdef;
- /** Current face map, note: index starts at 1. */
- unsigned short actfmap;
- char _pad2[2];
- /** Object color (in most cases the material color is used for drawing). */
- float color[4];
-
- /** Softbody settings. */
- short softflag;
-
- /** For restricting view, select, render etc. accessible in outliner. */
- char restrictflag;
-
- /** Flag for pinning. */
- char shapeflag;
- /** Current shape key for menu or pinned. */
- short shapenr;
-
- char _pad3[2];
-
- /** Object constraints. */
- ListBase constraints;
- ListBase nlastrips DNA_DEPRECATED; // XXX deprecated... old animation system
- ListBase hooks DNA_DEPRECATED; // XXX deprecated... old animation system
- /** Particle systems. */
- ListBase particlesystem;
-
- /** Particle deflector/attractor/collision data. */
- struct PartDeflect *pd;
- /** If exists, saved in file. */
- struct SoftBody *soft;
- /** Object duplicator for group. */
- struct Collection *instance_collection;
-
- /** If fluidsim enabled, store additional settings. */
- struct FluidsimSettings *fluidsimSettings;
-
- struct DerivedMesh *derivedDeform, *derivedFinal;
-
- ListBase pc_ids;
-
- /** Settings for Bullet rigid body. */
- struct RigidBodyOb *rigidbody_object;
- /** Settings for Bullet constraint. */
- struct RigidBodyCon *rigidbody_constraint;
-
- /** Offset for image empties. */
- float ima_ofs[2];
- /** Must be non-null when object is an empty image. */
- ImageUser *iuser;
- char empty_image_visibility_flag;
- char empty_image_depth;
- char empty_image_flag;
- char _pad8[1];
-
- int select_id;
-
- /** Contains data for levels of detail. */
- ListBase lodlevels;
- LodLevel *currentlod;
-
- struct PreviewImage *preview;
-
- /** Runtime evaluation data (keep last). */
- Object_Runtime runtime;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+ /** Runtime (must be immediately after id for utilities to use it). */
+ struct DrawDataList drawdata;
+
+ struct SculptSession *sculpt;
+
+ short type, partype;
+ /** Can be vertexnrs. */
+ int par1, par2, par3;
+ /** String describing subobject info, MAX_ID_NAME-2. */
+ char parsubstr[64];
+ struct Object *parent, *track;
+ /* if ob->proxy (or proxy_group), this object is proxy for object ob->proxy */
+ /* proxy_from is set in target back to the proxy. */
+ struct Object *proxy, *proxy_group, *proxy_from;
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ /* struct Path *path; */
+ struct bAction *action DNA_DEPRECATED; // XXX deprecated... old animation system
+ struct bAction *poselib;
+ /** Pose data, armature objects only. */
+ struct bPose *pose;
+ /** Pointer to objects data - an 'ID' or NULL. */
+ void *data;
+
+ /** Grease Pencil data. */
+ struct bGPdata *gpd
+ DNA_DEPRECATED; // 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;
+ void *_pad0;
+
+ ListBase constraintChannels DNA_DEPRECATED; // XXX deprecated... old animation system
+ ListBase effect DNA_DEPRECATED; // XXX deprecated... keep for readfile
+ /** List of bDeformGroup (vertex groups) names and flag only. */
+ ListBase defbase;
+ /** List of ModifierData structures. */
+ ListBase modifiers;
+ /** List of GpencilModifierData structures. */
+ ListBase greasepencil_modifiers;
+ /** List of facemaps. */
+ ListBase fmaps;
+ /** List of viewport effects. Actually only used by grease pencil. */
+ ListBase shader_fx;
+
+ /** Local object mode. */
+ int mode;
+ int restore_mode;
+
+ /* materials */
+ /** Material slots. */
+ struct Material **mat;
+ /** A boolean field, with each byte 1 if corresponding material is linked to object. */
+ char *matbits;
+ /** Copy of mesh, curve & meta struct member of same name (keep in sync). */
+ int totcol;
+ /** Currently selected material in the UI. */
+ int actcol;
+
+ /* rot en drot have to be together! (transform('r' en 's')) */
+ float loc[3], dloc[3];
+ /** Scale (can be negative). */
+ float scale[3];
+ /** DEPRECATED, 2.60 and older only. */
+ float dsize[3] DNA_DEPRECATED;
+ /** Ack!, changing. */
+ float dscale[3];
+ /** Euler rotation. */
+ float rot[3], drot[3];
+ /** Quaternion rotation. */
+ float quat[4], dquat[4];
+ /** Axis angle rotation - axis part. */
+ float rotAxis[3], drotAxis[3];
+ /** Axis angle rotation - angle part. */
+ float rotAngle, drotAngle;
+ /** Final worldspace matrix with constraints & animsys applied. */
+ float obmat[4][4];
+ /** Inverse result of parent, so that object doesn't 'stick' to parent. */
+ float parentinv[4][4];
+ /** Inverse result of constraints.
+ * doesn't include effect of parent or object local transform. */
+ float constinv[4][4];
+ /**
+ * Inverse matrix of 'obmat' for any other use than rendering!
+ *
+ * \note this isn't assured to be valid as with 'obmat',
+ * before using this value you should do...
+ * invert_m4_m4(ob->imat, ob->obmat);
+ */
+ float imat[4][4];
+
+ /* Previously 'imat' was used at render time, but as other places use it too
+ * the interactive ui of 2.5 creates problems. So now only 'imat_ren' should
+ * be used when ever the inverse of ob->obmat * re->viewmat is needed! - jahka
+ */
+ float imat_ren[4][4];
+
+ /** Copy of Base's layer in the scene. */
+ unsigned int lay DNA_DEPRECATED;
+
+ /** Copy of Base. */
+ short flag;
+ /** Deprecated, use 'matbits'. */
+ short colbits DNA_DEPRECATED;
+
+ /** Transformation settings and transform locks . */
+ short transflag, protectflag;
+ short trackflag, upflag;
+ /** Used for DopeSheet filtering settings (expanded/collapsed). */
+ short nlaflag;
+
+ char _pad1;
+ char duplicator_visibility_flag;
+
+ /* Depsgraph */
+ /** Used by depsgraph, flushed from base. */
+ short base_flag;
+ /** Used by viewport, synced from base. */
+ unsigned short base_local_view_bits;
+
+ /** Collision mask settings */
+ unsigned short col_group, col_mask;
+
+ /** Rotation mode - uses defines set out in DNA_action_types.h for PoseChannel rotations.... */
+ short rotmode;
+
+ /** Bounding box use for drawing. */
+ char boundtype;
+ /** Bounding box type used for collision. */
+ char collision_boundtype;
+
+ /** Viewport draw extra settings. */
+ short dtx;
+ /** Viewport draw type. */
+ char dt;
+ char empty_drawtype;
+ float empty_drawsize;
+ /** Dupliface scale. */
+ float instance_faces_scale;
+
+ /** Custom index, for renderpasses. */
+ short index;
+ /** Current deformation group, note: index starts at 1. */
+ unsigned short actdef;
+ /** Current face map, note: index starts at 1. */
+ unsigned short actfmap;
+ char _pad2[2];
+ /** Object color (in most cases the material color is used for drawing). */
+ float color[4];
+
+ /** Softbody settings. */
+ short softflag;
+
+ /** For restricting view, select, render etc. accessible in outliner. */
+ char restrictflag;
+
+ /** Flag for pinning. */
+ char shapeflag;
+ /** Current shape key for menu or pinned. */
+ short shapenr;
+
+ char _pad3[2];
+
+ /** Object constraints. */
+ ListBase constraints;
+ ListBase nlastrips DNA_DEPRECATED; // XXX deprecated... old animation system
+ ListBase hooks DNA_DEPRECATED; // XXX deprecated... old animation system
+ /** Particle systems. */
+ ListBase particlesystem;
+
+ /** Particle deflector/attractor/collision data. */
+ struct PartDeflect *pd;
+ /** If exists, saved in file. */
+ struct SoftBody *soft;
+ /** Object duplicator for group. */
+ struct Collection *instance_collection;
+
+ /** If fluidsim enabled, store additional settings. */
+ struct FluidsimSettings *fluidsimSettings;
+
+ struct DerivedMesh *derivedDeform, *derivedFinal;
+
+ ListBase pc_ids;
+
+ /** Settings for Bullet rigid body. */
+ struct RigidBodyOb *rigidbody_object;
+ /** Settings for Bullet constraint. */
+ struct RigidBodyCon *rigidbody_constraint;
+
+ /** Offset for image empties. */
+ float ima_ofs[2];
+ /** Must be non-null when object is an empty image. */
+ ImageUser *iuser;
+ char empty_image_visibility_flag;
+ char empty_image_depth;
+ char empty_image_flag;
+ char _pad8[1];
+
+ int select_id;
+
+ /** Contains data for levels of detail. */
+ ListBase lodlevels;
+ LodLevel *currentlod;
+
+ struct PreviewImage *preview;
+
+ /** Runtime evaluation data (keep last). */
+ Object_Runtime runtime;
} Object;
/* Warning, this is not used anymore because hooks are now modifiers */
typedef struct ObHook {
- struct ObHook *next, *prev;
-
- struct Object *parent;
- /** 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;
-
- /** MAX_NAME. */
- char name[64];
-
- int *indexar;
- /** Curindex is cache for fast lookup. */
- int totindex, curindex;
- /** Active is only first hook, for button menu. */
- short type, active;
- float force;
+ struct ObHook *next, *prev;
+
+ struct Object *parent;
+ /** 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;
+
+ /** MAX_NAME. */
+ char name[64];
+
+ int *indexar;
+ /** Curindex is cache for fast lookup. */
+ int totindex, curindex;
+ /** Active is only first hook, for button menu. */
+ short type, active;
+ float force;
} ObHook;
/* **************** OBJECT ********************* */
/* used many places... should be specialized */
-#define SELECT 1
+#define SELECT 1
/* type */
enum {
- OB_EMPTY = 0,
- OB_MESH = 1,
- OB_CURVE = 2,
- OB_SURF = 3,
- OB_FONT = 4,
- OB_MBALL = 5,
+ OB_EMPTY = 0,
+ OB_MESH = 1,
+ OB_CURVE = 2,
+ OB_SURF = 3,
+ OB_FONT = 4,
+ OB_MBALL = 5,
- OB_LAMP = 10,
- OB_CAMERA = 11,
+ OB_LAMP = 10,
+ OB_CAMERA = 11,
- OB_SPEAKER = 12,
- OB_LIGHTPROBE = 13,
+ OB_SPEAKER = 12,
+ OB_LIGHTPROBE = 13,
- OB_LATTICE = 22,
+ OB_LATTICE = 22,
- OB_ARMATURE = 25,
+ OB_ARMATURE = 25,
- /** Grease Pencil object used in 3D view but not used for annotation in 2D. */
- OB_GPENCIL = 26,
+ /** Grease Pencil object used in 3D view but not used for annotation in 2D. */
+ OB_GPENCIL = 26,
- OB_TYPE_MAX,
+ OB_TYPE_MAX,
};
/* check if the object type supports materials */
#define OB_TYPE_SUPPORT_MATERIAL(_type) \
- (((_type) >= OB_MESH && (_type) <= OB_MBALL) || ((_type) == OB_GPENCIL))
-#define OB_TYPE_SUPPORT_VGROUP(_type) \
- (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL))
+ (((_type) >= OB_MESH && (_type) <= OB_MBALL) || ((_type) == OB_GPENCIL))
+#define OB_TYPE_SUPPORT_VGROUP(_type) (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL))
#define OB_TYPE_SUPPORT_EDITMODE(_type) \
- (ELEM(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
-#define OB_TYPE_SUPPORT_PARVERT(_type) \
- (ELEM(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE))
+ (ELEM(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
+#define OB_TYPE_SUPPORT_PARVERT(_type) (ELEM(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE))
/** Matches #OB_TYPE_SUPPORT_EDITMODE. */
-#define OB_DATA_SUPPORT_EDITMODE(_type) \
- (ELEM(_type, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR))
+#define OB_DATA_SUPPORT_EDITMODE(_type) (ELEM(_type, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR))
/* is this ID type used as object data */
#define OB_DATA_SUPPORT_ID(_id_type) \
- (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_LP, ID_CA, ID_LT, ID_GD, ID_AR))
+ (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_LP, ID_CA, ID_LT, ID_GD, ID_AR))
#define OB_DATA_SUPPORT_ID_CASE \
- ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_LP: case ID_CA: case ID_LT: case ID_GD: case ID_AR
+ID_ME: \
+case ID_CU: \
+case ID_MB: \
+case ID_LA: \
+case ID_SPK: \
+case ID_LP: \
+case ID_CA: \
+case ID_LT: \
+case ID_GD: \
+case ID_AR
/* partype: first 4 bits: type */
enum {
- PARTYPE = (1 << 4) - 1,
- PAROBJECT = 0,
- PARSKEL = 4,
- PARVERT1 = 5,
- PARVERT3 = 6,
- PARBONE = 7,
+ PARTYPE = (1 << 4) - 1,
+ PAROBJECT = 0,
+ PARSKEL = 4,
+ PARVERT1 = 5,
+ PARVERT3 = 6,
+ PARBONE = 7,
};
/* (short) transflag */
enum {
- OB_TRANSFLAG_UNUSED_0 = 1 << 0, /* cleared */
- 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_DUPLICALCDERIVED = 1 << 7,
- 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,
- /* hack to work around particle issue */
- OB_NO_PSYS_UPDATE = 1 << 14,
-
- OB_DUPLI = OB_DUPLIVERTS | OB_DUPLICOLLECTION | OB_DUPLIFACES | OB_DUPLIPARTS,
+ OB_TRANSFLAG_UNUSED_0 = 1 << 0, /* cleared */
+ 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_DUPLICALCDERIVED = 1 << 7,
+ 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,
+ /* hack to work around particle issue */
+ OB_NO_PSYS_UPDATE = 1 << 14,
+
+ OB_DUPLI = OB_DUPLIVERTS | OB_DUPLICOLLECTION | OB_DUPLIFACES | OB_DUPLIPARTS,
};
/* (short) trackflag / upflag */
enum {
- OB_POSX = 0,
- OB_POSY = 1,
- OB_POSZ = 2,
- OB_NEGX = 3,
- OB_NEGY = 4,
- OB_NEGZ = 5,
+ OB_POSX = 0,
+ OB_POSY = 1,
+ OB_POSZ = 2,
+ OB_NEGX = 3,
+ OB_NEGY = 4,
+ OB_NEGZ = 5,
};
/* dt: no flags */
enum {
- OB_BOUNDBOX = 1,
- OB_WIRE = 2,
- OB_SOLID = 3,
- OB_MATERIAL = 4,
- OB_TEXTURE = 5,
- OB_RENDER = 6,
+ OB_BOUNDBOX = 1,
+ OB_WIRE = 2,
+ OB_SOLID = 3,
+ OB_MATERIAL = 4,
+ OB_TEXTURE = 5,
+ OB_RENDER = 6,
};
/* dtx: flags (short) */
enum {
- OB_DRAWBOUNDOX = 1 << 0,
- OB_AXIS = 1 << 1,
- OB_TEXSPACE = 1 << 2,
- OB_DRAWNAME = 1 << 3,
- OB_DRAWIMAGE = 1 << 4,
- /* for solid+wire display */
- OB_DRAWWIRE = 1 << 5,
- /* for overdraw s*/
- OB_DRAWXRAY = 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,
+ OB_DRAWBOUNDOX = 1 << 0,
+ OB_AXIS = 1 << 1,
+ OB_TEXSPACE = 1 << 2,
+ OB_DRAWNAME = 1 << 3,
+ OB_DRAWIMAGE = 1 << 4,
+ /* for solid+wire display */
+ OB_DRAWWIRE = 1 << 5,
+ /* for overdraw s*/
+ OB_DRAWXRAY = 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,
};
/* empty_drawtype: no flags */
enum {
- 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,
+ 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,
};
/* gpencil add types */
enum {
- GP_EMPTY = 0,
- GP_STROKE = 1,
- GP_MONKEY = 2,
+ GP_EMPTY = 0,
+ GP_STROKE = 1,
+ GP_MONKEY = 2,
};
/* boundtype */
enum {
- OB_BOUND_BOX = 0,
- OB_BOUND_SPHERE = 1,
- OB_BOUND_CYLINDER = 2,
- OB_BOUND_CONE = 3,
- OB_BOUND_TRIANGLE_MESH = 4,
- OB_BOUND_CONVEX_HULL = 5,
-/* OB_BOUND_DYN_MESH = 6, */ /*UNUSED*/
- OB_BOUND_CAPSULE = 7,
+ OB_BOUND_BOX = 0,
+ OB_BOUND_SPHERE = 1,
+ OB_BOUND_CYLINDER = 2,
+ OB_BOUND_CONE = 3,
+ OB_BOUND_TRIANGLE_MESH = 4,
+ OB_BOUND_CONVEX_HULL = 5,
+ /* OB_BOUND_DYN_MESH = 6, */ /*UNUSED*/
+ OB_BOUND_CAPSULE = 7,
};
/* lod flags */
enum {
- OB_LOD_USE_MESH = 1 << 0,
- OB_LOD_USE_MAT = 1 << 1,
- OB_LOD_USE_HYST = 1 << 2,
+ OB_LOD_USE_MESH = 1 << 0,
+ OB_LOD_USE_MAT = 1 << 1,
+ OB_LOD_USE_HYST = 1 << 2,
};
-
/* **************** BASE ********************* */
/* also needed for base!!!!! or rather, they interfere....*/
/* base->flag and ob->flag */
enum {
- BA_WAS_SEL = (1 << 1),
- /* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in readfile.c. */
- // 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),
+ BA_WAS_SEL = (1 << 1),
+ /* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in readfile.c. */
+ // 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 */
-#define BA_TEMP_TAG (1 << 5)
+/* NOTE: this was used as a proper setting in past, so nullify before using */
+#define BA_TEMP_TAG (1 << 5)
/* #define BA_FROMSET (1 << 7) */ /*UNUSED*/
-#define BA_TRANSFORM_CHILD (1 << 8) /* child of a transformed object */
-#define BA_TRANSFORM_PARENT (1 << 13) /* parent of a transformed object */
+#define BA_TRANSFORM_CHILD (1 << 8) /* child of a transformed object */
+#define BA_TRANSFORM_PARENT (1 << 13) /* parent of a transformed object */
-#define OB_FROMDUPLI (1 << 9)
-#define OB_DONE (1 << 10) /* unknown state, clear before use */
+#define OB_FROMDUPLI (1 << 9)
+#define OB_DONE (1 << 10) /* unknown state, clear before use */
#ifdef DNA_DEPRECATED_ALLOW
-# define OB_FLAG_UNUSED_11 (1 << 11) /* cleared */
-# define OB_FLAG_UNUSED_12 (1 << 12) /* cleared */
+# define OB_FLAG_UNUSED_11 (1 << 11) /* cleared */
+# define OB_FLAG_UNUSED_12 (1 << 12) /* cleared */
#endif
/* ob->restrictflag */
enum {
- OB_RESTRICT_VIEW = 1 << 0,
- OB_RESTRICT_SELECT = 1 << 1,
- OB_RESTRICT_RENDER = 1 << 2,
+ OB_RESTRICT_VIEW = 1 << 0,
+ OB_RESTRICT_SELECT = 1 << 1,
+ OB_RESTRICT_RENDER = 1 << 2,
};
/* ob->shapeflag */
enum {
- OB_SHAPE_LOCK = 1 << 0,
+ OB_SHAPE_LOCK = 1 << 0,
#ifdef DNA_DEPRECATED_ALLOW
- OB_SHAPE_FLAG_UNUSED_1 = 1 << 1, /* cleared */
+ OB_SHAPE_FLAG_UNUSED_1 = 1 << 1, /* cleared */
#endif
- OB_SHAPE_EDIT_MODE = 1 << 2,
+ OB_SHAPE_EDIT_MODE = 1 << 2,
};
/* ob->nlaflag */
enum {
- 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,
- /* object's constraint channels */
- OB_ADS_SHOWCONS = 1 << 12,
- /* object's material channels */
- OB_ADS_SHOWMATS = 1 << 13,
- /* object's marticle channels */
- OB_ADS_SHOWPARTS = 1 << 14,
+ 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,
+ /* object's constraint channels */
+ OB_ADS_SHOWCONS = 1 << 12,
+ /* object's material channels */
+ OB_ADS_SHOWMATS = 1 << 13,
+ /* object's marticle channels */
+ OB_ADS_SHOWPARTS = 1 << 14,
};
/* ob->protectflag */
enum {
- 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,
+ 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,
};
/* ob->duplicator_visibility_flag */
enum {
- OB_DUPLI_FLAG_VIEWPORT = 1 << 0,
- OB_DUPLI_FLAG_RENDER = 1 << 1,
+ OB_DUPLI_FLAG_VIEWPORT = 1 << 0,
+ OB_DUPLI_FLAG_RENDER = 1 << 1,
};
/* ob->empty_image_depth */
@@ -666,15 +671,15 @@ enum {
/** #Object.empty_image_visibility_flag */
enum {
- 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_PERSPECTIVE = 1 << 0,
+ OB_EMPTY_IMAGE_HIDE_ORTHOGRAPHIC = 1 << 1,
+ OB_EMPTY_IMAGE_HIDE_BACK = 1 << 2,
+ OB_EMPTY_IMAGE_HIDE_FRONT = 1 << 3,
};
/** #Object.empty_image_flag */
enum {
- OB_EMPTY_IMAGE_USE_ALPHA_BLEND = 1 << 0,
+ OB_EMPTY_IMAGE_USE_ALPHA_BLEND = 1 << 0,
};
#define MAX_DUPLI_RECUR 8
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index bbd3cf62c2d..1462d955f81 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -29,92 +29,100 @@
struct ID;
typedef struct TreeStoreElem {
- short type, nr, flag, used;
+ short type, nr, flag, used;
- /* 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;
+ /* 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;
} TreeStoreElem;
/* used only to store data in in blend files */
typedef struct TreeStore {
- /** Was previously used for memory preallocation. */
- int totelem DNA_DEPRECATED;
- /** Number of elements in data array. */
- int usedelem;
- /**
- * Elements to be packed from mempool in writefile.c
- * or extracted to mempool in readfile.c
- */
- TreeStoreElem *data;
+ /** Was previously used for memory preallocation. */
+ int totelem DNA_DEPRECATED;
+ /** Number of elements in data array. */
+ int usedelem;
+ /**
+ * Elements to be packed from mempool in writefile.c
+ * or extracted to mempool in readfile.c
+ */
+ TreeStoreElem *data;
} TreeStore;
/* TreeStoreElem->flag */
enum {
- 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),
- TSE_DRAG_ANY = (TSE_DRAG_INTO | TSE_DRAG_BEFORE | TSE_DRAG_AFTER),
+ 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),
+ TSE_DRAG_ANY = (TSE_DRAG_INTO | TSE_DRAG_BEFORE | TSE_DRAG_AFTER),
};
/* TreeStoreElem->types */
-#define TSE_NLA 1 /* NO ID */
-#define TSE_NLA_ACTION 2
-#define TSE_DEFGROUP_BASE 3
-#define TSE_DEFGROUP 4
-#define TSE_BONE 5
-#define TSE_EBONE 6
+#define TSE_NLA 1 /* NO ID */
+#define TSE_NLA_ACTION 2
+#define TSE_DEFGROUP_BASE 3
+#define TSE_DEFGROUP 4
+#define TSE_BONE 5
+#define TSE_EBONE 6
#define TSE_CONSTRAINT_BASE 7
-#define TSE_CONSTRAINT 8
-#define TSE_MODIFIER_BASE 9
-#define TSE_MODIFIER 10
-#define TSE_LINKED_OB 11
-/* #define TSE_SCRIPT_BASE 12 */ /* UNUSED */
-#define TSE_POSE_BASE 13
-#define TSE_POSE_CHANNEL 14
-#define TSE_ANIM_DATA 15
-#define TSE_DRIVER_BASE 16 /* NO ID */
-/* #define TSE_DRIVER 17 */ /* UNUSED */
+#define TSE_CONSTRAINT 8
+#define TSE_MODIFIER_BASE 9
+#define TSE_MODIFIER 10
+#define TSE_LINKED_OB 11
+/* #define TSE_SCRIPT_BASE 12 */ /* UNUSED */
+#define TSE_POSE_BASE 13
+#define TSE_POSE_CHANNEL 14
+#define TSE_ANIM_DATA 15
+#define TSE_DRIVER_BASE 16 /* NO ID */
+/* #define TSE_DRIVER 17 */ /* UNUSED */
-#define TSE_PROXY 18
-#define TSE_R_LAYER_BASE 19
-#define TSE_R_LAYER 20
-/* #define TSE_R_PASS 21 */ /* UNUSED */
-#define TSE_LINKED_MAT 22
+#define TSE_PROXY 18
+#define TSE_R_LAYER_BASE 19
+#define TSE_R_LAYER 20
+/* #define TSE_R_PASS 21 */ /* UNUSED */
+#define TSE_LINKED_MAT 22
/* NOTE, is used for light group */
-#define TSE_LINKED_LAMP 23
-#define TSE_POSEGRP_BASE 24
-#define TSE_POSEGRP 25
-#define TSE_SEQUENCE 26 /* NO ID */
-#define TSE_SEQ_STRIP 27 /* NO ID */
-#define TSE_SEQUENCE_DUP 28 /* NO ID */
-#define TSE_LINKED_PSYS 29
-#define TSE_RNA_STRUCT 30 /* NO ID */
-#define TSE_RNA_PROPERTY 31 /* NO ID */
-#define TSE_RNA_ARRAY_ELEM 32 /* NO ID */
-#define TSE_NLA_TRACK 33 /* NO ID */
-#define TSE_KEYMAP 34 /* NO ID */
-#define TSE_KEYMAP_ITEM 35 /* NO ID */
-#define TSE_ID_BASE 36 /* NO ID */
-#define TSE_GP_LAYER 37 /* NO ID */
-#define TSE_LAYER_COLLECTION 38
+#define TSE_LINKED_LAMP 23
+#define TSE_POSEGRP_BASE 24
+#define TSE_POSEGRP 25
+#define TSE_SEQUENCE 26 /* NO ID */
+#define TSE_SEQ_STRIP 27 /* NO ID */
+#define TSE_SEQUENCE_DUP 28 /* NO ID */
+#define TSE_LINKED_PSYS 29
+#define TSE_RNA_STRUCT 30 /* NO ID */
+#define TSE_RNA_PROPERTY 31 /* NO ID */
+#define TSE_RNA_ARRAY_ELEM 32 /* NO ID */
+#define TSE_NLA_TRACK 33 /* NO ID */
+#define TSE_KEYMAP 34 /* NO ID */
+#define TSE_KEYMAP_ITEM 35 /* NO ID */
+#define TSE_ID_BASE 36 /* NO ID */
+#define TSE_GP_LAYER 37 /* NO ID */
+#define TSE_LAYER_COLLECTION 38
#define TSE_SCENE_COLLECTION_BASE 39
-#define TSE_VIEW_COLLECTION_BASE 40
-#define TSE_SCENE_OBJECTS_BASE 41
-
+#define TSE_VIEW_COLLECTION_BASE 40
+#define TSE_SCENE_OBJECTS_BASE 41
/* Check whether given TreeStoreElem should have a real ID in its ->id member. */
#define TSE_IS_REAL_ID(_tse) \
- (!ELEM((_tse)->type, TSE_NLA, TSE_NLA_TRACK, TSE_DRIVER_BASE, \
- TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, \
- TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, \
- TSE_KEYMAP, TSE_KEYMAP_ITEM, TSE_ID_BASE, TSE_GP_LAYER))
-
+ (!ELEM((_tse)->type, \
+ TSE_NLA, \
+ TSE_NLA_TRACK, \
+ TSE_DRIVER_BASE, \
+ TSE_SEQUENCE, \
+ TSE_SEQ_STRIP, \
+ TSE_SEQUENCE_DUP, \
+ TSE_RNA_STRUCT, \
+ TSE_RNA_PROPERTY, \
+ TSE_RNA_ARRAY_ELEM, \
+ TSE_KEYMAP, \
+ TSE_KEYMAP_ITEM, \
+ TSE_ID_BASE, \
+ TSE_GP_LAYER))
#endif
diff --git a/source/blender/makesdna/DNA_packedFile_types.h b/source/blender/makesdna/DNA_packedFile_types.h
index 61d0a89f752..a8afa667158 100644
--- a/source/blender/makesdna/DNA_packedFile_types.h
+++ b/source/blender/makesdna/DNA_packedFile_types.h
@@ -25,25 +25,25 @@
#define __DNA_PACKEDFILE_TYPES_H__
typedef struct PackedFile {
- int size;
- int seek;
- void *data;
+ int size;
+ int seek;
+ void *data;
} PackedFile;
enum ePF_FileStatus {
- PF_EQUAL = 0,
- PF_DIFFERS = 1,
- PF_NOFILE = 2,
+ PF_EQUAL = 0,
+ PF_DIFFERS = 1,
+ PF_NOFILE = 2,
- PF_WRITE_ORIGINAL = 3,
- PF_WRITE_LOCAL = 4,
- PF_USE_LOCAL = 5,
- PF_USE_ORIGINAL = 6,
- PF_KEEP = 7,
- PF_REMOVE = 8,
- PF_NOOP = 9,
+ PF_WRITE_ORIGINAL = 3,
+ PF_WRITE_LOCAL = 4,
+ PF_USE_LOCAL = 5,
+ PF_USE_ORIGINAL = 6,
+ PF_KEEP = 7,
+ PF_REMOVE = 8,
+ PF_NOOP = 9,
- PF_ASK = 10,
+ PF_ASK = 10,
};
#endif /* PACKEDFILE_TYPES_H */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index a6ad651b5d7..a2f63d4d040 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -31,639 +31,641 @@
struct AnimData;
typedef 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];
+ /** 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];
} HairKey;
-typedef 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;
+typedef 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;
} ParticleKey;
typedef struct BoidParticle {
- struct Object *ground;
- struct BoidData data;
- float gravity[3];
- float wander[3];
- float rt;
+ struct Object *ground;
+ struct BoidData data;
+ float gravity[3];
+ float wander[3];
+ float rt;
} BoidParticle;
typedef struct ParticleSpring {
- float rest_length;
- unsigned int particle_index[2], delete_flag;
+ float rest_length;
+ unsigned int particle_index[2], delete_flag;
} ParticleSpring;
/* Child particles are created around or between parent particles */
typedef struct ChildParticle {
- /** Num is face index on the final derived mesh. */
- int num, 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;
- float rt;
+ /** Num is face index on the final derived mesh. */
+ int num, 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;
+ float rt;
} ChildParticle;
typedef struct ParticleTarget {
- struct ParticleTarget *next, *prev;
- struct Object *ob;
- int psys;
- short flag, mode;
- float time, duration;
+ struct ParticleTarget *next, *prev;
+ struct Object *ob;
+ int psys;
+ short flag, mode;
+ float time, duration;
} ParticleTarget;
typedef struct ParticleDupliWeight {
- struct ParticleDupliWeight *next, *prev;
- struct Object *ob;
- short count;
- short flag;
- /** Only updated on file save and used on file load. */
- short index, rt;
+ struct ParticleDupliWeight *next, *prev;
+ struct Object *ob;
+ short count;
+ short flag;
+ /** Only updated on file save and used on file load. */
+ short index, rt;
} ParticleDupliWeight;
typedef struct ParticleData {
- /** Current global coordinates. */
- ParticleKey state;
+ /** Current global coordinates. */
+ ParticleKey state;
- /** Previous state. */
- ParticleKey prev_state;
+ /** Previous state. */
+ ParticleKey prev_state;
- /** Hair vertices. */
- HairKey *hair;
+ /** Hair vertices. */
+ HairKey *hair;
- /** Keyed keys. */
- ParticleKey *keys;
+ /** Keyed keys. */
+ ParticleKey *keys;
- /** Boids data. */
- BoidParticle *boid;
+ /** Boids data. */
+ BoidParticle *boid;
- /** Amount of hair or keyed key.s*/
- int totkey;
+ /** Amount of hair or keyed key.s*/
+ int totkey;
- /** Dietime is not necessarily time+lifetime as. */
- float time, lifetime;
- /** Particles can die unnaturally (collision). */
- float dietime;
+ /** Dietime is not necessarily time+lifetime as. */
+ float time, lifetime;
+ /** Particles can die unnaturally (collision). */
+ float dietime;
- /**
- * WARNING! Those two indices,
- * when not affected to vertices, are for !!! TESSELLATED FACES !!!, not POLYGONS!
- */
- /** Index to vert/edge/face. */
- int num;
- /** Index to derived mesh data (face) to avoid slow lookups. */
- int num_dmcache;
+ /**
+ * WARNING! Those two indices,
+ * when not affected to vertices, are for !!! TESSELLATED FACES !!!, not POLYGONS!
+ */
+ /** Index to vert/edge/face. */
+ int num;
+ /** Index to derived mesh data (face) to avoid slow lookups. */
+ int num_dmcache;
- /** Coordinates on face/edge number "num" and depth alon.g*/
- float fuv[4], foffset;
- /* face normal for volume emission. */
+ /** Coordinates on face/edge number "num" and depth alon.g*/
+ float fuv[4], foffset;
+ /* face normal for volume emission. */
- /** Size and multiplier so that we can update size when ever. */
- float size;
+ /** Size and multiplier so that we can update size when ever. */
+ float size;
- /** Density of sph particle. */
- float sphdensity;
- char _pad[4];
+ /** Density of sph particle. */
+ float sphdensity;
+ char _pad[4];
- int hair_index;
- short flag;
- /** The life state of a particle. */
- short alive;
+ int hair_index;
+ short flag;
+ /** The life state of a particle. */
+ short alive;
} ParticleData;
typedef struct SPHFluidSettings {
- /*Particle Fluid*/
- float radius, spring_k, rest_length;
- float plasticity_constant, yield_ratio;
- float plasticity_balance, yield_balance;
- float viscosity_omega, viscosity_beta;
- float stiffness_k, stiffness_knear, rest_density;
- float buoyancy;
- int flag, spring_frames;
- short solver;
- char _pad[6];
+ /*Particle Fluid*/
+ float radius, spring_k, rest_length;
+ float plasticity_constant, yield_ratio;
+ float plasticity_balance, yield_balance;
+ float viscosity_omega, viscosity_beta;
+ float stiffness_k, stiffness_knear, rest_density;
+ float buoyancy;
+ int flag, spring_frames;
+ short solver;
+ char _pad[6];
} SPHFluidSettings;
/* fluid->flag */
-#define SPH_VISCOELASTIC_SPRINGS 1
-#define SPH_CURRENT_REST_LENGTH 2
-#define SPH_FAC_REPULSION 4
-#define SPH_FAC_DENSITY 8
-#define SPH_FAC_RADIUS 16
-#define SPH_FAC_VISCOSITY 32
-#define SPH_FAC_REST_LENGTH 64
+#define SPH_VISCOELASTIC_SPRINGS 1
+#define SPH_CURRENT_REST_LENGTH 2
+#define SPH_FAC_REPULSION 4
+#define SPH_FAC_DENSITY 8
+#define SPH_FAC_RADIUS 16
+#define SPH_FAC_VISCOSITY 32
+#define SPH_FAC_REST_LENGTH 64
/* fluid->solver (numerical ID field, not bitfield) */
-#define SPH_SOLVER_DDR 0
-#define SPH_SOLVER_CLASSICAL 1
+#define SPH_SOLVER_DDR 0
+#define SPH_SOLVER_CLASSICAL 1
typedef struct ParticleSettings {
- ID id;
- struct AnimData *adt;
-
- struct BoidSettings *boids;
- struct SPHFluidSettings *fluid;
-
- struct EffectorWeights *effector_weights;
- struct Collection *collision_group;
-
- int flag, rt;
- short type, from, distr, texact;
- /* physics modes */
- short phystype, rotmode, avemode, reactevent;
- int draw;
- float draw_size;
- short draw_as, childtype;
- char _pad2[4];
- short ren_as, subframes, draw_col;
- /* number of path segments, power of 2 except */
- short draw_step, ren_step;
- short hair_step, keys_step;
-
- /* adaptive path rendering */
- short adapt_angle, adapt_pix;
-
- short disp, omat, interpolation, integrator;
- short rotfrom DNA_DEPRECATED;
- short kink, kink_axis;
-
- /* billboards */
- short bb_align, bb_uv_split, bb_anim, bb_split_offset DNA_DEPRECATED;
- float bb_tilt, bb_rand_tilt, bb_offset[2], bb_size[2], bb_vel_head, bb_vel_tail DNA_DEPRECATED;
-
- /* draw color */
- float color_vec_max;
-
- /* time and emission */
- float sta, end, lifetime, randlife;
- float timetweak, courant_target;
- float jitfac, eff_hair, grid_rand, ps_offset[1];
- int totpart, userjit, grid_res, effector_amount;
- short time_flag;
- char _pad0[6];
-
- /* initial velocity factors */
- float normfac, obfac, randfac, partfac, tanfac, tanphase, reactfac;
- float ob_vel[3];
- float avefac, phasefac, randrotfac, randphasefac;
- /* physical properties */
- float mass, size, randsize;
- /* global physical properties */
- float acc[3], dragfac, brownfac, dampfac;
- /* length */
- float randlength;
- /* children */
- int child_flag;
- char _pad3[4];
- int child_nbr, ren_child_nbr;
- float parents, childsize, childrandsize;
- float childrad, childflat;
- /* clumping */
- float clumpfac, clumppow;
- /* kink */
- float kink_amp, kink_freq, kink_shape, kink_flat;
- float kink_amp_clump;
- int kink_extra_steps;
- char _pad4[4];
- float kink_axis_random, kink_amp_random;
- /* rough */
- float rough1, rough1_size;
- float rough2, rough2_size, rough2_thres;
- float rough_end, rough_end_shape;
- /* length */
- float clength, clength_thres;
- /* parting */
- float parting_fac;
- float parting_min, parting_max;
- /* branching */
- float branch_thres;
- /* drawing stuff */
- float draw_line[2];
- float path_start, path_end;
- int trail_count;
- /* keyed particles */
- int keyed_loops;
- struct CurveMapping *clumpcurve;
- struct CurveMapping *roughcurve;
- float clump_noise_size;
-
- /* hair dynamics */
- float bending_random;
-
- /** MAX_MTEX. */
- struct MTex *mtex[18];
-
- struct Collection *instance_collection;
- struct ListBase instance_weights;
- struct Collection *eff_group DNA_DEPRECATED; // deprecated
- struct Object *instance_object;
- struct Object *bb_ob;
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- struct PartDeflect *pd;
- struct PartDeflect *pd2;
-
- /* modified dm support */
- short use_modifier_stack;
- char _pad5[2];
-
- /* hair shape */
- short shape_flag;
- char _pad6[2];
-
- float twist;
- char _pad8[4];
-
- /* hair thickness shape */
- float shape;
- float rad_root, rad_tip, rad_scale;
-
- struct CurveMapping *twistcurve;
- void *_pad7;
+ ID id;
+ struct AnimData *adt;
+
+ struct BoidSettings *boids;
+ struct SPHFluidSettings *fluid;
+
+ struct EffectorWeights *effector_weights;
+ struct Collection *collision_group;
+
+ int flag, rt;
+ short type, from, distr, texact;
+ /* physics modes */
+ short phystype, rotmode, avemode, reactevent;
+ int draw;
+ float draw_size;
+ short draw_as, childtype;
+ char _pad2[4];
+ short ren_as, subframes, draw_col;
+ /* number of path segments, power of 2 except */
+ short draw_step, ren_step;
+ short hair_step, keys_step;
+
+ /* adaptive path rendering */
+ short adapt_angle, adapt_pix;
+
+ short disp, omat, interpolation, integrator;
+ short rotfrom DNA_DEPRECATED;
+ short kink, kink_axis;
+
+ /* billboards */
+ short bb_align, bb_uv_split, bb_anim, bb_split_offset DNA_DEPRECATED;
+ float bb_tilt, bb_rand_tilt, bb_offset[2], bb_size[2], bb_vel_head, bb_vel_tail DNA_DEPRECATED;
+
+ /* draw color */
+ float color_vec_max;
+
+ /* time and emission */
+ float sta, end, lifetime, randlife;
+ float timetweak, courant_target;
+ float jitfac, eff_hair, grid_rand, ps_offset[1];
+ int totpart, userjit, grid_res, effector_amount;
+ short time_flag;
+ char _pad0[6];
+
+ /* initial velocity factors */
+ float normfac, obfac, randfac, partfac, tanfac, tanphase, reactfac;
+ float ob_vel[3];
+ float avefac, phasefac, randrotfac, randphasefac;
+ /* physical properties */
+ float mass, size, randsize;
+ /* global physical properties */
+ float acc[3], dragfac, brownfac, dampfac;
+ /* length */
+ float randlength;
+ /* children */
+ int child_flag;
+ char _pad3[4];
+ int child_nbr, ren_child_nbr;
+ float parents, childsize, childrandsize;
+ float childrad, childflat;
+ /* clumping */
+ float clumpfac, clumppow;
+ /* kink */
+ float kink_amp, kink_freq, kink_shape, kink_flat;
+ float kink_amp_clump;
+ int kink_extra_steps;
+ char _pad4[4];
+ float kink_axis_random, kink_amp_random;
+ /* rough */
+ float rough1, rough1_size;
+ float rough2, rough2_size, rough2_thres;
+ float rough_end, rough_end_shape;
+ /* length */
+ float clength, clength_thres;
+ /* parting */
+ float parting_fac;
+ float parting_min, parting_max;
+ /* branching */
+ float branch_thres;
+ /* drawing stuff */
+ float draw_line[2];
+ float path_start, path_end;
+ int trail_count;
+ /* keyed particles */
+ int keyed_loops;
+ struct CurveMapping *clumpcurve;
+ struct CurveMapping *roughcurve;
+ float clump_noise_size;
+
+ /* hair dynamics */
+ float bending_random;
+
+ /** MAX_MTEX. */
+ struct MTex *mtex[18];
+
+ struct Collection *instance_collection;
+ struct ListBase instance_weights;
+ struct Collection *eff_group DNA_DEPRECATED; // deprecated
+ struct Object *instance_object;
+ struct Object *bb_ob;
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ struct PartDeflect *pd;
+ struct PartDeflect *pd2;
+
+ /* modified dm support */
+ short use_modifier_stack;
+ char _pad5[2];
+
+ /* hair shape */
+ short shape_flag;
+ char _pad6[2];
+
+ float twist;
+ char _pad8[4];
+
+ /* hair thickness shape */
+ float shape;
+ float rad_root, rad_tip, rad_scale;
+
+ struct CurveMapping *twistcurve;
+ void *_pad7;
} ParticleSettings;
typedef struct ParticleSystem {
- /* note1: make sure all (runtime) are NULL's in 'copy_particlesystem' XXX,
- * this function is no more! - need to invstigate */
-
- /* note2: make sure any uses of this struct in DNA are
- * accounted for in 'BKE_object_copy_particlesystems' */
-
- struct ParticleSystem *next, *prev;
-
- /** Particle settings. */
- ParticleSettings *part;
-
- /** (parent) particles. */
- ParticleData *particles;
- /** Child particles. */
- ChildParticle *child;
-
- /** Particle editmode (runtime). */
- struct PTCacheEdit *edit;
- /** Free callback. */
- void (*free_edit)(struct PTCacheEdit *edit);
-
- /** Path cache (runtime). */
- struct ParticleCacheKey **pathcache;
- /** Child cache (runtime). */
- struct ParticleCacheKey **childcache;
- /** Buffers for the above. */
- ListBase pathcachebufs, childcachebufs;
-
- /** Cloth simulation for hair. */
- struct ClothModifierData *clmd;
- /** Input/output for cloth simulation. */
- struct Mesh *hair_in_mesh, *hair_out_mesh;
-
- struct Object *target_ob;
-
- /** Run-time only lattice deformation data. */
- struct LatticeDeformData *lattice_deform_data;
-
- /** Particles from global space -> parent space. */
- struct Object *parent;
-
- /** Used for keyed and boid physics. */
- struct ListBase targets;
-
- /** Particle system name, MAX_NAME. */
- char name[64];
-
- /** Used for instancing. */
- float imat[4][4];
- float cfra, tree_frame, bvhtree_frame;
- int seed, child_seed;
- int flag, totpart, totunexist, totchild, totcached, totchildcache;
- /* NOTE: Recalc is one of ID_RECALC_PSYS_ALL flags.
- *
- * TODO(sergey): Use part->id.recalc instead of this duplicated flag
- * somehow. */
- int recalc;
- short target_psys, totkeyed, bakespace;
- char _pad1[6];
-
- /** Billboard uv name, MAX_CUSTOMDATA_LAYER_NAME. */
- char bb_uvname[3][64] DNA_DEPRECATED;
-
- /* if you change these remember to update array lengths to PSYS_TOT_VG! */
- /** Vertex groups, 0==disable, 1==starting index. */
- short vgroup[13], vg_neg, rt3;
- char _pad[6];
-
- /* point cache */
- struct PointCache *pointcache;
- struct ListBase ptcaches;
-
- struct ListBase *effectors;
-
- ParticleSpring *fluid_springs;
- int tot_fluidsprings, alloc_fluidsprings;
-
- /** Used for interactions with self and other systems. */
- struct KDTree_3d *tree;
- /** Used for interactions with self and other systems. */
- struct BVHTree *bvhtree;
-
- struct ParticleDrawData *pdd;
-
- /** Current time step, as a fraction of a frame. */
- float dt_frac;
- /** Influence of the lattice modifier. */
- float lattice_strength;
-
- void *batch_cache;
-
- /* Set by dependency graph's copy-on-write, 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;
+ /* note1: make sure all (runtime) are NULL's in 'copy_particlesystem' XXX,
+ * this function is no more! - need to invstigate */
+
+ /* note2: make sure any uses of this struct in DNA are
+ * accounted for in 'BKE_object_copy_particlesystems' */
+
+ struct ParticleSystem *next, *prev;
+
+ /** Particle settings. */
+ ParticleSettings *part;
+
+ /** (parent) particles. */
+ ParticleData *particles;
+ /** Child particles. */
+ ChildParticle *child;
+
+ /** Particle editmode (runtime). */
+ struct PTCacheEdit *edit;
+ /** Free callback. */
+ void (*free_edit)(struct PTCacheEdit *edit);
+
+ /** Path cache (runtime). */
+ struct ParticleCacheKey **pathcache;
+ /** Child cache (runtime). */
+ struct ParticleCacheKey **childcache;
+ /** Buffers for the above. */
+ ListBase pathcachebufs, childcachebufs;
+
+ /** Cloth simulation for hair. */
+ struct ClothModifierData *clmd;
+ /** Input/output for cloth simulation. */
+ struct Mesh *hair_in_mesh, *hair_out_mesh;
+
+ struct Object *target_ob;
+
+ /** Run-time only lattice deformation data. */
+ struct LatticeDeformData *lattice_deform_data;
+
+ /** Particles from global space -> parent space. */
+ struct Object *parent;
+
+ /** Used for keyed and boid physics. */
+ struct ListBase targets;
+
+ /** Particle system name, MAX_NAME. */
+ char name[64];
+
+ /** Used for instancing. */
+ float imat[4][4];
+ float cfra, tree_frame, bvhtree_frame;
+ int seed, child_seed;
+ int flag, totpart, totunexist, totchild, totcached, totchildcache;
+ /* NOTE: Recalc is one of ID_RECALC_PSYS_ALL flags.
+ *
+ * TODO(sergey): Use part->id.recalc instead of this duplicated flag
+ * somehow. */
+ int recalc;
+ short target_psys, totkeyed, bakespace;
+ char _pad1[6];
+
+ /** Billboard uv name, MAX_CUSTOMDATA_LAYER_NAME. */
+ char bb_uvname[3][64] DNA_DEPRECATED;
+
+ /* if you change these remember to update array lengths to PSYS_TOT_VG! */
+ /** Vertex groups, 0==disable, 1==starting index. */
+ short vgroup[13], vg_neg, rt3;
+ char _pad[6];
+
+ /* point cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
+
+ struct ListBase *effectors;
+
+ ParticleSpring *fluid_springs;
+ int tot_fluidsprings, alloc_fluidsprings;
+
+ /** Used for interactions with self and other systems. */
+ struct KDTree_3d *tree;
+ /** Used for interactions with self and other systems. */
+ struct BVHTree *bvhtree;
+
+ struct ParticleDrawData *pdd;
+
+ /** Current time step, as a fraction of a frame. */
+ float dt_frac;
+ /** Influence of the lattice modifier. */
+ float lattice_strength;
+
+ void *batch_cache;
+
+ /* Set by dependency graph's copy-on-write, 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;
} ParticleSystem;
typedef enum eParticleDrawFlag {
- PART_DRAW_VEL = (1 << 0),
- PART_DRAW_GLOBAL_OB = (1 << 1),
- PART_DRAW_SIZE = (1 << 2),
+ PART_DRAW_VEL = (1 << 0),
+ PART_DRAW_GLOBAL_OB = (1 << 1),
+ PART_DRAW_SIZE = (1 << 2),
#ifdef DNA_DEPRECATED
- /** Render emitter as well. */
- PART_DRAW_EMITTER = (1 << 3), /* DEPRECATED */
+ /** 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), /* 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),
+ PART_DRAW_HEALTH = (1 << 4),
+ PART_ABS_PATH_TIME = (1 << 5),
+ PART_DRAW_COUNT_GR = (1 << 6),
+ PART_DRAW_BB_LOCK = (1 << 7),
+ /* 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),
} eParticleDrawFlag;
/* part->type */
/* hair is always baked static in object/geometry space */
/* other types (normal particles) are in global space and not static baked */
-#define PART_EMITTER 0
-//#define PART_REACTOR 1
-#define PART_HAIR 2
-#define PART_FLUID 3
+#define PART_EMITTER 0
+//#define PART_REACTOR 1
+#define PART_HAIR 2
+#define PART_FLUID 3
/* part->flag */
-#define PART_REACT_STA_END 1
-#define PART_REACT_MULTIPLE 2
+#define PART_REACT_STA_END 1
+#define PART_REACT_MULTIPLE 2
-//#define PART_LOOP 4 /* not used anymore */
- /* for dopesheet */
-#define PART_DS_EXPAND 8
+//#define PART_LOOP 4 /* not used anymore */
+/* for dopesheet */
+#define PART_DS_EXPAND 8
-#define PART_HAIR_REGROW 16 /* regrow hair for each frame */
+#define PART_HAIR_REGROW 16 /* regrow hair for each frame */
-#define PART_UNBORN 32 /*show unborn particles*/
-#define PART_DIED 64 /*show died particles*/
+#define PART_UNBORN 32 /*show unborn particles*/
+#define PART_DIED 64 /*show died particles*/
-#define PART_TRAND 128
-#define PART_EDISTR 256 /* particle/face from face areas */
+#define PART_TRAND 128
+#define PART_EDISTR 256 /* particle/face from face areas */
-#define PART_ROTATIONS 512 /* calculate particle rotations (and store them in pointcache) */
-#define PART_DIE_ON_COL (1 << 12)
-#define PART_SIZE_DEFL (1 << 13) /* swept sphere deflections */
-#define PART_ROT_DYN (1 << 14) /* dynamic rotation */
-#define PART_SIZEMASS (1 << 16)
+#define PART_ROTATIONS 512 /* calculate particle rotations (and store them in pointcache) */
+#define PART_DIE_ON_COL (1 << 12)
+#define PART_SIZE_DEFL (1 << 13) /* swept sphere deflections */
+#define PART_ROT_DYN (1 << 14) /* dynamic rotation */
+#define PART_SIZEMASS (1 << 16)
-#define PART_HIDE_ADVANCED_HAIR (1 << 15)
+#define PART_HIDE_ADVANCED_HAIR (1 << 15)
-//#define PART_ABS_TIME (1 << 17)
-//#define PART_GLOB_TIME (1 << 18)
+//#define PART_ABS_TIME (1 << 17)
+//#define PART_GLOB_TIME (1 << 18)
-#define PART_BOIDS_2D (1 << 19)
+#define PART_BOIDS_2D (1 << 19)
-//#define PART_BRANCHING (1 << 20)
-//#define PART_ANIM_BRANCHING (1 << 21)
+//#define PART_BRANCHING (1 << 20)
+//#define PART_ANIM_BRANCHING (1 << 21)
-#define PART_HAIR_BSPLINE 1024
+#define PART_HAIR_BSPLINE 1024
-#define PART_GRID_HEXAGONAL (1 << 24)
-#define PART_GRID_INVERT (1 << 26)
+#define PART_GRID_HEXAGONAL (1 << 24)
+#define PART_GRID_INVERT (1 << 26)
-#define PART_CHILD_EFFECT (1 << 27)
-#define PART_CHILD_LONG_HAIR (1 << 28)
-/* #define PART_CHILD_RENDER (1 << 29) */ /*UNUSED*/
-#define PART_CHILD_GUIDE (1 << 30)
+#define PART_CHILD_EFFECT (1 << 27)
+#define PART_CHILD_LONG_HAIR (1 << 28)
+/* #define PART_CHILD_RENDER (1 << 29) */ /*UNUSED*/
+#define PART_CHILD_GUIDE (1 << 30)
-#define PART_SELF_EFFECT (1 << 22)
+#define PART_SELF_EFFECT (1 << 22)
/* part->from */
-#define PART_FROM_VERT 0
-#define PART_FROM_FACE 1
-#define PART_FROM_VOLUME 2
-/* #define PART_FROM_PARTICLE 3 deprecated! */
-#define PART_FROM_CHILD 4
+#define PART_FROM_VERT 0
+#define PART_FROM_FACE 1
+#define PART_FROM_VOLUME 2
+/* #define PART_FROM_PARTICLE 3 deprecated! */
+#define PART_FROM_CHILD 4
/* part->distr */
-#define PART_DISTR_JIT 0
-#define PART_DISTR_RAND 1
-#define PART_DISTR_GRID 2
+#define PART_DISTR_JIT 0
+#define PART_DISTR_RAND 1
+#define PART_DISTR_GRID 2
/* part->phystype */
-#define PART_PHYS_NO 0
-#define PART_PHYS_NEWTON 1
-#define PART_PHYS_KEYED 2
-#define PART_PHYS_BOIDS 3
-#define PART_PHYS_FLUID 4
+#define PART_PHYS_NO 0
+#define PART_PHYS_NEWTON 1
+#define PART_PHYS_KEYED 2
+#define PART_PHYS_BOIDS 3
+#define PART_PHYS_FLUID 4
/* part->kink */
typedef enum eParticleKink {
- PART_KINK_NO = 0,
- PART_KINK_CURL = 1,
- PART_KINK_RADIAL = 2,
- PART_KINK_WAVE = 3,
- PART_KINK_BRAID = 4,
- PART_KINK_SPIRAL = 5,
+ PART_KINK_NO = 0,
+ PART_KINK_CURL = 1,
+ PART_KINK_RADIAL = 2,
+ PART_KINK_WAVE = 3,
+ PART_KINK_BRAID = 4,
+ PART_KINK_SPIRAL = 5,
} eParticleKink;
/* part->child_flag */
typedef enum eParticleChildFlag {
- 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),
+ 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),
} eParticleChildFlag;
/* part->shape_flag */
typedef enum eParticleShapeFlag {
- PART_SHAPE_CLOSE_TIP = (1 << 0),
+ PART_SHAPE_CLOSE_TIP = (1 << 0),
} eParticleShapeFlag;
/* part->draw_col */
-#define PART_DRAW_COL_NONE 0
-#define PART_DRAW_COL_MAT 1
-#define PART_DRAW_COL_VEL 2
-#define PART_DRAW_COL_ACC 3
+#define PART_DRAW_COL_NONE 0
+#define PART_DRAW_COL_MAT 1
+#define PART_DRAW_COL_VEL 2
+#define PART_DRAW_COL_ACC 3
/* part->time_flag */
-#define PART_TIME_AUTOSF 1 /* Automatic subframes */
+#define PART_TIME_AUTOSF 1 /* Automatic subframes */
/* part->draw_as */
/* part->ren_as*/
-#define PART_DRAW_NOT 0
-#define PART_DRAW_DOT 1
-#define PART_DRAW_HALO 1
-#define PART_DRAW_CIRC 2
-#define PART_DRAW_CROSS 3
-#define PART_DRAW_AXIS 4
-#define PART_DRAW_LINE 5
-#define PART_DRAW_PATH 6
-#define PART_DRAW_OB 7
-#define PART_DRAW_GR 8
-#define PART_DRAW_BB 9 /* deprecated */
-#define PART_DRAW_REND 10
+#define PART_DRAW_NOT 0
+#define PART_DRAW_DOT 1
+#define PART_DRAW_HALO 1
+#define PART_DRAW_CIRC 2
+#define PART_DRAW_CROSS 3
+#define PART_DRAW_AXIS 4
+#define PART_DRAW_LINE 5
+#define PART_DRAW_PATH 6
+#define PART_DRAW_OB 7
+#define PART_DRAW_GR 8
+#define PART_DRAW_BB 9 /* deprecated */
+#define PART_DRAW_REND 10
/* part->integrator */
-#define PART_INT_EULER 0
-#define PART_INT_MIDPOINT 1
-#define PART_INT_RK4 2
-#define PART_INT_VERLET 3
+#define PART_INT_EULER 0
+#define PART_INT_MIDPOINT 1
+#define PART_INT_RK4 2
+#define PART_INT_VERLET 3
/* part->rotmode */
-#define PART_ROT_NOR 1
-#define PART_ROT_VEL 2
-#define PART_ROT_GLOB_X 3
-#define PART_ROT_GLOB_Y 4
-#define PART_ROT_GLOB_Z 5
-#define PART_ROT_OB_X 6
-#define PART_ROT_OB_Y 7
-#define PART_ROT_OB_Z 8
-#define PART_ROT_NOR_TAN 9
+#define PART_ROT_NOR 1
+#define PART_ROT_VEL 2
+#define PART_ROT_GLOB_X 3
+#define PART_ROT_GLOB_Y 4
+#define PART_ROT_GLOB_Z 5
+#define PART_ROT_OB_X 6
+#define PART_ROT_OB_Y 7
+#define PART_ROT_OB_Z 8
+#define PART_ROT_NOR_TAN 9
/* part->avemode */
-#define PART_AVE_VELOCITY 1
-#define PART_AVE_RAND 2
-#define PART_AVE_HORIZONTAL 3
-#define PART_AVE_VERTICAL 4
-#define PART_AVE_GLOBAL_X 5
-#define PART_AVE_GLOBAL_Y 6
-#define PART_AVE_GLOBAL_Z 7
+#define PART_AVE_VELOCITY 1
+#define PART_AVE_RAND 2
+#define PART_AVE_HORIZONTAL 3
+#define PART_AVE_VERTICAL 4
+#define PART_AVE_GLOBAL_X 5
+#define PART_AVE_GLOBAL_Y 6
+#define PART_AVE_GLOBAL_Z 7
/* part->reactevent */
-#define PART_EVENT_DEATH 0
-#define PART_EVENT_COLLIDE 1
-#define PART_EVENT_NEAR 2
+#define PART_EVENT_DEATH 0
+#define PART_EVENT_COLLIDE 1
+#define PART_EVENT_NEAR 2
/* part->childtype */
-#define PART_CHILD_PARTICLES 1
-#define PART_CHILD_FACES 2
+#define PART_CHILD_PARTICLES 1
+#define PART_CHILD_FACES 2
/* psys->flag */
-#define PSYS_CURRENT 1
-#define PSYS_GLOBAL_HAIR 2
-#define PSYS_HAIR_DYNAMICS 4
-#define PSYS_KEYED_TIMING 8
-//#define PSYS_ENABLED 16 /* deprecated */
-#define PSYS_HAIR_UPDATED 32 /* signal for updating hair particle mode */
-/* #define PSYS_DRAWING 64 */ /* deprecated */
-/* #define PSYS_USE_IMAT 128 */ /* deprecated */
-#define PSYS_DELETE 256 /* remove particlesystem as soon as possible */
-#define PSYS_HAIR_DONE 512
-#define PSYS_KEYED 1024
-#define PSYS_EDITED 2048
-//#define PSYS_PROTECT_CACHE 4096 /* deprecated */
-#define PSYS_DISABLED 8192
-#define PSYS_OB_ANIM_RESTORE 16384 /* runtime flag */
-#define PSYS_SHARED_CACHES 32768
+#define PSYS_CURRENT 1
+#define PSYS_GLOBAL_HAIR 2
+#define PSYS_HAIR_DYNAMICS 4
+#define PSYS_KEYED_TIMING 8
+//#define PSYS_ENABLED 16 /* deprecated */
+#define PSYS_HAIR_UPDATED 32 /* signal for updating hair particle mode */
+/* #define PSYS_DRAWING 64 */ /* deprecated */
+/* #define PSYS_USE_IMAT 128 */ /* deprecated */
+#define PSYS_DELETE 256 /* remove particlesystem as soon as possible */
+#define PSYS_HAIR_DONE 512
+#define PSYS_KEYED 1024
+#define PSYS_EDITED 2048
+//#define PSYS_PROTECT_CACHE 4096 /* deprecated */
+#define PSYS_DISABLED 8192
+#define PSYS_OB_ANIM_RESTORE 16384 /* runtime flag */
+#define PSYS_SHARED_CACHES 32768
/* pars->flag */
-#define PARS_UNEXIST 1
-#define PARS_NO_DISP 2
-//#define PARS_STICKY 4 /* deprecated */
-#define PARS_REKEY 8
+#define PARS_UNEXIST 1
+#define PARS_NO_DISP 2
+//#define PARS_STICKY 4 /* deprecated */
+#define PARS_REKEY 8
/* pars->alive */
-//#define PARS_KILLED 0 /* deprecated */
-#define PARS_DEAD 1
-#define PARS_UNBORN 2
-#define PARS_ALIVE 3
-#define PARS_DYING 4
+//#define PARS_KILLED 0 /* deprecated */
+#define PARS_DEAD 1
+#define PARS_UNBORN 2
+#define PARS_ALIVE 3
+#define PARS_DYING 4
/* ParticleDupliWeight->flag */
-#define PART_DUPLIW_CURRENT 1
+#define PART_DUPLIW_CURRENT 1
/* psys->vg */
-#define PSYS_TOT_VG 13
-
-#define PSYS_VG_DENSITY 0
-#define PSYS_VG_VEL 1
-#define PSYS_VG_LENGTH 2
-#define PSYS_VG_CLUMP 3
-#define PSYS_VG_KINK 4
-#define PSYS_VG_ROUGH1 5
-#define PSYS_VG_ROUGH2 6
-#define PSYS_VG_ROUGHE 7
-#define PSYS_VG_SIZE 8
-#define PSYS_VG_TAN 9
-#define PSYS_VG_ROT 10
-#define PSYS_VG_EFFECTOR 11
-#define PSYS_VG_TWIST 12
+#define PSYS_TOT_VG 13
+
+#define PSYS_VG_DENSITY 0
+#define PSYS_VG_VEL 1
+#define PSYS_VG_LENGTH 2
+#define PSYS_VG_CLUMP 3
+#define PSYS_VG_KINK 4
+#define PSYS_VG_ROUGH1 5
+#define PSYS_VG_ROUGH2 6
+#define PSYS_VG_ROUGHE 7
+#define PSYS_VG_SIZE 8
+#define PSYS_VG_TAN 9
+#define PSYS_VG_ROT 10
+#define PSYS_VG_EFFECTOR 11
+#define PSYS_VG_TWIST 12
/* ParticleTarget->flag */
-#define PTARGET_CURRENT 1
-#define PTARGET_VALID 2
+#define PTARGET_CURRENT 1
+#define PTARGET_VALID 2
/* ParticleTarget->mode */
-#define PTARGET_MODE_NEUTRAL 0
-#define PTARGET_MODE_FRIEND 1
-#define PTARGET_MODE_ENEMY 2
+#define PTARGET_MODE_NEUTRAL 0
+#define PTARGET_MODE_FRIEND 1
+#define PTARGET_MODE_ENEMY 2
/* mapto */
typedef enum eParticleTextureInfluence {
- /* 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),
+ /* 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),
} eParticleTextureInfluence;
#endif
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index 4859bf6eda9..f69c84cb7a1 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -36,13 +36,13 @@ struct EffectorWeights;
/* Container for data shared by original and evaluated copies of RigidBodyWorld */
typedef struct RigidBodyWorld_Shared {
- /* cache */
- struct PointCache *pointcache;
- struct ListBase ptcaches;
+ /* cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
- /* References to Physics Sim objects. Exist at runtime only ---------------------- */
- /** Physics sim world (i.e. btDiscreteDynamicsWorld). */
- void *physics_world;
+ /* References to Physics Sim objects. Exist at runtime only ---------------------- */
+ /** Physics sim world (i.e. btDiscreteDynamicsWorld). */
+ void *physics_world;
} RigidBodyWorld_Shared;
/* RigidBodyWorld (rbw)
@@ -50,50 +50,50 @@ typedef struct RigidBodyWorld_Shared {
* Represents a "simulation scene" existing within the parent scene.
*/
typedef struct RigidBodyWorld {
- /* Sim World Settings ------------------------------------------------------------- */
- /** Effectors info. */
- struct EffectorWeights *effector_weights;
-
- /** Group containing objects to use for Rigid Bodies. */
- struct Collection *group;
- /** Array to access group objects by index, only used at runtime. */
- struct Object **objects;
-
- /** Group containing objects to use for Rigid Body Constraint.s*/
- struct Collection *constraints;
-
- char _pad[4];
- /** Last frame world was evaluated for (internal). */
- float ltime;
-
- /** This pointer is shared between all evaluated copies. */
- struct RigidBodyWorld_Shared *shared;
- /** Moved to shared->pointcache. */
- struct PointCache *pointcache DNA_DEPRECATED;
- /** Moved to shared->ptcaches. */
- struct ListBase ptcaches DNA_DEPRECATED;
- /** Number of objects in rigid body group. */
- int numbodies;
-
- /** Number of simulation steps thaken per second. */
- short steps_per_second;
- /** Number of constraint solver iterations made per simulation step. */
- short num_solver_iterations;
-
- /** (eRigidBodyWorld_Flag) settings for this RigidBodyWorld. */
- int flag;
- /** Used to speed up or slow down the simulation. */
- float time_scale;
+ /* Sim World Settings ------------------------------------------------------------- */
+ /** Effectors info. */
+ struct EffectorWeights *effector_weights;
+
+ /** Group containing objects to use for Rigid Bodies. */
+ struct Collection *group;
+ /** Array to access group objects by index, only used at runtime. */
+ struct Object **objects;
+
+ /** Group containing objects to use for Rigid Body Constraint.s*/
+ struct Collection *constraints;
+
+ char _pad[4];
+ /** Last frame world was evaluated for (internal). */
+ float ltime;
+
+ /** This pointer is shared between all evaluated copies. */
+ struct RigidBodyWorld_Shared *shared;
+ /** Moved to shared->pointcache. */
+ struct PointCache *pointcache DNA_DEPRECATED;
+ /** Moved to shared->ptcaches. */
+ struct ListBase ptcaches DNA_DEPRECATED;
+ /** Number of objects in rigid body group. */
+ int numbodies;
+
+ /** Number of simulation steps thaken per second. */
+ short steps_per_second;
+ /** Number of constraint solver iterations made per simulation step. */
+ short num_solver_iterations;
+
+ /** (eRigidBodyWorld_Flag) settings for this RigidBodyWorld. */
+ int flag;
+ /** Used to speed up or slow down the simulation. */
+ float time_scale;
} RigidBodyWorld;
/* Flags for RigidBodyWorld */
typedef enum eRigidBodyWorld_Flag {
- /* 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),
- /* usse split impulse when stepping the simulation */
- RBW_FLAG_USE_SPLIT_IMPULSE = (1 << 2),
+ /* 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),
+ /* usse split impulse when stepping the simulation */
+ RBW_FLAG_USE_SPLIT_IMPULSE = (1 << 2),
} eRigidBodyWorld_Flag;
/* ******************************** */
@@ -106,11 +106,11 @@ typedef enum eRigidBodyWorld_Flag {
#
#
typedef struct RigidBodyOb_Shared {
- /* References to Physics Sim objects. Exist at runtime only */
- /** Physics object representation (i.e. btRigidBody). */
- void *physics_object;
- /** Collision shape used by physics sim (i.e. btCollisionShape). */
- void *physics_shape;
+ /* References to Physics Sim objects. Exist at runtime only */
+ /** Physics object representation (i.e. btRigidBody). */
+ void *physics_object;
+ /** Collision shape used by physics sim (i.e. btCollisionShape). */
+ void *physics_shape;
} RigidBodyOb_Shared;
/* RigidBodyObject (rbo)
@@ -120,110 +120,109 @@ typedef struct RigidBodyOb_Shared {
* participating in a sim.
*/
typedef struct RigidBodyOb {
- /* General Settings for this RigidBodyOb */
- /** (eRigidBodyOb_Type) role of RigidBody in sim . */
- short type;
- /** (eRigidBody_Shape) collision shape to use. */
- short shape;
-
- /** (eRigidBodyOb_Flag). */
- int flag;
- /** Collision groups that determines which rigid bodies can collide with each other. */
- int col_groups;
- /** (eRigidBody_MeshSource) mesh source for mesh based collision shapes. */
- short mesh_source;
- char _pad[2];
-
- /* Physics Parameters */
- /** How much object 'weighs' (i.e. absolute 'amount of stuff' it holds). */
- float mass;
-
- /** Resistance of object to movement. */
- float friction;
- /** How 'bouncy' object is when it collides. */
- float restitution;
-
- /** Tolerance for detecting collisions. */
- float margin;
-
- /** Damping for linear velocities. */
- float lin_damping;
- /** Damping for angular velocities. */
- float ang_damping;
-
- /** Deactivation threshold for linear velocities. */
- float lin_sleep_thresh;
- /** Deactivation threshold for angular velocities. */
- float ang_sleep_thresh;
-
- /** 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;
+ /* General Settings for this RigidBodyOb */
+ /** (eRigidBodyOb_Type) role of RigidBody in sim . */
+ short type;
+ /** (eRigidBody_Shape) collision shape to use. */
+ short shape;
+
+ /** (eRigidBodyOb_Flag). */
+ int flag;
+ /** Collision groups that determines which rigid bodies can collide with each other. */
+ int col_groups;
+ /** (eRigidBody_MeshSource) mesh source for mesh based collision shapes. */
+ short mesh_source;
+ char _pad[2];
+
+ /* Physics Parameters */
+ /** How much object 'weighs' (i.e. absolute 'amount of stuff' it holds). */
+ float mass;
+
+ /** Resistance of object to movement. */
+ float friction;
+ /** How 'bouncy' object is when it collides. */
+ float restitution;
+
+ /** Tolerance for detecting collisions. */
+ float margin;
+
+ /** Damping for linear velocities. */
+ float lin_damping;
+ /** Damping for angular velocities. */
+ float ang_damping;
+
+ /** Deactivation threshold for linear velocities. */
+ float lin_sleep_thresh;
+ /** Deactivation threshold for angular velocities. */
+ float ang_sleep_thresh;
+
+ /** 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;
} RigidBodyOb;
-
/* Participation types for RigidBodyOb */
typedef enum eRigidBodyOb_Type {
- /* 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,
+ /* 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,
} eRigidBodyOb_Type;
/* Flags for RigidBodyOb */
typedef enum eRigidBodyOb_Flag {
- /* 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),
+ /* 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),
} eRigidBodyOb_Flag;
/* RigidBody Collision Shape */
typedef enum eRigidBody_Shape {
- /** Simple box (i.e. bounding box). */
- RB_SHAPE_BOX = 0,
- /** Sphere. */
- RB_SHAPE_SPHERE,
- /** Rounded "pill" shape (i.e. calcium tablets). */
- RB_SHAPE_CAPSULE,
- /** Cylinder (i.e. pringles can). */
- RB_SHAPE_CYLINDER,
- /** Cone (i.e. party hat). */
- RB_SHAPE_CONE,
-
- /** Convex hull (minimal shrinkwrap encompassing all verts). */
- RB_SHAPE_CONVEXH,
- /** Triangulated mesh. */
- RB_SHAPE_TRIMESH,
-
- /* concave mesh approximated using primitives */
- //RB_SHAPE_COMPOUND,
+ /** Simple box (i.e. bounding box). */
+ RB_SHAPE_BOX = 0,
+ /** Sphere. */
+ RB_SHAPE_SPHERE,
+ /** Rounded "pill" shape (i.e. calcium tablets). */
+ RB_SHAPE_CAPSULE,
+ /** Cylinder (i.e. pringles can). */
+ RB_SHAPE_CYLINDER,
+ /** Cone (i.e. party hat). */
+ RB_SHAPE_CONE,
+
+ /** Convex hull (minimal shrinkwrap encompassing all verts). */
+ RB_SHAPE_CONVEXH,
+ /** Triangulated mesh. */
+ RB_SHAPE_TRIMESH,
+
+ /* concave mesh approximated using primitives */
+ //RB_SHAPE_COMPOUND,
} eRigidBody_Shape;
typedef enum eRigidBody_MeshSource {
- /* base mesh */
- RBO_MESH_BASE = 0,
- /* only deformations */
- RBO_MESH_DEFORM,
- /* final derived mesh */
- RBO_MESH_FINAL,
+ /* base mesh */
+ RBO_MESH_BASE = 0,
+ /* only deformations */
+ RBO_MESH_DEFORM,
+ /* final derived mesh */
+ RBO_MESH_FINAL,
} eRigidBody_MeshSource;
/* ******************************** */
@@ -234,139 +233,138 @@ typedef enum eRigidBody_MeshSource {
* Represents an constraint connecting two rigid bodies.
*/
typedef struct RigidBodyCon {
- /** First object influenced by the constraint. */
- struct Object *ob1;
- /** Second object influenced by the constraint. */
- struct Object *ob2;
-
- /* General Settings for this RigidBodyCon */
- /** (eRigidBodyCon_Type) role of RigidBody in sim . */
- short type;
- /** Number of constraint solver iterations made per simulation step. */
- short num_solver_iterations;
-
- /** (eRigidBodyCon_Flag). */
- int flag;
-
- /** Breaking impulse threshold. */
- float breaking_threshold;
- /** Spring implementation to use. */
- char spring_type;
- char _pad[3];
-
- /* limits */
- /* translation limits */
- float limit_lin_x_lower;
- float limit_lin_x_upper;
- float limit_lin_y_lower;
- float limit_lin_y_upper;
- float limit_lin_z_lower;
- float limit_lin_z_upper;
- /* rotation limits */
- float limit_ang_x_lower;
- float limit_ang_x_upper;
- float limit_ang_y_lower;
- float limit_ang_y_upper;
- float limit_ang_z_lower;
- float limit_ang_z_upper;
-
- /* spring settings */
- /* resistance to deformation */
- float spring_stiffness_x;
- float spring_stiffness_y;
- float spring_stiffness_z;
- float spring_stiffness_ang_x;
- float spring_stiffness_ang_y;
- float spring_stiffness_ang_z;
- /* amount of velocity lost over time */
- float spring_damping_x;
- float spring_damping_y;
- float spring_damping_z;
- float spring_damping_ang_x;
- float spring_damping_ang_y;
- float spring_damping_ang_z;
-
- /* motor settings */
- /** Linear velocity the motor tries to hold. */
- float motor_lin_target_velocity;
- /** Angular velocity the motor tries to hold. */
- float motor_ang_target_velocity;
- /** Maximum force used to reach linear target velocity. */
- float motor_lin_max_impulse;
- /** Maximum force used to reach angular target velocity. */
- float motor_ang_max_impulse;
-
- /* References to Physics Sim object. Exist at runtime only */
- /** Physics object representation (i.e. btTypedConstraint). */
- void *physics_constraint;
+ /** First object influenced by the constraint. */
+ struct Object *ob1;
+ /** Second object influenced by the constraint. */
+ struct Object *ob2;
+
+ /* General Settings for this RigidBodyCon */
+ /** (eRigidBodyCon_Type) role of RigidBody in sim . */
+ short type;
+ /** Number of constraint solver iterations made per simulation step. */
+ short num_solver_iterations;
+
+ /** (eRigidBodyCon_Flag). */
+ int flag;
+
+ /** Breaking impulse threshold. */
+ float breaking_threshold;
+ /** Spring implementation to use. */
+ char spring_type;
+ char _pad[3];
+
+ /* limits */
+ /* translation limits */
+ float limit_lin_x_lower;
+ float limit_lin_x_upper;
+ float limit_lin_y_lower;
+ float limit_lin_y_upper;
+ float limit_lin_z_lower;
+ float limit_lin_z_upper;
+ /* rotation limits */
+ float limit_ang_x_lower;
+ float limit_ang_x_upper;
+ float limit_ang_y_lower;
+ float limit_ang_y_upper;
+ float limit_ang_z_lower;
+ float limit_ang_z_upper;
+
+ /* spring settings */
+ /* resistance to deformation */
+ float spring_stiffness_x;
+ float spring_stiffness_y;
+ float spring_stiffness_z;
+ float spring_stiffness_ang_x;
+ float spring_stiffness_ang_y;
+ float spring_stiffness_ang_z;
+ /* amount of velocity lost over time */
+ float spring_damping_x;
+ float spring_damping_y;
+ float spring_damping_z;
+ float spring_damping_ang_x;
+ float spring_damping_ang_y;
+ float spring_damping_ang_z;
+
+ /* motor settings */
+ /** Linear velocity the motor tries to hold. */
+ float motor_lin_target_velocity;
+ /** Angular velocity the motor tries to hold. */
+ float motor_ang_target_velocity;
+ /** Maximum force used to reach linear target velocity. */
+ float motor_lin_max_impulse;
+ /** Maximum force used to reach angular target velocity. */
+ float motor_ang_max_impulse;
+
+ /* References to Physics Sim object. Exist at runtime only */
+ /** Physics object representation (i.e. btTypedConstraint). */
+ void *physics_constraint;
} RigidBodyCon;
-
/* Participation types for RigidBodyOb */
typedef enum eRigidBodyCon_Type {
- /** lets bodies rotate around a specified point */
- RBC_TYPE_POINT = 0,
- /** lets bodies rotate around a specified axis */
- RBC_TYPE_HINGE,
- /** simulates wheel suspension */
- RBC_TYPE_HINGE2,
- /** restricts movent to a specified axis */
- RBC_TYPE_SLIDER,
- /** lets object rotate within a cpecified cone */
- RBC_TYPE_CONE_TWIST,
- /** allows user to specify constraint axes */
- RBC_TYPE_6DOF,
- /** like 6DOF but has springs */
- RBC_TYPE_6DOF_SPRING,
- /** simulates a universal joint */
- RBC_TYPE_UNIVERSAL,
- /** glues two bodies together */
- RBC_TYPE_FIXED,
- /** similar to slider but also allows rotation around slider axis */
- RBC_TYPE_PISTON,
- /** Simplified spring constraint with only once axis that's
- * automatically placed between the connected bodies */
- RBC_TYPE_SPRING,
- /** dirves bodies by applying linear and angular forces */
- RBC_TYPE_MOTOR,
+ /** lets bodies rotate around a specified point */
+ RBC_TYPE_POINT = 0,
+ /** lets bodies rotate around a specified axis */
+ RBC_TYPE_HINGE,
+ /** simulates wheel suspension */
+ RBC_TYPE_HINGE2,
+ /** restricts movent to a specified axis */
+ RBC_TYPE_SLIDER,
+ /** lets object rotate within a cpecified cone */
+ RBC_TYPE_CONE_TWIST,
+ /** allows user to specify constraint axes */
+ RBC_TYPE_6DOF,
+ /** like 6DOF but has springs */
+ RBC_TYPE_6DOF_SPRING,
+ /** simulates a universal joint */
+ RBC_TYPE_UNIVERSAL,
+ /** glues two bodies together */
+ RBC_TYPE_FIXED,
+ /** similar to slider but also allows rotation around slider axis */
+ RBC_TYPE_PISTON,
+ /** Simplified spring constraint with only once axis that's
+ * automatically placed between the connected bodies */
+ RBC_TYPE_SPRING,
+ /** dirves bodies by applying linear and angular forces */
+ RBC_TYPE_MOTOR,
} eRigidBodyCon_Type;
/* Spring implementation type for RigidBodyOb */
typedef enum eRigidBodyCon_SpringType {
- RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */
- RBC_SPRING_TYPE2, /* btGeneric6DofSpring2Constraint */
+ RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */
+ RBC_SPRING_TYPE2, /* btGeneric6DofSpring2Constraint */
} eRigidBodyCon_SpringType;
/* Flags for RigidBodyCon */
typedef enum eRigidBodyCon_Flag {
- /* 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),
+ /* 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),
} eRigidBodyCon_Flag;
/* ******************************** */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 9f81eb854ea..28eb481ffd4 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -33,8 +33,8 @@
extern "C" {
#endif
-#include "DNA_color_types.h" /* color management */
-#include "DNA_customdata_types.h" /* Scene's runtime cddata masks. */
+#include "DNA_color_types.h" /* color management */
+#include "DNA_customdata_types.h" /* Scene's runtime cddata masks. */
#include "DNA_vec_types.h"
#include "DNA_listBase.h"
#include "DNA_ID.h"
@@ -71,60 +71,60 @@ struct bNodeTree;
/* Output Format Data */
typedef struct AviCodecData {
- /** Save format. */
- void *lpFormat;
- /** Compressor options. */
- void *lpParms;
- /** Size of lpFormat buffer. */
- unsigned int cbFormat;
- /** Size of lpParms buffer. */
- unsigned int cbParms;
-
- /** Stream type, for consistency. */
- unsigned int fccType;
- /** Compressor. */
- unsigned int fccHandler;
- /** Keyframe rate. */
- unsigned int dwKeyFrameEvery;
- /** Compress quality 0-10,000. */
- unsigned int dwQuality;
- /** Bytes per second. */
- unsigned int dwBytesPerSecond;
- /** Flags... see below. */
- unsigned int dwFlags;
- /** For non-video streams only. */
- unsigned int dwInterleaveEvery;
- char _pad[4];
-
- char avicodecname[128];
+ /** Save format. */
+ void *lpFormat;
+ /** Compressor options. */
+ void *lpParms;
+ /** Size of lpFormat buffer. */
+ unsigned int cbFormat;
+ /** Size of lpParms buffer. */
+ unsigned int cbParms;
+
+ /** Stream type, for consistency. */
+ unsigned int fccType;
+ /** Compressor. */
+ unsigned int fccHandler;
+ /** Keyframe rate. */
+ unsigned int dwKeyFrameEvery;
+ /** Compress quality 0-10,000. */
+ unsigned int dwQuality;
+ /** Bytes per second. */
+ unsigned int dwBytesPerSecond;
+ /** Flags... see below. */
+ unsigned int dwFlags;
+ /** For non-video streams only. */
+ unsigned int dwInterleaveEvery;
+ char _pad[4];
+
+ char avicodecname[128];
} AviCodecData;
typedef enum eFFMpegPreset {
- FFM_PRESET_NONE,
+ FFM_PRESET_NONE,
#ifdef DNA_DEPRECATED
- /* Previously used by h.264 to control encoding speed vs. file size. */
- FFM_PRESET_ULTRAFAST, /* DEPRECATED */
- FFM_PRESET_SUPERFAST, /* DEPRECATED */
- FFM_PRESET_VERYFAST, /* DEPRECATED */
- FFM_PRESET_FASTER, /* DEPRECATED */
- FFM_PRESET_FAST, /* DEPRECATED */
- FFM_PRESET_MEDIUM, /* DEPRECATED */
- FFM_PRESET_SLOW, /* DEPRECATED */
- FFM_PRESET_SLOWER, /* DEPRECATED */
- FFM_PRESET_VERYSLOW, /* DEPRECATED */
+ /* Previously used by h.264 to control encoding speed vs. file size. */
+ FFM_PRESET_ULTRAFAST, /* DEPRECATED */
+ FFM_PRESET_SUPERFAST, /* DEPRECATED */
+ FFM_PRESET_VERYFAST, /* DEPRECATED */
+ FFM_PRESET_FASTER, /* DEPRECATED */
+ FFM_PRESET_FAST, /* DEPRECATED */
+ FFM_PRESET_MEDIUM, /* DEPRECATED */
+ FFM_PRESET_SLOW, /* DEPRECATED */
+ FFM_PRESET_SLOWER, /* DEPRECATED */
+ FFM_PRESET_VERYSLOW, /* DEPRECATED */
#endif
- /* Used by WEBM/VP9 and h.264 to control encoding speed vs. file size.
- * WEBM/VP9 use these values directly, whereas h.264 map those to
- * respectively the MEDIUM, SLOWER, and SUPERFAST presets.
- */
- /** the default and recommended for most applications */
- FFM_PRESET_GOOD = 10,
- /** recommended if you have lots of time and want the best compression efficiency */
- FFM_PRESET_BEST,
- /** recommended for live / fast encoding */
- FFM_PRESET_REALTIME,
+ /* Used by WEBM/VP9 and h.264 to control encoding speed vs. file size.
+ * WEBM/VP9 use these values directly, whereas h.264 map those to
+ * respectively the MEDIUM, SLOWER, and SUPERFAST presets.
+ */
+ /** the default and recommended for most applications */
+ FFM_PRESET_GOOD = 10,
+ /** recommended if you have lots of time and want the best compression efficiency */
+ FFM_PRESET_BEST,
+ /** recommended for live / fast encoding */
+ FFM_PRESET_REALTIME,
} eFFMpegPreset;
/* Mapping from easily-understandable descriptions to CRF values.
@@ -134,65 +134,65 @@ typedef enum eFFMpegPreset {
* to https://trac.ffmpeg.org/wiki/Encode/H.264#a1.ChooseaCRFvalue
*/
typedef enum eFFMpegCrf {
- FFM_CRF_NONE = -1,
- FFM_CRF_LOSSLESS = 0,
- FFM_CRF_PERC_LOSSLESS = 17,
- FFM_CRF_HIGH = 20,
- FFM_CRF_MEDIUM = 23,
- FFM_CRF_LOW = 26,
- FFM_CRF_VERYLOW = 29,
- FFM_CRF_LOWEST = 32,
+ FFM_CRF_NONE = -1,
+ FFM_CRF_LOSSLESS = 0,
+ FFM_CRF_PERC_LOSSLESS = 17,
+ FFM_CRF_HIGH = 20,
+ FFM_CRF_MEDIUM = 23,
+ FFM_CRF_LOW = 26,
+ FFM_CRF_VERYLOW = 29,
+ FFM_CRF_LOWEST = 32,
} eFFMpegCrf;
typedef enum eFFMpegAudioChannels {
- FFM_CHANNELS_MONO = 1,
- FFM_CHANNELS_STEREO = 2,
- FFM_CHANNELS_SURROUND4 = 4,
- FFM_CHANNELS_SURROUND51 = 6,
- FFM_CHANNELS_SURROUND71 = 8,
+ FFM_CHANNELS_MONO = 1,
+ FFM_CHANNELS_STEREO = 2,
+ FFM_CHANNELS_SURROUND4 = 4,
+ FFM_CHANNELS_SURROUND51 = 6,
+ FFM_CHANNELS_SURROUND71 = 8,
} eFFMpegAudioChannels;
typedef struct FFMpegCodecData {
- int type;
- int codec;
- int audio_codec;
- int video_bitrate;
- int audio_bitrate;
- int audio_mixrate;
- int audio_channels;
- char _pad0[4];
- float audio_volume;
- int gop_size;
- /** Only used if FFMPEG_USE_MAX_B_FRAMES flag is set. */
- int max_b_frames;
- int flags;
- int constant_rate_factor;
- /** See eFFMpegPreset. */
- int ffmpeg_preset;
-
- int rc_min_rate;
- int rc_max_rate;
- int rc_buffer_size;
- int mux_packet_size;
- int mux_rate;
- char _pad1[4];
-
- IDProperty *properties;
+ int type;
+ int codec;
+ int audio_codec;
+ int video_bitrate;
+ int audio_bitrate;
+ int audio_mixrate;
+ int audio_channels;
+ char _pad0[4];
+ float audio_volume;
+ int gop_size;
+ /** Only used if FFMPEG_USE_MAX_B_FRAMES flag is set. */
+ int max_b_frames;
+ int flags;
+ int constant_rate_factor;
+ /** See eFFMpegPreset. */
+ int ffmpeg_preset;
+
+ int rc_min_rate;
+ int rc_max_rate;
+ int rc_buffer_size;
+ int mux_packet_size;
+ int mux_rate;
+ char _pad1[4];
+
+ IDProperty *properties;
} FFMpegCodecData;
/* ************************************************************* */
/* Audio */
typedef struct AudioData {
- int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate
- float main; // 2.5: now in FFMpegCodecData: audio_volume
- float speed_of_sound;
- float doppler_factor;
- int distance_model;
- short flag;
- char _pad[2];
- float volume;
- char _pad2[4];
+ int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate
+ float main; // 2.5: now in FFMpegCodecData: audio_volume
+ float speed_of_sound;
+ float doppler_factor;
+ int distance_model;
+ short flag;
+ char _pad[2];
+ float volume;
+ char _pad2[4];
} AudioData;
/* *************************************************************** */
@@ -200,91 +200,91 @@ typedef struct AudioData {
/* Render Layer */
typedef struct SceneRenderLayer {
- struct SceneRenderLayer *next, *prev;
-
- /** MAX_NAME. */
- char name[64] DNA_DEPRECATED;
-
- /** Converted to ViewLayer setting. */
- struct Material *mat_override DNA_DEPRECATED;
-
- /** Converted to LayerCollection cycles camera visibility override. */
- unsigned int lay DNA_DEPRECATED;
- /** Converted to LayerCollection cycles holdout override. */
- unsigned int lay_zmask DNA_DEPRECATED;
- unsigned int lay_exclude DNA_DEPRECATED;
- /** Converted to ViewLayer layflag and flag. */
- int layflag DNA_DEPRECATED;
-
- /* pass_xor has to be after passflag */
- /** Pass_xor has to be after passflag. */
- int passflag DNA_DEPRECATED;
- /** Converted to ViewLayer passflag and flag. */
- int pass_xor DNA_DEPRECATED;
-
- /** Converted to ViewLayer setting. */
- int samples DNA_DEPRECATED;
- /** Converted to ViewLayer pass_alpha_threshold. */
- float pass_alpha_threshold DNA_DEPRECATED;
-
- /** Converted to ViewLayer id_properties. */
- IDProperty *prop DNA_DEPRECATED;
-
- /** Converted to ViewLayer freestyleConfig. */
- struct FreestyleConfig freestyleConfig DNA_DEPRECATED;
+ struct SceneRenderLayer *next, *prev;
+
+ /** MAX_NAME. */
+ char name[64] DNA_DEPRECATED;
+
+ /** Converted to ViewLayer setting. */
+ struct Material *mat_override DNA_DEPRECATED;
+
+ /** Converted to LayerCollection cycles camera visibility override. */
+ unsigned int lay DNA_DEPRECATED;
+ /** Converted to LayerCollection cycles holdout override. */
+ unsigned int lay_zmask DNA_DEPRECATED;
+ unsigned int lay_exclude DNA_DEPRECATED;
+ /** Converted to ViewLayer layflag and flag. */
+ int layflag DNA_DEPRECATED;
+
+ /* pass_xor has to be after passflag */
+ /** Pass_xor has to be after passflag. */
+ int passflag DNA_DEPRECATED;
+ /** Converted to ViewLayer passflag and flag. */
+ int pass_xor DNA_DEPRECATED;
+
+ /** Converted to ViewLayer setting. */
+ int samples DNA_DEPRECATED;
+ /** Converted to ViewLayer pass_alpha_threshold. */
+ float pass_alpha_threshold DNA_DEPRECATED;
+
+ /** Converted to ViewLayer id_properties. */
+ IDProperty *prop DNA_DEPRECATED;
+
+ /** Converted to ViewLayer freestyleConfig. */
+ struct FreestyleConfig freestyleConfig DNA_DEPRECATED;
} SceneRenderLayer;
/* SceneRenderLayer.layflag */
-#define SCE_LAY_SOLID (1 << 0)
-#define SCE_LAY_ZTRA (1 << 1)
-#define SCE_LAY_HALO (1 << 2)
-#define SCE_LAY_EDGE (1 << 3)
-#define SCE_LAY_SKY (1 << 4)
-#define SCE_LAY_STRAND (1 << 5)
-#define SCE_LAY_FRS (1 << 6)
-#define SCE_LAY_AO (1 << 7)
- /* flags between (1 << 8) and (1 << 15) are set to 1 already, for future options */
-
-#define SCE_LAY_ALL_Z (1 << 15)
-/* #define SCE_LAY_XOR (1 << 16) */ /* UNUSED */
-#define SCE_LAY_DISABLE (1 << 17)
-#define SCE_LAY_ZMASK (1 << 18)
-#define SCE_LAY_NEG_ZMASK (1 << 19)
+#define SCE_LAY_SOLID (1 << 0)
+#define SCE_LAY_ZTRA (1 << 1)
+#define SCE_LAY_HALO (1 << 2)
+#define SCE_LAY_EDGE (1 << 3)
+#define SCE_LAY_SKY (1 << 4)
+#define SCE_LAY_STRAND (1 << 5)
+#define SCE_LAY_FRS (1 << 6)
+#define SCE_LAY_AO (1 << 7)
+/* flags between (1 << 8) and (1 << 15) are set to 1 already, for future options */
+
+#define SCE_LAY_ALL_Z (1 << 15)
+/* #define SCE_LAY_XOR (1 << 16) */ /* UNUSED */
+#define SCE_LAY_DISABLE (1 << 17)
+#define SCE_LAY_ZMASK (1 << 18)
+#define SCE_LAY_NEG_ZMASK (1 << 19)
/* SceneRenderLayer.passflag */
typedef enum eScenePassType {
- SCE_PASS_COMBINED = (1 << 0),
- SCE_PASS_Z = (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_UNUSED_4 = (1 << 7), /* REFLECT */
- 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_RAYHITS = (1 << 15),
- 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),
+ SCE_PASS_COMBINED = (1 << 0),
+ SCE_PASS_Z = (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_UNUSED_4 = (1 << 7), /* REFLECT */
+ 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_RAYHITS = (1 << 15),
+ 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),
} eScenePassType;
#define RE_PASSNAME_DEPRECATED "Deprecated"
@@ -318,76 +318,75 @@ typedef enum eScenePassType {
#define RE_PASSNAME_SUBSURFACE_INDIRECT "SubsurfaceInd"
#define RE_PASSNAME_SUBSURFACE_COLOR "SubsurfaceCol"
-
/* View - MultiView */
typedef struct SceneRenderView {
- struct SceneRenderView *next, *prev;
+ struct SceneRenderView *next, *prev;
- /** MAX_NAME. */
- char name[64];
- /** MAX_NAME. */
- char suffix[64];
+ /** MAX_NAME. */
+ char name[64];
+ /** MAX_NAME. */
+ char suffix[64];
- int viewflag;
- char _pad2[4];
+ int viewflag;
+ char _pad2[4];
} SceneRenderView;
/* SceneRenderView.viewflag */
-#define SCE_VIEW_DISABLE (1 << 0)
+#define SCE_VIEW_DISABLE (1 << 0)
/* RenderData.views_format */
enum {
- SCE_VIEWS_FORMAT_STEREO_3D = 0,
- SCE_VIEWS_FORMAT_MULTIVIEW = 1,
+ SCE_VIEWS_FORMAT_STEREO_3D = 0,
+ SCE_VIEWS_FORMAT_MULTIVIEW = 1,
};
/* ImageFormatData.views_format (also used for Sequence.views_format) */
enum {
- R_IMF_VIEWS_INDIVIDUAL = 0,
- R_IMF_VIEWS_STEREO_3D = 1,
- R_IMF_VIEWS_MULTIVIEW = 2,
+ R_IMF_VIEWS_INDIVIDUAL = 0,
+ R_IMF_VIEWS_STEREO_3D = 1,
+ R_IMF_VIEWS_MULTIVIEW = 2,
};
typedef struct Stereo3dFormat {
- short flag;
- /** Encoding mode. */
- char display_mode;
- /** Anaglyph scheme for the user display. */
- char anaglyph_type;
- /** Interlace type for the user display. */
- char interlace_type;
- char _pad[3];
+ short flag;
+ /** Encoding mode. */
+ char display_mode;
+ /** Anaglyph scheme for the user display. */
+ char anaglyph_type;
+ /** Interlace type for the user display. */
+ char interlace_type;
+ char _pad[3];
} Stereo3dFormat;
/* Stereo3dFormat.display_mode */
typedef enum eStereoDisplayMode {
- S3D_DISPLAY_ANAGLYPH = 0,
- S3D_DISPLAY_INTERLACE = 1,
- S3D_DISPLAY_PAGEFLIP = 2,
- S3D_DISPLAY_SIDEBYSIDE = 3,
- S3D_DISPLAY_TOPBOTTOM = 4,
+ S3D_DISPLAY_ANAGLYPH = 0,
+ S3D_DISPLAY_INTERLACE = 1,
+ S3D_DISPLAY_PAGEFLIP = 2,
+ S3D_DISPLAY_SIDEBYSIDE = 3,
+ S3D_DISPLAY_TOPBOTTOM = 4,
} eStereoDisplayMode;
/* Stereo3dFormat.flag */
typedef enum eStereo3dFlag {
- S3D_INTERLACE_SWAP = (1 << 0),
- S3D_SIDEBYSIDE_CROSSEYED = (1 << 1),
- S3D_SQUEEZED_FRAME = (1 << 2),
+ S3D_INTERLACE_SWAP = (1 << 0),
+ S3D_SIDEBYSIDE_CROSSEYED = (1 << 1),
+ S3D_SQUEEZED_FRAME = (1 << 2),
} eStereo3dFlag;
/* Stereo3dFormat.anaglyph_type */
typedef enum eStereo3dAnaglyphType {
- S3D_ANAGLYPH_REDCYAN = 0,
- S3D_ANAGLYPH_GREENMAGENTA = 1,
- S3D_ANAGLYPH_YELLOWBLUE = 2,
+ S3D_ANAGLYPH_REDCYAN = 0,
+ S3D_ANAGLYPH_GREENMAGENTA = 1,
+ S3D_ANAGLYPH_YELLOWBLUE = 2,
} eStereo3dAnaglyphType;
/* Stereo3dFormat.interlace_type */
typedef enum eStereo3dInterlaceType {
- S3D_INTERLACE_ROW = 0,
- S3D_INTERLACE_COLUMN = 1,
- S3D_INTERLACE_CHECKERBOARD = 2,
+ S3D_INTERLACE_ROW = 0,
+ S3D_INTERLACE_COLUMN = 1,
+ S3D_INTERLACE_CHECKERBOARD = 2,
} eStereo3dInterlaceType;
/* *************************************************************** */
@@ -400,95 +399,93 @@ typedef enum eStereo3dInterlaceType {
* RNA ensures these enum's are only selectable for render output.
*/
typedef struct ImageFormatData {
- /**
- * R_IMF_IMTYPE_PNG, R_...
- * \note, video types should only ever be set from this structure when used from RenderData.
- */
- char imtype;
- /**
- * bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
- * not a flag, only set 1 at a time. */
- char depth;
-
- /** R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA. */
- char planes;
- /** Generic options for all image types, alpha zbuffer. */
- char flag;
-
- /** (0 - 100), eg: jpeg quality. */
- char quality;
- /** (0 - 100), eg: png compression. */
- char compress;
-
-
- /* --- format specific --- */
-
- /* OpenEXR */
- char exr_codec;
-
- /* Cineon */
- char cineon_flag;
- short cineon_white, cineon_black;
- float cineon_gamma;
-
- /* Jpeg2000 */
- char jp2_flag;
- char jp2_codec;
-
- /* TIFF */
- char tiff_codec;
-
- char _pad[4];
-
- /* Multiview */
- char views_format;
- Stereo3dFormat stereo3d_format;
-
- /* color management */
- ColorManagedViewSettings view_settings;
- ColorManagedDisplaySettings display_settings;
+ /**
+ * R_IMF_IMTYPE_PNG, R_...
+ * \note, video types should only ever be set from this structure when used from RenderData.
+ */
+ char imtype;
+ /**
+ * bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
+ * not a flag, only set 1 at a time. */
+ char depth;
+
+ /** R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA. */
+ char planes;
+ /** Generic options for all image types, alpha zbuffer. */
+ char flag;
+
+ /** (0 - 100), eg: jpeg quality. */
+ char quality;
+ /** (0 - 100), eg: png compression. */
+ char compress;
+
+ /* --- format specific --- */
+
+ /* OpenEXR */
+ char exr_codec;
+
+ /* Cineon */
+ char cineon_flag;
+ short cineon_white, cineon_black;
+ float cineon_gamma;
+
+ /* Jpeg2000 */
+ char jp2_flag;
+ char jp2_codec;
+
+ /* TIFF */
+ char tiff_codec;
+
+ char _pad[4];
+
+ /* Multiview */
+ char views_format;
+ Stereo3dFormat stereo3d_format;
+
+ /* color management */
+ ColorManagedViewSettings view_settings;
+ ColorManagedDisplaySettings display_settings;
} ImageFormatData;
-
/* ImageFormatData.imtype */
-#define R_IMF_IMTYPE_TARGA 0
-#define R_IMF_IMTYPE_IRIS 1
+#define R_IMF_IMTYPE_TARGA 0
+#define R_IMF_IMTYPE_IRIS 1
/* #define R_HAMX 2 */ /* hamx is nomore */
/* #define R_FTYPE 3 */ /* ftype is nomore */
-#define R_IMF_IMTYPE_JPEG90 4
+#define R_IMF_IMTYPE_JPEG90 4
/* #define R_MOVIE 5 */ /* movie is nomore */
-#define R_IMF_IMTYPE_IRIZ 7
-#define R_IMF_IMTYPE_RAWTGA 14
-#define R_IMF_IMTYPE_AVIRAW 15
-#define R_IMF_IMTYPE_AVIJPEG 16
-#define R_IMF_IMTYPE_PNG 17
+#define R_IMF_IMTYPE_IRIZ 7
+#define R_IMF_IMTYPE_RAWTGA 14
+#define R_IMF_IMTYPE_AVIRAW 15
+#define R_IMF_IMTYPE_AVIJPEG 16
+#define R_IMF_IMTYPE_PNG 17
/* #define R_IMF_IMTYPE_AVICODEC 18 */ /* avicodec is nomore */
/* #define R_IMF_IMTYPE_QUICKTIME 19 */ /* quicktime is nomore */
-#define R_IMF_IMTYPE_BMP 20
-#define R_IMF_IMTYPE_RADHDR 21
-#define R_IMF_IMTYPE_TIFF 22
-#define R_IMF_IMTYPE_OPENEXR 23
-#define R_IMF_IMTYPE_FFMPEG 24
+#define R_IMF_IMTYPE_BMP 20
+#define R_IMF_IMTYPE_RADHDR 21
+#define R_IMF_IMTYPE_TIFF 22
+#define R_IMF_IMTYPE_OPENEXR 23
+#define R_IMF_IMTYPE_FFMPEG 24
/* #define R_IMF_IMTYPE_FRAMESERVER 25 */ /* frame server is nomore */
-#define R_IMF_IMTYPE_CINEON 26
-#define R_IMF_IMTYPE_DPX 27
-#define R_IMF_IMTYPE_MULTILAYER 28
-#define R_IMF_IMTYPE_DDS 29
-#define R_IMF_IMTYPE_JP2 30
-#define R_IMF_IMTYPE_H264 31
-#define R_IMF_IMTYPE_XVID 32
-#define R_IMF_IMTYPE_THEORA 33
-#define R_IMF_IMTYPE_PSD 34
-
-#define R_IMF_IMTYPE_INVALID 255
+#define R_IMF_IMTYPE_CINEON 26
+#define R_IMF_IMTYPE_DPX 27
+#define R_IMF_IMTYPE_MULTILAYER 28
+#define R_IMF_IMTYPE_DDS 29
+#define R_IMF_IMTYPE_JP2 30
+#define R_IMF_IMTYPE_H264 31
+#define R_IMF_IMTYPE_XVID 32
+#define R_IMF_IMTYPE_THEORA 33
+#define R_IMF_IMTYPE_PSD 34
+
+#define R_IMF_IMTYPE_INVALID 255
/* ImageFormatData.flag */
-#define R_IMF_FLAG_ZBUF (1 << 0) /* was R_OPENEXR_ZBUF */
-#define R_IMF_FLAG_PREVIEW_JPG (1 << 1) /* was R_PREVIEW_JPG */
+#define R_IMF_FLAG_ZBUF (1 << 0) /* was R_OPENEXR_ZBUF */
+#define R_IMF_FLAG_PREVIEW_JPG (1 << 1) /* was R_PREVIEW_JPG */
/* return values from BKE_imtype_valid_depths, note this is depts per channel */
-#define R_IMF_CHAN_DEPTH_1 (1 << 0) /* 1bits (unused) */
-#define R_IMF_CHAN_DEPTH_8 (1 << 1) /* 8bits (default) */
+#define R_IMF_CHAN_DEPTH_1 (1 << 0) /* 1bits (unused) */
+#define R_IMF_CHAN_DEPTH_8 (1 << 1) /* 8bits (default) */
#define R_IMF_CHAN_DEPTH_10 (1 << 2) /* 10bits (uncommon, Cineon/DPX support) */
#define R_IMF_CHAN_DEPTH_12 (1 << 3) /* 12bits (uncommon, jp2/DPX support) */
#define R_IMF_CHAN_DEPTH_16 (1 << 4) /* 16bits (tiff, halff float exr) */
@@ -496,327 +493,324 @@ typedef struct ImageFormatData {
#define R_IMF_CHAN_DEPTH_32 (1 << 6) /* 32bits (full float exr) */
/* ImageFormatData.planes */
-#define R_IMF_PLANES_RGB 24
-#define R_IMF_PLANES_RGBA 32
-#define R_IMF_PLANES_BW 8
+#define R_IMF_PLANES_RGB 24
+#define R_IMF_PLANES_RGBA 32
+#define R_IMF_PLANES_BW 8
/* ImageFormatData.exr_codec */
-#define R_IMF_EXR_CODEC_NONE 0
+#define R_IMF_EXR_CODEC_NONE 0
#define R_IMF_EXR_CODEC_PXR24 1
-#define R_IMF_EXR_CODEC_ZIP 2
-#define R_IMF_EXR_CODEC_PIZ 3
-#define R_IMF_EXR_CODEC_RLE 4
-#define R_IMF_EXR_CODEC_ZIPS 5
-#define R_IMF_EXR_CODEC_B44 6
-#define R_IMF_EXR_CODEC_B44A 7
-#define R_IMF_EXR_CODEC_DWAA 8
-#define R_IMF_EXR_CODEC_DWAB 9
-#define R_IMF_EXR_CODEC_MAX 10
+#define R_IMF_EXR_CODEC_ZIP 2
+#define R_IMF_EXR_CODEC_PIZ 3
+#define R_IMF_EXR_CODEC_RLE 4
+#define R_IMF_EXR_CODEC_ZIPS 5
+#define R_IMF_EXR_CODEC_B44 6
+#define R_IMF_EXR_CODEC_B44A 7
+#define R_IMF_EXR_CODEC_DWAA 8
+#define R_IMF_EXR_CODEC_DWAB 9
+#define R_IMF_EXR_CODEC_MAX 10
/* ImageFormatData.jp2_flag */
-#define R_IMF_JP2_FLAG_YCC (1 << 0) /* when disabled use RGB */ /* was R_JPEG2K_YCC */
-#define R_IMF_JP2_FLAG_CINE_PRESET (1 << 1) /* was R_JPEG2K_CINE_PRESET */
-#define R_IMF_JP2_FLAG_CINE_48 (1 << 2) /* was R_JPEG2K_CINE_48FPS */
+#define R_IMF_JP2_FLAG_YCC (1 << 0) /* when disabled use RGB */ /* was R_JPEG2K_YCC */
+#define R_IMF_JP2_FLAG_CINE_PRESET (1 << 1) /* was R_JPEG2K_CINE_PRESET */
+#define R_IMF_JP2_FLAG_CINE_48 (1 << 2) /* was R_JPEG2K_CINE_48FPS */
/* ImageFormatData.jp2_codec */
-#define R_IMF_JP2_CODEC_JP2 0
-#define R_IMF_JP2_CODEC_J2K 1
+#define R_IMF_JP2_CODEC_JP2 0
+#define R_IMF_JP2_CODEC_J2K 1
/* ImageFormatData.cineon_flag */
-#define R_IMF_CINEON_FLAG_LOG (1 << 0) /* was R_CINEON_LOG */
+#define R_IMF_CINEON_FLAG_LOG (1 << 0) /* was R_CINEON_LOG */
/* ImageFormatData.tiff_codec */
enum {
- R_IMF_TIFF_CODEC_DEFLATE = 0,
- R_IMF_TIFF_CODEC_LZW = 1,
- R_IMF_TIFF_CODEC_PACKBITS = 2,
- R_IMF_TIFF_CODEC_NONE = 3,
+ R_IMF_TIFF_CODEC_DEFLATE = 0,
+ R_IMF_TIFF_CODEC_LZW = 1,
+ R_IMF_TIFF_CODEC_PACKBITS = 2,
+ R_IMF_TIFF_CODEC_NONE = 3,
};
typedef struct BakeData {
- struct ImageFormatData im_format;
+ struct ImageFormatData im_format;
- /** FILE_MAX. */
- char filepath[1024];
+ /** FILE_MAX. */
+ char filepath[1024];
- short width, height;
- short margin, flag;
+ short width, height;
+ short margin, flag;
- float cage_extrusion;
- int pass_filter;
+ float cage_extrusion;
+ int pass_filter;
- char normal_swizzle[3];
- char normal_space;
+ char normal_swizzle[3];
+ char normal_space;
- char save_mode;
- char _pad[3];
+ char save_mode;
+ char _pad[3];
- struct Object *cage_object;
+ struct Object *cage_object;
} BakeData;
/* BakeData.normal_swizzle (char) */
typedef enum eBakeNormalSwizzle {
- R_BAKE_POSX = 0,
- R_BAKE_POSY = 1,
- R_BAKE_POSZ = 2,
- R_BAKE_NEGX = 3,
- R_BAKE_NEGY = 4,
- R_BAKE_NEGZ = 5,
+ R_BAKE_POSX = 0,
+ R_BAKE_POSY = 1,
+ R_BAKE_POSZ = 2,
+ R_BAKE_NEGX = 3,
+ R_BAKE_NEGY = 4,
+ R_BAKE_NEGZ = 5,
} eBakeNormalSwizzle;
/* BakeData.save_mode (char) */
typedef enum eBakeSaveMode {
- R_BAKE_SAVE_INTERNAL = 0,
- R_BAKE_SAVE_EXTERNAL = 1,
+ R_BAKE_SAVE_INTERNAL = 0,
+ R_BAKE_SAVE_EXTERNAL = 1,
} eBakeSaveMode;
/* BakeData.pass_filter */
typedef enum eBakePassFilter {
- R_BAKE_PASS_FILTER_NONE = 0,
- R_BAKE_PASS_FILTER_AO = (1 << 0),
- R_BAKE_PASS_FILTER_EMIT = (1 << 1),
- R_BAKE_PASS_FILTER_DIFFUSE = (1 << 2),
- R_BAKE_PASS_FILTER_GLOSSY = (1 << 3),
- R_BAKE_PASS_FILTER_TRANSM = (1 << 4),
- R_BAKE_PASS_FILTER_SUBSURFACE = (1 << 5),
- R_BAKE_PASS_FILTER_DIRECT = (1 << 6),
- R_BAKE_PASS_FILTER_INDIRECT = (1 << 7),
- R_BAKE_PASS_FILTER_COLOR = (1 << 8),
+ R_BAKE_PASS_FILTER_NONE = 0,
+ R_BAKE_PASS_FILTER_AO = (1 << 0),
+ R_BAKE_PASS_FILTER_EMIT = (1 << 1),
+ R_BAKE_PASS_FILTER_DIFFUSE = (1 << 2),
+ R_BAKE_PASS_FILTER_GLOSSY = (1 << 3),
+ R_BAKE_PASS_FILTER_TRANSM = (1 << 4),
+ R_BAKE_PASS_FILTER_SUBSURFACE = (1 << 5),
+ R_BAKE_PASS_FILTER_DIRECT = (1 << 6),
+ R_BAKE_PASS_FILTER_INDIRECT = (1 << 7),
+ R_BAKE_PASS_FILTER_COLOR = (1 << 8),
} eBakePassFilter;
#define R_BAKE_PASS_FILTER_ALL (~0)
/* RenderEngineSettingsClay.options */
typedef enum ClayFlagSettings {
- CLAY_USE_AO = (1 << 0),
- CLAY_USE_HSV = (1 << 1),
+ CLAY_USE_AO = (1 << 0),
+ CLAY_USE_HSV = (1 << 1),
} ClayFlagSettings;
/* *************************************************************** */
/* Render Data */
typedef struct RenderData {
- struct ImageFormatData im_format;
-
- struct AviCodecData *avicodecdata;
- struct FFMpegCodecData ffcodecdata;
-
- /** Frames as in 'images'. */
- int cfra, sfra, efra;
- /** Subframe offset from cfra, in 0.0-1.0. */
- float subframe;
- /** Start+end frames of preview range. */
- int psfra, pefra;
-
- int images, framapto;
- short flag, threads;
-
- float framelen, blurfac;
-
- /** Frames to jump during render/playback. */
- int frame_step;
-
- /** Standalone player stereo settings */ // XXX deprecated since .2.5
- short stereomode DNA_DEPRECATED;
-
- /** For the dimensions presets menu. */
- short dimensionspreset;
-
- /** Size in %. */
- short size;
-
- char _pad6[2];
-
- /* from buttons: */
- /**
- * The desired number of pixels in the x direction
- */
- int xsch;
- /**
- * The desired number of pixels in the y direction
- */
- int ysch;
-
- /**
- * render tile dimensions
- */
- int tilex, tiley;
-
- short planes DNA_DEPRECATED;
- short imtype DNA_DEPRECATED;
- short subimtype DNA_DEPRECATED;
- short quality DNA_DEPRECATED;
-
- /**
- * Render to image editor, fullscreen or to new window.
- */
- short displaymode;
- char use_lock_interface;
- char _pad7;
-
- /**
- * Flags for render settings. Use bit-masking to access the settings.
- */
- int scemode;
-
- /**
- * Flags for render settings. Use bit-masking to access the settings.
- */
- int mode;
-
- /**
- * What to do with the sky/background.
- * Picks sky/premul blending for the background.
- */
- short alphamode;
-
- /**
- * The number of samples to use per pixel.
- */
- short osa;
-
- short frs_sec;
- char _pad[6];
-
-
- /* safety, border and display rect */
- rctf safety, border;
- rcti disprect;
-
- /* information on different layers to be rendered */
- /** Converted to Scene->view_layers. */
- ListBase layers DNA_DEPRECATED;
- /** Converted to Scene->active_layer. */
- short actlay DNA_DEPRECATED;
- char _pad1[2];
-
- /**
- * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
- */
- float xasp, yasp;
-
- float frs_sec_base;
-
- /**
- * Value used to define filter size for all filter options */
- float gauss;
-
-
- /* color management settings - color profiles, gamma correction, etc */
- int color_mgt_flag;
-
- /* Dither noise intensity */
- float dither_intensity;
-
- /* Bake Render options */
- short bake_mode, bake_flag;
- short bake_filter, bake_samples;
- float bake_biasdist, bake_user_scale;
-
- /* path to render output */
- /** 1024 = FILE_MAX. */
- char pic[1024];
-
- /* stamps flags. */
- int stamp;
- /** Select one of blenders bitmap fonts. */
- short stamp_font_id;
- char _pad3[2];
-
- /* stamp info user data. */
- char stamp_udata[768];
-
- /* foreground/background color. */
- float fg_stamp[4];
- float bg_stamp[4];
-
- /* sequencer options */
- char seq_prev_type;
- /** UNUSED!. */
- char seq_rend_type;
- /** Flag use for sequence render/draw. */
- char seq_flag;
- char _pad5[5];
-
- /* render simplify */
- short simplify_subsurf;
- short simplify_subsurf_render;
- short simplify_gpencil;
- short simplify_smoke_ignore_highres;
- float simplify_particles;
- float simplify_particles_render;
-
- /* Freestyle line thickness options */
- int line_thickness_mode;
- /** In pixels. */
- float unit_line_thickness;
-
- /* render engine */
- char engine[32];
- char _pad2[4];
-
- /* Cycles baking */
- struct BakeData bake;
-
- int preview_start_resolution;
- short preview_pixel_size;
-
- /* Type of the debug pass to use.
- * Only used when built with debug passes support.
- */
- short debug_pass_type;
-
- /* MultiView */
- /** SceneRenderView. */
- ListBase views;
- short actview;
- short views_format;
-
- /* Hair Display */
- short hair_type, hair_subdiv;
-
- /* Motion blur shutter */
- struct CurveMapping mblur_shutter_curve;
+ struct ImageFormatData im_format;
+
+ struct AviCodecData *avicodecdata;
+ struct FFMpegCodecData ffcodecdata;
+
+ /** Frames as in 'images'. */
+ int cfra, sfra, efra;
+ /** Subframe offset from cfra, in 0.0-1.0. */
+ float subframe;
+ /** Start+end frames of preview range. */
+ int psfra, pefra;
+
+ int images, framapto;
+ short flag, threads;
+
+ float framelen, blurfac;
+
+ /** Frames to jump during render/playback. */
+ int frame_step;
+
+ /** Standalone player stereo settings */ // XXX deprecated since .2.5
+ short stereomode DNA_DEPRECATED;
+
+ /** For the dimensions presets menu. */
+ short dimensionspreset;
+
+ /** Size in %. */
+ short size;
+
+ char _pad6[2];
+
+ /* from buttons: */
+ /**
+ * The desired number of pixels in the x direction
+ */
+ int xsch;
+ /**
+ * The desired number of pixels in the y direction
+ */
+ int ysch;
+
+ /**
+ * render tile dimensions
+ */
+ int tilex, tiley;
+
+ short planes DNA_DEPRECATED;
+ short imtype DNA_DEPRECATED;
+ short subimtype DNA_DEPRECATED;
+ short quality DNA_DEPRECATED;
+
+ /**
+ * Render to image editor, fullscreen or to new window.
+ */
+ short displaymode;
+ char use_lock_interface;
+ char _pad7;
+
+ /**
+ * Flags for render settings. Use bit-masking to access the settings.
+ */
+ int scemode;
+
+ /**
+ * Flags for render settings. Use bit-masking to access the settings.
+ */
+ int mode;
+
+ /**
+ * What to do with the sky/background.
+ * Picks sky/premul blending for the background.
+ */
+ short alphamode;
+
+ /**
+ * The number of samples to use per pixel.
+ */
+ short osa;
+
+ short frs_sec;
+ char _pad[6];
+
+ /* safety, border and display rect */
+ rctf safety, border;
+ rcti disprect;
+
+ /* information on different layers to be rendered */
+ /** Converted to Scene->view_layers. */
+ ListBase layers DNA_DEPRECATED;
+ /** Converted to Scene->active_layer. */
+ short actlay DNA_DEPRECATED;
+ char _pad1[2];
+
+ /**
+ * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
+ */
+ float xasp, yasp;
+
+ float frs_sec_base;
+
+ /**
+ * Value used to define filter size for all filter options */
+ float gauss;
+
+ /* color management settings - color profiles, gamma correction, etc */
+ int color_mgt_flag;
+
+ /* Dither noise intensity */
+ float dither_intensity;
+
+ /* Bake Render options */
+ short bake_mode, bake_flag;
+ short bake_filter, bake_samples;
+ float bake_biasdist, bake_user_scale;
+
+ /* path to render output */
+ /** 1024 = FILE_MAX. */
+ char pic[1024];
+
+ /* stamps flags. */
+ int stamp;
+ /** Select one of blenders bitmap fonts. */
+ short stamp_font_id;
+ char _pad3[2];
+
+ /* stamp info user data. */
+ char stamp_udata[768];
+
+ /* foreground/background color. */
+ float fg_stamp[4];
+ float bg_stamp[4];
+
+ /* sequencer options */
+ char seq_prev_type;
+ /** UNUSED!. */
+ char seq_rend_type;
+ /** Flag use for sequence render/draw. */
+ char seq_flag;
+ char _pad5[5];
+
+ /* render simplify */
+ short simplify_subsurf;
+ short simplify_subsurf_render;
+ short simplify_gpencil;
+ short simplify_smoke_ignore_highres;
+ float simplify_particles;
+ float simplify_particles_render;
+
+ /* Freestyle line thickness options */
+ int line_thickness_mode;
+ /** In pixels. */
+ float unit_line_thickness;
+
+ /* render engine */
+ char engine[32];
+ char _pad2[4];
+
+ /* Cycles baking */
+ struct BakeData bake;
+
+ int preview_start_resolution;
+ short preview_pixel_size;
+
+ /* Type of the debug pass to use.
+ * Only used when built with debug passes support.
+ */
+ short debug_pass_type;
+
+ /* MultiView */
+ /** SceneRenderView. */
+ ListBase views;
+ short actview;
+ short views_format;
+
+ /* Hair Display */
+ short hair_type, hair_subdiv;
+
+ /* Motion blur shutter */
+ struct CurveMapping mblur_shutter_curve;
} RenderData;
/* RenderData.hair_type */
typedef enum eHairType {
- SCE_HAIR_SHAPE_STRAND = 0,
- SCE_HAIR_SHAPE_STRIP = 1,
+ SCE_HAIR_SHAPE_STRAND = 0,
+ SCE_HAIR_SHAPE_STRIP = 1,
} eHairType;
-
/* *************************************************************** */
/* Render Conversion/Simplfication Settings */
/* control render convert and shading engine */
typedef struct RenderProfile {
- struct RenderProfile *next, *prev;
- char name[32];
+ struct RenderProfile *next, *prev;
+ char name[32];
- short particle_perc;
- short subsurf_max;
- short shadbufsample_max;
- char _pad1[2];
+ short particle_perc;
+ short subsurf_max;
+ short shadbufsample_max;
+ char _pad1[2];
- float ao_error;
- char _pad2[4];
+ float ao_error;
+ char _pad2[4];
} RenderProfile;
/* UV Paint */
/* ToolSettings.uv_sculpt_settings */
-#define UV_SCULPT_LOCK_BORDERS 1
-#define UV_SCULPT_ALL_ISLANDS 2
+#define UV_SCULPT_LOCK_BORDERS 1
+#define UV_SCULPT_ALL_ISLANDS 2
/* ToolSettings.uv_sculpt_tool */
-#define UV_SCULPT_TOOL_PINCH 1
-#define UV_SCULPT_TOOL_RELAX 2
-#define UV_SCULPT_TOOL_GRAB 3
+#define UV_SCULPT_TOOL_PINCH 1
+#define UV_SCULPT_TOOL_RELAX 2
+#define UV_SCULPT_TOOL_GRAB 3
/* ToolSettings.uv_relax_method */
-#define UV_SCULPT_TOOL_RELAX_LAPLACIAN 1
-#define UV_SCULPT_TOOL_RELAX_HC 2
+#define UV_SCULPT_TOOL_RELAX_LAPLACIAN 1
+#define UV_SCULPT_TOOL_RELAX_HC 2
/* Stereo Flags */
#define STEREO_RIGHT_NAME "right"
@@ -826,21 +820,21 @@ typedef struct RenderProfile {
/* View3D.stereo3d_camera / View3D.multiview_eye / ImageUser.multiview_eye */
typedef enum eStereoViews {
- STEREO_LEFT_ID = 0,
- STEREO_RIGHT_ID = 1,
- STEREO_3D_ID = 2,
- STEREO_MONO_ID = 3,
+ STEREO_LEFT_ID = 0,
+ STEREO_RIGHT_ID = 1,
+ STEREO_3D_ID = 2,
+ STEREO_MONO_ID = 3,
} eStereoViews;
/* *************************************************************** */
/* Markers */
typedef struct TimeMarker {
- struct TimeMarker *next, *prev;
- int frame;
- char name[64];
- unsigned int flag;
- struct Object *camera;
+ struct TimeMarker *next, *prev;
+ int frame;
+ char name[64];
+ unsigned int flag;
+ struct Object *camera;
} TimeMarker;
/* *************************************************************** */
@@ -849,49 +843,49 @@ typedef struct TimeMarker {
#define PAINT_MAX_INPUT_SAMPLES 64
typedef struct Paint_Runtime {
- /* Avoid having to compare with scene pointer everywhere. */
- unsigned int tool_offset;
- unsigned short ob_mode;
- char _pad[2];
+ /* Avoid having to compare with scene pointer everywhere. */
+ unsigned int tool_offset;
+ unsigned short ob_mode;
+ char _pad[2];
} Paint_Runtime;
/* We might want to store other things here. */
typedef struct PaintToolSlot {
- struct Brush *brush;
+ struct Brush *brush;
} PaintToolSlot;
/* Paint Tool Base */
typedef struct Paint {
- struct Brush *brush;
+ struct Brush *brush;
- /* Each tool has it's own active brush,
- * The currently active tool is defined by the current 'brush'. */
- struct PaintToolSlot *tool_slots;
- int tool_slots_len;
- char _pad1[4];
+ /* Each tool has it's own active brush,
+ * The currently active tool is defined by the current 'brush'. */
+ struct PaintToolSlot *tool_slots;
+ int tool_slots_len;
+ char _pad1[4];
- struct Palette *palette;
- /** Cavity curve. */
- struct CurveMapping *cavity_curve;
+ struct Palette *palette;
+ /** Cavity curve. */
+ struct CurveMapping *cavity_curve;
- /* WM Paint cursor */
- void *paint_cursor;
- unsigned char paint_cursor_col[4];
+ /* WM Paint cursor */
+ void *paint_cursor;
+ unsigned char paint_cursor_col[4];
- /* enum ePaintFlags */
- int flags;
+ /* enum ePaintFlags */
+ int flags;
- /* Paint stroke can use up to PAINT_MAX_INPUT_SAMPLES inputs to
- * smooth the stroke */
- int num_input_samples;
+ /* Paint stroke can use up to PAINT_MAX_INPUT_SAMPLES inputs to
+ * smooth the stroke */
+ int num_input_samples;
- /* flags used for symmetry */
- int symmetry_flags;
+ /* flags used for symmetry */
+ int symmetry_flags;
- float tile_offset[3];
- char _pad2[4];
+ float tile_offset[3];
+ char _pad2[4];
- struct Paint_Runtime runtime;
+ struct Paint_Runtime runtime;
} Paint;
/* ------------------------------------------- */
@@ -899,32 +893,32 @@ typedef struct Paint {
/* Texture/Image Editor */
typedef struct ImagePaintSettings {
- Paint paint;
-
- short flag, missing_data;
-
- /* for projection painting only */
- short seam_bleed, normal_angle;
- /** Capture size for re-projection. */
- short screen_grab_size[2];
-
- /** Mode used for texture painting. */
- int mode;
-
- /** Wm handle. */
- void *paintcursor;
- /** Workaround until we support true layer masks. */
- struct Image *stencil;
- /** Clone layer for image mode for projective texture painting. */
- struct Image *clone;
- /** Canvas when the explicit system is used for painting. */
- struct Image *canvas;
- float stencil_col[3];
- /** Dither amount used when painting on byte images. */
- float dither;
- /** Display texture interpolation method. */
- int interp;
- char _pad[4];
+ Paint paint;
+
+ short flag, missing_data;
+
+ /* for projection painting only */
+ short seam_bleed, normal_angle;
+ /** Capture size for re-projection. */
+ short screen_grab_size[2];
+
+ /** Mode used for texture painting. */
+ int mode;
+
+ /** Wm handle. */
+ void *paintcursor;
+ /** Workaround until we support true layer masks. */
+ struct Image *stencil;
+ /** Clone layer for image mode for projective texture painting. */
+ struct Image *clone;
+ /** Canvas when the explicit system is used for painting. */
+ struct Image *canvas;
+ float stencil_col[3];
+ /** Dither amount used when painting on byte images. */
+ float dither;
+ /** Display texture interpolation method. */
+ int interp;
+ char _pad[4];
} ImagePaintSettings;
/* ------------------------------------------- */
@@ -932,35 +926,35 @@ typedef struct ImagePaintSettings {
/* Settings for a Particle Editing Brush */
typedef struct ParticleBrushData {
- /** Common setting. */
- short size;
- /** For specific brushes only. */
- short step, invert, count;
- int flag;
- float strength;
+ /** Common setting. */
+ short size;
+ /** For specific brushes only. */
+ short step, invert, count;
+ int flag;
+ float strength;
} ParticleBrushData;
/* Particle Edit Mode Settings */
typedef struct ParticleEditSettings {
- short flag;
- short totrekey;
- short totaddkey;
- short brushtype;
+ short flag;
+ short totrekey;
+ short totaddkey;
+ short brushtype;
- ParticleBrushData brush[7];
- /** Runtime. */
- void *paintcursor;
+ ParticleBrushData brush[7];
+ /** Runtime. */
+ void *paintcursor;
- float emitterdist, rt;
+ float emitterdist, rt;
- int selectmode;
- int edittype;
+ int selectmode;
+ int edittype;
- int draw_step, fade_frames;
+ int draw_step, fade_frames;
- struct Scene *scene;
- struct Object *object;
- struct Object *shape_object;
+ struct Scene *scene;
+ struct Object *object;
+ struct Object *shape_object;
} ParticleEditSettings;
/* ------------------------------------------- */
@@ -968,41 +962,41 @@ typedef struct ParticleEditSettings {
/* Sculpt */
typedef struct Sculpt {
- Paint paint;
+ Paint paint;
- /* For rotating around a pivot point */
- //float pivot[3]; XXX not used?
- int flags;
+ /* For rotating around a pivot point */
+ //float pivot[3]; XXX not used?
+ int flags;
- /* Control tablet input */
- //char tablet_size, tablet_strength; XXX not used?
- int radial_symm[3];
+ /* Control tablet input */
+ //char tablet_size, tablet_strength; XXX not used?
+ int radial_symm[3];
- /* Maximum edge length for dynamic topology sculpting (in pixels) */
- float detail_size;
+ /* Maximum edge length for dynamic topology sculpting (in pixels) */
+ float detail_size;
- /* Direction used for SCULPT_OT_symmetrize operator */
- int symmetrize_direction;
+ /* Direction used for SCULPT_OT_symmetrize operator */
+ int symmetrize_direction;
- /* gravity factor for sculpting */
- float gravity_factor;
+ /* gravity factor for sculpting */
+ float gravity_factor;
- /* scale for constant detail size */
- /** Constant detail resolution (Blender unit / constant_detail). */
- float constant_detail;
- float detail_percent;
- char _pad[4];
+ /* scale for constant detail size */
+ /** Constant detail resolution (Blender unit / constant_detail). */
+ float constant_detail;
+ float detail_percent;
+ char _pad[4];
- struct Object *gravity_object;
+ struct Object *gravity_object;
} Sculpt;
typedef struct UvSculpt {
- Paint paint;
+ Paint paint;
} UvSculpt;
/* grease pencil drawing brushes */
typedef struct GpPaint {
- Paint paint;
+ Paint paint;
} GpPaint;
/* ------------------------------------------- */
@@ -1010,17 +1004,17 @@ typedef struct GpPaint {
/* Vertex Paint */
typedef struct VPaint {
- Paint paint;
- char flag;
- char _pad[3];
- /** For mirrored painting. */
- int radial_symm[3];
+ Paint paint;
+ char flag;
+ char _pad[3];
+ /** For mirrored painting. */
+ int radial_symm[3];
} VPaint;
/* VPaint.flag */
enum {
- /* weight paint only */
- VP_FLAG_VGROUP_RESTRICT = (1 << 7),
+ /* weight paint only */
+ VP_FLAG_VGROUP_RESTRICT = (1 << 7),
};
/* ------------------------------------------- */
@@ -1028,181 +1022,181 @@ enum {
/* GP_Sculpt_Settings.brushtype */
typedef enum eGP_Sculpt_Types {
- GP_SCULPT_TYPE_SMOOTH = 0,
- GP_SCULPT_TYPE_THICKNESS = 1,
- GP_SCULPT_TYPE_STRENGTH = 2,
- GP_SCULPT_TYPE_GRAB = 3,
- GP_SCULPT_TYPE_PUSH = 4,
- GP_SCULPT_TYPE_TWIST = 5,
- GP_SCULPT_TYPE_PINCH = 6,
- GP_SCULPT_TYPE_RANDOMIZE = 7,
- GP_SCULPT_TYPE_CLONE = 8,
- GP_SCULPT_TYPE_SUBDIVIDE = 9,
- GP_SCULPT_TYPE_SIMPLIFY = 10,
- /* add any sculpt brush above this value */
- GP_SCULPT_TYPE_WEIGHT = 11,
- /* add any weight paint brush below this value. Do no mix brushes */
-
- /* !!! Update GP_Sculpt_Data brush[###]; below !!! */
- GP_SCULPT_TYPE_MAX,
+ GP_SCULPT_TYPE_SMOOTH = 0,
+ GP_SCULPT_TYPE_THICKNESS = 1,
+ GP_SCULPT_TYPE_STRENGTH = 2,
+ GP_SCULPT_TYPE_GRAB = 3,
+ GP_SCULPT_TYPE_PUSH = 4,
+ GP_SCULPT_TYPE_TWIST = 5,
+ GP_SCULPT_TYPE_PINCH = 6,
+ GP_SCULPT_TYPE_RANDOMIZE = 7,
+ GP_SCULPT_TYPE_CLONE = 8,
+ GP_SCULPT_TYPE_SUBDIVIDE = 9,
+ GP_SCULPT_TYPE_SIMPLIFY = 10,
+ /* add any sculpt brush above this value */
+ GP_SCULPT_TYPE_WEIGHT = 11,
+ /* add any weight paint brush below this value. Do no mix brushes */
+
+ /* !!! Update GP_Sculpt_Data brush[###]; below !!! */
+ GP_SCULPT_TYPE_MAX,
} eGP_Sculpt_Types;
/* GP_Sculpt_Settings.lock_axis */
typedef enum eGP_Lockaxis_Types {
- GP_LOCKAXIS_VIEW = 0,
- GP_LOCKAXIS_X = 1,
- GP_LOCKAXIS_Y = 2,
- GP_LOCKAXIS_Z = 3,
- GP_LOCKAXIS_CURSOR = 4,
+ GP_LOCKAXIS_VIEW = 0,
+ GP_LOCKAXIS_X = 1,
+ GP_LOCKAXIS_Y = 2,
+ GP_LOCKAXIS_Z = 3,
+ GP_LOCKAXIS_CURSOR = 4,
} eGP_Lockaxis_Types;
/* Settings for a GPencil Stroke Sculpting Brush */
typedef struct GP_Sculpt_Data {
- /** Radius of brush. */
- short size;
- /** EGP_Sculpt_Flag. */
- short flag;
- /** Strength of effect. */
- float strength;
- /** Cursor color for add. */
- float curcolor_add[3];
- /** Cursor color for sub. */
- float curcolor_sub[3];
- /** Target weight. */
- float weight;
- char _pad[4];
+ /** Radius of brush. */
+ short size;
+ /** EGP_Sculpt_Flag. */
+ short flag;
+ /** Strength of effect. */
+ float strength;
+ /** Cursor color for add. */
+ float curcolor_add[3];
+ /** Cursor color for sub. */
+ float curcolor_sub[3];
+ /** Target weight. */
+ float weight;
+ char _pad[4];
} GP_Sculpt_Data;
/* Settings for a GPencil Speed Guide */
typedef struct GP_Sculpt_Guide {
- char use_guide;
- char use_snapping;
- char reference_point;
- char type;
- char _pad2[4];
- float angle;
- float angle_snap;
- float spacing;
- float location[3];
- struct Object *reference_object;
+ char use_guide;
+ char use_snapping;
+ char reference_point;
+ char type;
+ char _pad2[4];
+ float angle;
+ float angle_snap;
+ float spacing;
+ float location[3];
+ struct Object *reference_object;
} GP_Sculpt_Guide;
/* GP_Sculpt_Data.flag */
typedef enum eGP_Sculpt_Flag {
- /* invert the effect of the brush */
- GP_SCULPT_FLAG_INVERT = (1 << 0),
- /* adjust strength using pen pressure */
- GP_SCULPT_FLAG_USE_PRESSURE = (1 << 1),
-
- /* strength of brush falls off with distance from cursor */
- GP_SCULPT_FLAG_USE_FALLOFF = (1 << 2),
-
- /* smooth brush affects pressure values as well */
- GP_SCULPT_FLAG_SMOOTH_PRESSURE = (1 << 3),
- /* enable screen cursor */
- GP_SCULPT_FLAG_ENABLE_CURSOR = (1 << 4),
- /* temporary invert action */
- GP_SCULPT_FLAG_TMP_INVERT = (1 << 5),
- /* adjust radius using pen pressure */
- GP_SCULPT_FLAG_PRESSURE_RADIUS = (1 << 6),
+ /* invert the effect of the brush */
+ GP_SCULPT_FLAG_INVERT = (1 << 0),
+ /* adjust strength using pen pressure */
+ GP_SCULPT_FLAG_USE_PRESSURE = (1 << 1),
+
+ /* strength of brush falls off with distance from cursor */
+ GP_SCULPT_FLAG_USE_FALLOFF = (1 << 2),
+
+ /* smooth brush affects pressure values as well */
+ GP_SCULPT_FLAG_SMOOTH_PRESSURE = (1 << 3),
+ /* enable screen cursor */
+ GP_SCULPT_FLAG_ENABLE_CURSOR = (1 << 4),
+ /* temporary invert action */
+ GP_SCULPT_FLAG_TMP_INVERT = (1 << 5),
+ /* adjust radius using pen pressure */
+ GP_SCULPT_FLAG_PRESSURE_RADIUS = (1 << 6),
} eGP_Sculpt_Flag;
/* GPencil Stroke Sculpting Settings */
typedef struct GP_Sculpt_Settings {
- /** GP_SCULPT_TYPE_MAX. */
- GP_Sculpt_Data brush[12];
- /** Runtime. */
- void *paintcursor;
-
- /** #eGP_Sculpt_Types (sculpt). */
- int brushtype;
- /** #eGP_Sculpt_SettingsFlag. */
- int flag;
- /** #eGP_Lockaxis_Types lock drawing to one axis. */
- int lock_axis;
- /** Threshold for intersections */
- float isect_threshold;
-
- /* weight paint is a submode of sculpt but use its own index. All weight paint
- * brushes must be defined at the end of the brush array.
- */
- /** #eGP_Sculpt_Types (weight paint). */
- int weighttype;
- char _pad[4];
- /** Multiframe edit falloff effect by frame. */
- struct CurveMapping *cur_falloff;
- /** Curve used for primitve tools. */
- struct CurveMapping *cur_primitive;
- /** Guides used for paint tools */
- struct GP_Sculpt_Guide guide;
+ /** GP_SCULPT_TYPE_MAX. */
+ GP_Sculpt_Data brush[12];
+ /** Runtime. */
+ void *paintcursor;
+
+ /** #eGP_Sculpt_Types (sculpt). */
+ int brushtype;
+ /** #eGP_Sculpt_SettingsFlag. */
+ int flag;
+ /** #eGP_Lockaxis_Types lock drawing to one axis. */
+ int lock_axis;
+ /** Threshold for intersections */
+ float isect_threshold;
+
+ /* weight paint is a submode of sculpt but use its own index. All weight paint
+ * brushes must be defined at the end of the brush array.
+ */
+ /** #eGP_Sculpt_Types (weight paint). */
+ int weighttype;
+ char _pad[4];
+ /** Multiframe edit falloff effect by frame. */
+ struct CurveMapping *cur_falloff;
+ /** Curve used for primitve tools. */
+ struct CurveMapping *cur_primitive;
+ /** Guides used for paint tools */
+ struct GP_Sculpt_Guide guide;
} GP_Sculpt_Settings;
/* GP_Sculpt_Settings.flag */
typedef enum eGP_Sculpt_SettingsFlag {
- /* only affect selected points */
- GP_SCULPT_SETT_FLAG_SELECT_MASK = (1 << 0),
- /* apply brush to position */
- GP_SCULPT_SETT_FLAG_APPLY_POSITION = (1 << 1),
- /* apply brush to strength */
- GP_SCULPT_SETT_FLAG_APPLY_STRENGTH = (1 << 2),
- /* apply brush to thickness */
- GP_SCULPT_SETT_FLAG_APPLY_THICKNESS = (1 << 3),
- /* apply brush to thickness */
- GP_SCULPT_SETT_FLAG_WEIGHT_MODE = (1 << 4),
- /* enable falloff for multiframe editing */
- GP_SCULPT_SETT_FLAG_FRAME_FALLOFF = (1 << 5),
- /* apply brush to uv data */
- GP_SCULPT_SETT_FLAG_APPLY_UV = (1 << 6),
- /* apply primitve curve */
- GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 7),
+ /* only affect selected points */
+ GP_SCULPT_SETT_FLAG_SELECT_MASK = (1 << 0),
+ /* apply brush to position */
+ GP_SCULPT_SETT_FLAG_APPLY_POSITION = (1 << 1),
+ /* apply brush to strength */
+ GP_SCULPT_SETT_FLAG_APPLY_STRENGTH = (1 << 2),
+ /* apply brush to thickness */
+ GP_SCULPT_SETT_FLAG_APPLY_THICKNESS = (1 << 3),
+ /* apply brush to thickness */
+ GP_SCULPT_SETT_FLAG_WEIGHT_MODE = (1 << 4),
+ /* enable falloff for multiframe editing */
+ GP_SCULPT_SETT_FLAG_FRAME_FALLOFF = (1 << 5),
+ /* apply brush to uv data */
+ GP_SCULPT_SETT_FLAG_APPLY_UV = (1 << 6),
+ /* apply primitve curve */
+ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 7),
} eGP_Sculpt_SettingsFlag;
/* Settings for GP Interpolation Operators */
typedef struct GP_Interpolate_Settings {
- /** #eGP_Interpolate_SettingsFlag. */
- short flag;
+ /** #eGP_Interpolate_SettingsFlag. */
+ short flag;
- /** #eGP_Interpolate_Type - Interpolation Mode. */
- char type;
- /** #eBezTriple_Easing - Easing mode (if easing equation used). */
- char easing;
+ /** #eGP_Interpolate_Type - Interpolation Mode. */
+ char type;
+ /** #eBezTriple_Easing - Easing mode (if easing equation used). */
+ char easing;
- /** BEZT_IPO_BACK. */
- float back;
- /** BEZT_IPO_ELASTIC. */
- float amplitude, period;
+ /** BEZT_IPO_BACK. */
+ float back;
+ /** BEZT_IPO_ELASTIC. */
+ float amplitude, period;
- /** Custom interpolation curve (for use with GP_IPO_CURVEMAP). */
- struct CurveMapping *custom_ipo;
+ /** Custom interpolation curve (for use with GP_IPO_CURVEMAP). */
+ struct CurveMapping *custom_ipo;
} GP_Interpolate_Settings;
/* GP_Interpolate_Settings.flag */
typedef enum eGP_Interpolate_SettingsFlag {
- /* apply interpolation to all layers */
- GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS = (1 << 0),
- /* apply interpolation to only selected */
- GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED = (1 << 1),
+ /* apply interpolation to all layers */
+ GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS = (1 << 0),
+ /* apply interpolation to only selected */
+ GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED = (1 << 1),
} eGP_Interpolate_SettingsFlag;
/* GP_Interpolate_Settings.type */
typedef enum eGP_Interpolate_Type {
- /* Traditional Linear Interpolation */
- GP_IPO_LINEAR = 0,
-
- /* CurveMap Defined Interpolation */
- GP_IPO_CURVEMAP = 1,
-
- /* Easing Equations */
- GP_IPO_BACK = 3,
- GP_IPO_BOUNCE = 4,
- GP_IPO_CIRC = 5,
- GP_IPO_CUBIC = 6,
- GP_IPO_ELASTIC = 7,
- GP_IPO_EXPO = 8,
- GP_IPO_QUAD = 9,
- GP_IPO_QUART = 10,
- GP_IPO_QUINT = 11,
- GP_IPO_SINE = 12,
+ /* Traditional Linear Interpolation */
+ GP_IPO_LINEAR = 0,
+
+ /* CurveMap Defined Interpolation */
+ GP_IPO_CURVEMAP = 1,
+
+ /* Easing Equations */
+ GP_IPO_BACK = 3,
+ GP_IPO_BOUNCE = 4,
+ GP_IPO_CIRC = 5,
+ GP_IPO_CUBIC = 6,
+ GP_IPO_ELASTIC = 7,
+ GP_IPO_EXPO = 8,
+ GP_IPO_QUAD = 9,
+ GP_IPO_QUART = 10,
+ GP_IPO_QUINT = 11,
+ GP_IPO_SINE = 12,
} eGP_Interpolate_Type;
/* *************************************************************** */
@@ -1213,315 +1207,310 @@ typedef enum eGP_Interpolate_Type {
* Brush for any paint mode; the flag field controls whether these
* values are used */
typedef struct UnifiedPaintSettings {
- /* unified radius of brush in pixels */
- int size;
-
- /* unified radius of brush in Blender units */
- float unprojected_radius;
+ /* unified radius of brush in pixels */
+ int size;
- /* unified strength of brush */
- float alpha;
+ /* unified radius of brush in Blender units */
+ float unprojected_radius;
- /* unified brush weight, [0, 1] */
- float weight;
+ /* unified strength of brush */
+ float alpha;
- /* unified brush color */
- float rgb[3];
- /* unified brush secondary color */
- float secondary_rgb[3];
+ /* unified brush weight, [0, 1] */
+ float weight;
- /* user preferences for sculpt and paint */
- int flag;
+ /* unified brush color */
+ float rgb[3];
+ /* unified brush secondary color */
+ float secondary_rgb[3];
- /* rake rotation */
+ /* user preferences for sculpt and paint */
+ int flag;
- /* record movement of mouse so that rake can start at an intuitive angle */
- float last_rake[2];
- float last_rake_angle;
+ /* rake rotation */
- int last_stroke_valid;
- float average_stroke_accum[3];
- int average_stroke_counter;
+ /* record movement of mouse so that rake can start at an intuitive angle */
+ float last_rake[2];
+ float last_rake_angle;
+ int last_stroke_valid;
+ float average_stroke_accum[3];
+ int average_stroke_counter;
- float brush_rotation;
- float brush_rotation_sec;
+ float brush_rotation;
+ float brush_rotation_sec;
- /*******************************************************************************
- * all data below are used to communicate with cursor drawing and tex sampling *
- *******************************************************************************/
- int anchored_size;
+ /*******************************************************************************
+ * all data below are used to communicate with cursor drawing and tex sampling *
+ *******************************************************************************/
+ int anchored_size;
- /**
- * Normalization factor due to accumulated value of curve along spacing.
- * Calculated when brush spacing changes to dampen strength of stroke
- * if space attenuation is used.
- */
- float overlap_factor;
- char draw_inverted;
- /* check is there an ongoing stroke right now */
- char stroke_active;
+ /**
+ * Normalization factor due to accumulated value of curve along spacing.
+ * Calculated when brush spacing changes to dampen strength of stroke
+ * if space attenuation is used.
+ */
+ float overlap_factor;
+ char draw_inverted;
+ /* check is there an ongoing stroke right now */
+ char stroke_active;
- char draw_anchored;
- char do_linear_conversion;
+ char draw_anchored;
+ char do_linear_conversion;
- /* store last location of stroke or whether the mesh was hit.
- * Valid only while stroke is active */
- float last_location[3];
- int last_hit;
+ /* store last location of stroke or whether the mesh was hit.
+ * Valid only while stroke is active */
+ float last_location[3];
+ int last_hit;
- float anchored_initial_mouse[2];
+ float anchored_initial_mouse[2];
- /* radius of brush, premultiplied with pressure.
- * In case of anchored brushes contains the anchored radius */
- float pixel_radius;
+ /* radius of brush, premultiplied with pressure.
+ * In case of anchored brushes contains the anchored radius */
+ float pixel_radius;
- /* drawing pressure */
- float size_pressure_value;
+ /* drawing pressure */
+ float size_pressure_value;
- /* position of mouse, used to sample the texture */
- float tex_mouse[2];
+ /* position of mouse, used to sample the texture */
+ float tex_mouse[2];
- /* position of mouse, used to sample the mask texture */
- float mask_tex_mouse[2];
+ /* position of mouse, used to sample the mask texture */
+ float mask_tex_mouse[2];
- /* ColorSpace cache to avoid locking up during sampling */
- struct ColorSpace *colorspace;
+ /* ColorSpace cache to avoid locking up during sampling */
+ struct ColorSpace *colorspace;
} UnifiedPaintSettings;
/* UnifiedPaintSettings.flag */
typedef enum {
- UNIFIED_PAINT_SIZE = (1 << 0),
- UNIFIED_PAINT_ALPHA = (1 << 1),
- UNIFIED_PAINT_WEIGHT = (1 << 5),
- UNIFIED_PAINT_COLOR = (1 << 6),
-
- /* only used if unified size is enabled, mirrors the brush flags
- * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
- UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
- UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1 << 3),
-
- /* only used if unified alpha is enabled, mirrors the brush flag
- * BRUSH_ALPHA_PRESSURE */
- UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1 << 4),
+ UNIFIED_PAINT_SIZE = (1 << 0),
+ UNIFIED_PAINT_ALPHA = (1 << 1),
+ UNIFIED_PAINT_WEIGHT = (1 << 5),
+ UNIFIED_PAINT_COLOR = (1 << 6),
+
+ /* only used if unified size is enabled, mirrors the brush flags
+ * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
+ UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
+ UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1 << 3),
+
+ /* only used if unified alpha is enabled, mirrors the brush flag
+ * BRUSH_ALPHA_PRESSURE */
+ UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1 << 4),
} eUnifiedPaintSettingsFlags;
-
typedef struct CurvePaintSettings {
- char curve_type;
- char flag;
- char depth_mode;
- char surface_plane;
- char fit_method;
- char _pad;
- short error_threshold;
- float radius_min, radius_max;
- float radius_taper_start, radius_taper_end;
- float surface_offset;
- float corner_angle;
+ char curve_type;
+ char flag;
+ char depth_mode;
+ char surface_plane;
+ char fit_method;
+ char _pad;
+ short error_threshold;
+ float radius_min, radius_max;
+ float radius_taper_start, radius_taper_end;
+ float surface_offset;
+ float corner_angle;
} CurvePaintSettings;
/* CurvePaintSettings.flag */
enum {
- CURVE_PAINT_FLAG_CORNERS_DETECT = (1 << 0),
- CURVE_PAINT_FLAG_PRESSURE_RADIUS = (1 << 1),
- CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS = (1 << 2),
- CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS = (1 << 3),
+ CURVE_PAINT_FLAG_CORNERS_DETECT = (1 << 0),
+ CURVE_PAINT_FLAG_PRESSURE_RADIUS = (1 << 1),
+ CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS = (1 << 2),
+ CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS = (1 << 3),
};
/* CurvePaintSettings.fit_method */
enum {
- CURVE_PAINT_FIT_METHOD_REFIT = 0,
- CURVE_PAINT_FIT_METHOD_SPLIT = 1,
+ CURVE_PAINT_FIT_METHOD_REFIT = 0,
+ CURVE_PAINT_FIT_METHOD_SPLIT = 1,
};
/* CurvePaintSettings.depth_mode */
enum {
- CURVE_PAINT_PROJECT_CURSOR = 0,
- CURVE_PAINT_PROJECT_SURFACE = 1,
+ CURVE_PAINT_PROJECT_CURSOR = 0,
+ CURVE_PAINT_PROJECT_SURFACE = 1,
};
/* CurvePaintSettings.surface_plane */
enum {
- CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW = 0,
- CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE = 1,
- CURVE_PAINT_SURFACE_PLANE_VIEW = 2,
+ CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW = 0,
+ CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE = 1,
+ CURVE_PAINT_SURFACE_PLANE_VIEW = 2,
};
-
/* *************************************************************** */
/* Stats */
/* Stats for Meshes */
typedef struct MeshStatVis {
- char type;
- char _pad1[2];
+ char type;
+ char _pad1[2];
- /* overhang */
- char overhang_axis;
- float overhang_min, overhang_max;
+ /* overhang */
+ char overhang_axis;
+ float overhang_min, overhang_max;
- /* thickness */
- float thickness_min, thickness_max;
- char thickness_samples;
- char _pad2[3];
+ /* thickness */
+ float thickness_min, thickness_max;
+ char thickness_samples;
+ char _pad2[3];
- /* distort */
- float distort_min, distort_max;
+ /* distort */
+ float distort_min, distort_max;
- /* sharp */
- float sharp_min, sharp_max;
+ /* sharp */
+ float sharp_min, sharp_max;
} MeshStatVis;
-
/* *************************************************************** */
/* Tool Settings */
typedef struct ToolSettings {
- /** Vertex paint. */
- VPaint *vpaint;
- /** Weight paint. */
- VPaint *wpaint;
- Sculpt *sculpt;
- /** Uv smooth. */
- UvSculpt *uvsculpt;
- /** Gpencil paint. */
- GpPaint *gp_paint;
-
- /* Vertex group weight - used only for editmode, not weight
- * paint */
- float vgroup_weight;
-
- /** Remove doubles limit. */
- float doublimit;
- char automerge;
- char object_flag;
-
- /* Selection Mode for Mesh */
- short selectmode;
-
- /* UV Calculation */
- char unwrapper;
- char uvcalc_flag;
- char uv_flag;
- char uv_selectmode;
-
- float uvcalc_margin;
-
- /* Auto-IK */
- /** Runtime only. */
- short autoik_chainlen;
-
- /* Grease Pencil */
- /** Flags/options for how the tool works. */
- char gpencil_flags;
-
- /** Stroke placement settings: 3D View. */
- char gpencil_v3d_align;
- /** General 2D Editor. */
- char gpencil_v2d_align;
- /** Sequencer Preview. */
- char gpencil_seq_align;
- /** Image Editor. */
- char gpencil_ima_align;
-
- /* Annotations */
- /** Stroke placement settings - 3D View. */
- char annotate_v3d_align;
-
- /** Default stroke thickness for annotation strokes. */
- short annotate_thickness;
- /** Stroke selection mode. */
- short gpencil_selectmode;
-
- /* Grease Pencil Sculpt */
- struct GP_Sculpt_Settings gp_sculpt;
-
- /* Grease Pencil Interpolation Tool(s) */
- struct GP_Interpolate_Settings gp_interpolate;
-
- /* Image Paint (8 bytes aligned please!) */
- struct ImagePaintSettings imapaint;
-
- /* Particle Editing */
- struct ParticleEditSettings particle;
-
- /* Transform Proportional Area of Effect */
- float proportional_size;
-
- /* Select Group Threshold */
- float select_thresh;
-
- /* Auto-Keying Mode */
- /** Defines in DNA_userdef_types.h. */
- short autokey_flag;
- char autokey_mode;
- /** Keyframe type (see DNA_curve_types.h). */
- char keyframe_type;
-
- /* Multires */
- char multires_subdiv_type;
-
- /* Alt+RMB option */
- char edge_mode;
- char edge_mode_live_unwrap;
-
- char _pad1[1];
-
- /* Transform */
- char transform_pivot_point;
- char transform_flag;
- char snap_mode, snap_node_mode;
- char snap_uv_mode;
- char snap_flag;
- char snap_target;
- char snap_transform_mode_flag;
-
-
- char proportional, prop_mode;
- /** Proportional edit, object mode. */
- char proportional_objects;
- /** Proportional edit, mask editing. */
- char proportional_mask;
- /** Proportional edit, action editor. */
- char proportional_action;
- /** Proportional edit, graph editor. */
- char proportional_fcurve;
- /** Lock marker editing. */
- char lock_markers;
-
- /**aUto normalizing mode in wpain.t*/
- char auto_normalize;
- /** Paint multiple bones in wpaint. */
- char multipaint;
- char weightuser;
- /** Subset selection filter in wpaint. */
- char vgroupsubset;
-
- /* UV painting */
- char _pad2[1];
- char use_uv_sculpt;
- char uv_sculpt_settings;
- char uv_sculpt_tool;
- char uv_relax_method;
- /* XXX: these sculpt_paint_* fields are deprecated, use the
- * unified_paint_settings field instead! */
- short sculpt_paint_settings DNA_DEPRECATED;
- char _pad5[2];
- int sculpt_paint_unified_size DNA_DEPRECATED;
- float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
- float sculpt_paint_unified_alpha DNA_DEPRECATED;
-
- /* Unified Paint Settings */
- struct UnifiedPaintSettings unified_paint_settings;
-
- struct CurvePaintSettings curve_paint_settings;
-
- struct MeshStatVis statvis;
-
- /* Normal Editing */
- float normal_vector[3];
- int face_strength;
+ /** Vertex paint. */
+ VPaint *vpaint;
+ /** Weight paint. */
+ VPaint *wpaint;
+ Sculpt *sculpt;
+ /** Uv smooth. */
+ UvSculpt *uvsculpt;
+ /** Gpencil paint. */
+ GpPaint *gp_paint;
+
+ /* Vertex group weight - used only for editmode, not weight
+ * paint */
+ float vgroup_weight;
+
+ /** Remove doubles limit. */
+ float doublimit;
+ char automerge;
+ char object_flag;
+
+ /* Selection Mode for Mesh */
+ short selectmode;
+
+ /* UV Calculation */
+ char unwrapper;
+ char uvcalc_flag;
+ char uv_flag;
+ char uv_selectmode;
+
+ float uvcalc_margin;
+
+ /* Auto-IK */
+ /** Runtime only. */
+ short autoik_chainlen;
+
+ /* Grease Pencil */
+ /** Flags/options for how the tool works. */
+ char gpencil_flags;
+
+ /** Stroke placement settings: 3D View. */
+ char gpencil_v3d_align;
+ /** General 2D Editor. */
+ char gpencil_v2d_align;
+ /** Sequencer Preview. */
+ char gpencil_seq_align;
+ /** Image Editor. */
+ char gpencil_ima_align;
+
+ /* Annotations */
+ /** Stroke placement settings - 3D View. */
+ char annotate_v3d_align;
+
+ /** Default stroke thickness for annotation strokes. */
+ short annotate_thickness;
+ /** Stroke selection mode. */
+ short gpencil_selectmode;
+
+ /* Grease Pencil Sculpt */
+ struct GP_Sculpt_Settings gp_sculpt;
+
+ /* Grease Pencil Interpolation Tool(s) */
+ struct GP_Interpolate_Settings gp_interpolate;
+
+ /* Image Paint (8 bytes aligned please!) */
+ struct ImagePaintSettings imapaint;
+
+ /* Particle Editing */
+ struct ParticleEditSettings particle;
+
+ /* Transform Proportional Area of Effect */
+ float proportional_size;
+
+ /* Select Group Threshold */
+ float select_thresh;
+
+ /* Auto-Keying Mode */
+ /** Defines in DNA_userdef_types.h. */
+ short autokey_flag;
+ char autokey_mode;
+ /** Keyframe type (see DNA_curve_types.h). */
+ char keyframe_type;
+
+ /* Multires */
+ char multires_subdiv_type;
+
+ /* Alt+RMB option */
+ char edge_mode;
+ char edge_mode_live_unwrap;
+
+ char _pad1[1];
+
+ /* Transform */
+ char transform_pivot_point;
+ char transform_flag;
+ char snap_mode, snap_node_mode;
+ char snap_uv_mode;
+ char snap_flag;
+ char snap_target;
+ char snap_transform_mode_flag;
+
+ char proportional, prop_mode;
+ /** Proportional edit, object mode. */
+ char proportional_objects;
+ /** Proportional edit, mask editing. */
+ char proportional_mask;
+ /** Proportional edit, action editor. */
+ char proportional_action;
+ /** Proportional edit, graph editor. */
+ char proportional_fcurve;
+ /** Lock marker editing. */
+ char lock_markers;
+
+ /**aUto normalizing mode in wpain.t*/
+ char auto_normalize;
+ /** Paint multiple bones in wpaint. */
+ char multipaint;
+ char weightuser;
+ /** Subset selection filter in wpaint. */
+ char vgroupsubset;
+
+ /* UV painting */
+ char _pad2[1];
+ char use_uv_sculpt;
+ char uv_sculpt_settings;
+ char uv_sculpt_tool;
+ char uv_relax_method;
+ /* XXX: these sculpt_paint_* fields are deprecated, use the
+ * unified_paint_settings field instead! */
+ short sculpt_paint_settings DNA_DEPRECATED;
+ char _pad5[2];
+ int sculpt_paint_unified_size DNA_DEPRECATED;
+ float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
+ float sculpt_paint_unified_alpha DNA_DEPRECATED;
+
+ /* Unified Paint Settings */
+ struct UnifiedPaintSettings unified_paint_settings;
+
+ struct CurvePaintSettings curve_paint_settings;
+
+ struct MeshStatVis statvis;
+
+ /* Normal Editing */
+ float normal_vector[3];
+ int face_strength;
} ToolSettings;
/* *************************************************************** */
@@ -1531,417 +1520,420 @@ typedef struct ToolSettings {
/* Unit Settings */
typedef struct UnitSettings {
- /* Display/Editing unit options for each scene */
- /** Maybe have other unit conversions?. */
- float scale_length;
- /** Imperial, metric etc. */
- char system;
- /** Not implemented as a proper unit system yet. */
- char system_rotation;
- short flag;
-
- char length_unit;
- char mass_unit;
- char time_unit;
-
- char _pad[5];
+ /* Display/Editing unit options for each scene */
+ /** Maybe have other unit conversions?. */
+ float scale_length;
+ /** Imperial, metric etc. */
+ char system;
+ /** Not implemented as a proper unit system yet. */
+ char system_rotation;
+ short flag;
+
+ char length_unit;
+ char mass_unit;
+ char time_unit;
+
+ char _pad[5];
} UnitSettings;
/* ------------------------------------------- */
/* Global/Common Physics Settings */
typedef struct PhysicsSettings {
- float gravity[3];
- int flag, quick_cache_step, rt;
+ float gravity[3];
+ int flag, quick_cache_step, rt;
} PhysicsSettings;
/* ------------------------------------------- */
/* Safe Area options used in Camera View & Sequencer
*/
typedef struct DisplaySafeAreas {
- /* each value represents the (x,y) margins as a multiplier.
- * 'center' in this context is just the name for a different kind of safe-area */
+ /* each value represents the (x,y) margins as a multiplier.
+ * 'center' in this context is just the name for a different kind of safe-area */
- /** Title Safe. */
- float title[2];
- /** Image/Graphics Safe. */
- float action[2];
+ /** Title Safe. */
+ float title[2];
+ /** Image/Graphics Safe. */
+ float action[2];
- /* use for alternate aspect ratio */
- float title_center[2];
- float action_center[2];
+ /* use for alternate aspect ratio */
+ float title_center[2];
+ float action_center[2];
} DisplaySafeAreas;
/* ------------------------------------------- */
/* Scene Display - used for store scene specific display settings for the 3d view */
typedef struct SceneDisplay {
- /** Light direction for shadows/highlight. */
- float light_direction[3];
- float shadow_shift, shadow_focus;
+ /** Light direction for shadows/highlight. */
+ float light_direction[3];
+ float shadow_shift, shadow_focus;
- /** Settings for Cavity Shader. */
- float matcap_ssao_distance;
- float matcap_ssao_attenuation;
- int matcap_ssao_samples;
+ /** Settings for Cavity Shader. */
+ float matcap_ssao_distance;
+ float matcap_ssao_attenuation;
+ int matcap_ssao_samples;
- /** OpenGL render engine settings. */
- View3DShading shading;
+ /** OpenGL render engine settings. */
+ View3DShading shading;
} SceneDisplay;
typedef struct SceneEEVEE {
- int flag;
- int gi_diffuse_bounces;
- int gi_cubemap_resolution;
- int gi_visibility_resolution;
- float gi_irradiance_smoothing;
- float gi_glossy_clamp;
- float gi_filter_quality;
- char _pad[4];
-
- float gi_cubemap_draw_size;
- float gi_irradiance_draw_size;
-
- int taa_samples;
- int taa_render_samples;
- int sss_samples;
- float sss_jitter_threshold;
-
- float ssr_quality;
- float ssr_max_roughness;
- float ssr_thickness;
- float ssr_border_fade;
- float ssr_firefly_fac;
-
- float volumetric_start;
- float volumetric_end;
- int volumetric_tile_size;
- int volumetric_samples;
- float volumetric_sample_distribution;
- float volumetric_light_clamp;
- int volumetric_shadow_samples;
-
- float gtao_distance;
- float gtao_factor;
- float gtao_quality;
-
- float bokeh_max_size;
- float bokeh_threshold;
-
- float bloom_color[3];
- float bloom_threshold;
- float bloom_knee;
- float bloom_intensity;
- float bloom_radius;
- float bloom_clamp;
-
- int motion_blur_samples;
- float motion_blur_shutter;
-
- int shadow_method;
- int shadow_cube_size;
- int shadow_cascade_size;
-
- struct LightCache *light_cache;
- char light_cache_info[64];
-
- float overscan;
- float light_threshold;
+ int flag;
+ int gi_diffuse_bounces;
+ int gi_cubemap_resolution;
+ int gi_visibility_resolution;
+ float gi_irradiance_smoothing;
+ float gi_glossy_clamp;
+ float gi_filter_quality;
+ char _pad[4];
+
+ float gi_cubemap_draw_size;
+ float gi_irradiance_draw_size;
+
+ int taa_samples;
+ int taa_render_samples;
+ int sss_samples;
+ float sss_jitter_threshold;
+
+ float ssr_quality;
+ float ssr_max_roughness;
+ float ssr_thickness;
+ float ssr_border_fade;
+ float ssr_firefly_fac;
+
+ float volumetric_start;
+ float volumetric_end;
+ int volumetric_tile_size;
+ int volumetric_samples;
+ float volumetric_sample_distribution;
+ float volumetric_light_clamp;
+ int volumetric_shadow_samples;
+
+ float gtao_distance;
+ float gtao_factor;
+ float gtao_quality;
+
+ float bokeh_max_size;
+ float bokeh_threshold;
+
+ float bloom_color[3];
+ float bloom_threshold;
+ float bloom_knee;
+ float bloom_intensity;
+ float bloom_radius;
+ float bloom_clamp;
+
+ int motion_blur_samples;
+ float motion_blur_shutter;
+
+ int shadow_method;
+ int shadow_cube_size;
+ int shadow_cascade_size;
+
+ struct LightCache *light_cache;
+ char light_cache_info[64];
+
+ float overscan;
+ float light_threshold;
} SceneEEVEE;
/* *************************************************************** */
/* Scene ID-Block */
typedef struct TransformOrientationSlot {
- int type;
- int index_custom;
- char flag;
- char _pad0[7];
+ int type;
+ int index_custom;
+ char flag;
+ char _pad0[7];
} TransformOrientationSlot;
/* Indices when used in Scene.orientation. */
enum {
- SCE_ORIENT_DEFAULT = 0,
- SCE_ORIENT_TRANSLATE = 1,
- SCE_ORIENT_ROTATE = 2,
- SCE_ORIENT_SCALE = 3,
+ SCE_ORIENT_DEFAULT = 0,
+ SCE_ORIENT_TRANSLATE = 1,
+ SCE_ORIENT_ROTATE = 2,
+ SCE_ORIENT_SCALE = 3,
};
typedef struct Scene {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
- struct Object *camera;
- struct World *world;
+ struct Object *camera;
+ struct World *world;
- struct Scene *set;
+ struct Scene *set;
- ListBase base DNA_DEPRECATED;
- /** Active base. */
- struct Base *basact DNA_DEPRECATED;
- void *_pad1;
+ ListBase base DNA_DEPRECATED;
+ /** Active base. */
+ struct Base *basact DNA_DEPRECATED;
+ void *_pad1;
- /** 3d cursor location. */
- View3DCursor cursor;
+ /** 3d cursor location. */
+ View3DCursor cursor;
- /** Bitflags for layer visibility (deprecated). */
- unsigned int lay DNA_DEPRECATED;
- /** Active layer (deprecated) */
- int layact DNA_DEPRECATED;
- char _pad2[4];
+ /** Bitflags for layer visibility (deprecated). */
+ unsigned int lay DNA_DEPRECATED;
+ /** Active layer (deprecated) */
+ int layact DNA_DEPRECATED;
+ char _pad2[4];
- /** Various settings. */
- short flag;
+ /** Various settings. */
+ short flag;
- char use_nodes;
- char _pad3[1];
+ char use_nodes;
+ char _pad3[1];
- struct bNodeTree *nodetree;
+ struct bNodeTree *nodetree;
- /** Sequence editor data is allocated here. */
- struct Editing *ed;
+ /** Sequence editor data is allocated here. */
+ struct Editing *ed;
- /** Default allocated now. */
- struct ToolSettings *toolsettings;
- void *_pad4;
- struct DisplaySafeAreas safe_areas;
+ /** Default allocated now. */
+ struct ToolSettings *toolsettings;
+ void *_pad4;
+ struct DisplaySafeAreas safe_areas;
- /* migrate or replace? depends on some internal things... */
- /* no, is on the right place (ton) */
- struct RenderData r;
- struct AudioData audio;
+ /* migrate or replace? depends on some internal things... */
+ /* no, is on the right place (ton) */
+ struct RenderData r;
+ struct AudioData audio;
- ListBase markers;
- ListBase transform_spaces;
+ ListBase markers;
+ ListBase transform_spaces;
- /** First is the [scene, translate, rotate, scale]. */
- TransformOrientationSlot orientation_slots[4];
+ /** First is the [scene, translate, rotate, scale]. */
+ TransformOrientationSlot orientation_slots[4];
- void *sound_scene;
- void *playback_handle;
- void *sound_scrub_handle;
- void *speaker_handles;
+ void *sound_scene;
+ void *playback_handle;
+ void *sound_scrub_handle;
+ void *speaker_handles;
- /** (runtime) info/cache used for presenting playback framerate info to the user. */
- void *fps_info;
+ /** (runtime) info/cache used for presenting playback framerate info to the user. */
+ void *fps_info;
- /* none of the dependency graph vars is mean to be saved */
- struct GHash *depsgraph_hash;
- char _pad7[4];
+ /* none of the dependency graph vars is mean to be saved */
+ struct GHash *depsgraph_hash;
+ char _pad7[4];
- /* User-Defined KeyingSets */
- /**
- * Index of the active KeyingSet.
- * first KeyingSet has index 1, 'none' active is 0, 'add new' is -1
- */
- int active_keyingset;
- /** KeyingSets for this scene */
- ListBase keyingsets;
+ /* User-Defined KeyingSets */
+ /**
+ * Index of the active KeyingSet.
+ * first KeyingSet has index 1, 'none' active is 0, 'add new' is -1
+ */
+ int active_keyingset;
+ /** KeyingSets for this scene */
+ ListBase keyingsets;
- /* Units */
- struct UnitSettings unit;
+ /* Units */
+ struct UnitSettings unit;
- /* Grease Pencil - Annotations */
- struct bGPdata *gpd;
+ /* Grease Pencil - Annotations */
+ struct bGPdata *gpd;
- /* Movie Tracking */
- /** Active movie clip. */
- struct MovieClip *clip;
+ /* Movie Tracking */
+ /** Active movie clip. */
+ struct MovieClip *clip;
- /* Physics simulation settings */
- struct PhysicsSettings physics_settings;
+ /* Physics simulation settings */
+ struct PhysicsSettings physics_settings;
- void *_pad8;
- /* XXX. runtime flag for drawing, actually belongs in the window,
- * only used by BKE_object_handle_update() */
- struct CustomData_MeshMasks customdata_mask;
- /* XXX. same as above but for temp operator use (gl renders) */
- struct CustomData_MeshMasks customdata_mask_modal;
+ void *_pad8;
+ /* XXX. runtime flag for drawing, actually belongs in the window,
+ * only used by BKE_object_handle_update() */
+ struct CustomData_MeshMasks customdata_mask;
+ /* XXX. same as above but for temp operator use (gl renders) */
+ struct CustomData_MeshMasks customdata_mask_modal;
- /* Color Management */
- ColorManagedViewSettings view_settings;
- ColorManagedDisplaySettings display_settings;
- ColorManagedColorspaceSettings sequencer_colorspace_settings;
+ /* Color Management */
+ ColorManagedViewSettings view_settings;
+ ColorManagedDisplaySettings display_settings;
+ ColorManagedColorspaceSettings sequencer_colorspace_settings;
- /* RigidBody simulation world+settings */
- struct RigidBodyWorld *rigidbody_world;
+ /* RigidBody simulation world+settings */
+ struct RigidBodyWorld *rigidbody_world;
- struct PreviewImage *preview;
+ struct PreviewImage *preview;
- ListBase view_layers;
- /* Not an actual datablock, but memory owned by scene. */
- Collection *master_collection;
- struct SceneCollection *collection DNA_DEPRECATED;
+ ListBase view_layers;
+ /* Not an actual datablock, but memory owned by scene. */
+ Collection *master_collection;
+ struct SceneCollection *collection DNA_DEPRECATED;
- /** Settings to be override by workspaces. */
- IDProperty *layer_properties;
+ /** Settings to be override by workspaces. */
+ IDProperty *layer_properties;
- struct SceneDisplay display;
- struct SceneEEVEE eevee;
+ struct SceneDisplay display;
+ struct SceneEEVEE eevee;
} Scene;
/* **************** RENDERDATA ********************* */
/* RenderData.flag */
- /* use preview range */
-#define SCER_PRV_RANGE (1 << 0)
-#define SCER_LOCK_FRAME_SELECTION (1 << 1)
- /* show/use subframes (for checking motion blur) */
-#define SCER_SHOW_SUBFRAME (1 << 3)
+/* use preview range */
+#define SCER_PRV_RANGE (1 << 0)
+#define SCER_LOCK_FRAME_SELECTION (1 << 1)
+/* show/use subframes (for checking motion blur) */
+#define SCER_SHOW_SUBFRAME (1 << 3)
/* RenderData.mode */
-#define R_OSA (1 << 0)
-#define R_MODE_UNUSED_1 (1 << 1) /* cleared */
-#define R_MODE_UNUSED_2 (1 << 2) /* cleared */
-#define R_MODE_UNUSED_3 (1 << 3) /* cleared */
-#define R_MODE_UNUSED_4 (1 << 4) /* cleared */
-#define R_MODE_UNUSED_5 (1 << 5) /* cleared */
-#define R_MODE_UNUSED_6 (1 << 6) /* cleared */
-#define R_MODE_UNUSED_7 (1 << 7) /* cleared */
-#define R_MODE_UNUSED_8 (1 << 8) /* cleared */
-#define R_BORDER (1 << 9)
-#define R_MODE_UNUSED_10 (1 << 10) /* cleared */
-#define R_CROP (1 << 11)
+#define R_OSA (1 << 0)
+#define R_MODE_UNUSED_1 (1 << 1) /* cleared */
+#define R_MODE_UNUSED_2 (1 << 2) /* cleared */
+#define R_MODE_UNUSED_3 (1 << 3) /* cleared */
+#define R_MODE_UNUSED_4 (1 << 4) /* cleared */
+#define R_MODE_UNUSED_5 (1 << 5) /* cleared */
+#define R_MODE_UNUSED_6 (1 << 6) /* cleared */
+#define R_MODE_UNUSED_7 (1 << 7) /* cleared */
+#define R_MODE_UNUSED_8 (1 << 8) /* cleared */
+#define R_BORDER (1 << 9)
+#define R_MODE_UNUSED_10 (1 << 10) /* cleared */
+#define R_CROP (1 << 11)
/* Disable camera switching: runtime (DURIAN_CAMERA_SWITCH) */
-#define R_NO_CAMERA_SWITCH (1 << 12)
-#define R_MODE_UNUSED_13 (1 << 13) /* cleared */
-#define R_MBLUR (1 << 14)
- /* unified was here */
-#define R_MODE_UNUSED_16 (1 << 16) /* cleared */
-#define R_MODE_UNUSED_17 (1 << 17) /* cleared */
-#define R_MODE_UNUSED_18 (1 << 18) /* cleared */
-#define R_MODE_UNUSED_19 (1 << 19) /* cleared */
-#define R_FIXED_THREADS (1 << 19)
-
-#define R_MODE_UNUSED_20 (1 << 20) /* cleared */
-#define R_MODE_UNUSED_21 (1 << 21) /* cleared */
-#define R_NO_OVERWRITE (1 << 22) /* skip existing files */
-#define R_TOUCH (1 << 23) /* touch files before rendering */
-#define R_SIMPLIFY (1 << 24)
-#define R_EDGE_FRS (1 << 25) /* R_EDGE reserved for Freestyle */
-#define R_PERSISTENT_DATA (1 << 26) /* keep data around for re-render */
-#define R_MODE_UNUSED_27 (1 << 27) /* cleared */
+#define R_NO_CAMERA_SWITCH (1 << 12)
+#define R_MODE_UNUSED_13 (1 << 13) /* cleared */
+#define R_MBLUR (1 << 14)
+/* unified was here */
+#define R_MODE_UNUSED_16 (1 << 16) /* cleared */
+#define R_MODE_UNUSED_17 (1 << 17) /* cleared */
+#define R_MODE_UNUSED_18 (1 << 18) /* cleared */
+#define R_MODE_UNUSED_19 (1 << 19) /* cleared */
+#define R_FIXED_THREADS (1 << 19)
+
+#define R_MODE_UNUSED_20 (1 << 20) /* cleared */
+#define R_MODE_UNUSED_21 (1 << 21) /* cleared */
+#define R_NO_OVERWRITE (1 << 22) /* skip existing files */
+#define R_TOUCH (1 << 23) /* touch files before rendering */
+#define R_SIMPLIFY (1 << 24)
+#define R_EDGE_FRS (1 << 25) /* R_EDGE reserved for Freestyle */
+#define R_PERSISTENT_DATA (1 << 26) /* keep data around for re-render */
+#define R_MODE_UNUSED_27 (1 << 27) /* cleared */
/* RenderData.seq_flag */
enum {
- R_SEQ_UNUSED_0 = (1 << 0), /* cleared */
- R_SEQ_UNUSED_1 = (1 << 1), /* cleared */
- R_SEQ_UNUSED_2 = (1 << 2), /* cleared */
- R_SEQ_SOLID_TEX = (1 << 3),
- R_SEQ_CAMERA_DOF = (1 << 4),
+ R_SEQ_UNUSED_0 = (1 << 0), /* cleared */
+ R_SEQ_UNUSED_1 = (1 << 1), /* cleared */
+ R_SEQ_UNUSED_2 = (1 << 2), /* cleared */
+ R_SEQ_SOLID_TEX = (1 << 3),
+ R_SEQ_CAMERA_DOF = (1 << 4),
};
/* RenderData.displaymode */
-#define R_OUTPUT_SCREEN 0
-#define R_OUTPUT_AREA 1
-#define R_OUTPUT_WINDOW 2
-#define R_OUTPUT_NONE 3
-/*#define R_OUTPUT_FORKED 4*/
+#define R_OUTPUT_SCREEN 0
+#define R_OUTPUT_AREA 1
+#define R_OUTPUT_WINDOW 2
+#define R_OUTPUT_NONE 3
+/*#define R_OUTPUT_FORKED 4*/
/* RenderData.filtertype (used for nodes) */
-#define R_FILTER_BOX 0
-#define R_FILTER_TENT 1
-#define R_FILTER_QUAD 2
-#define R_FILTER_CUBIC 3
-#define R_FILTER_CATROM 4
-#define R_FILTER_GAUSS 5
-#define R_FILTER_MITCH 6
-#define R_FILTER_FAST_GAUSS 7
+#define R_FILTER_BOX 0
+#define R_FILTER_TENT 1
+#define R_FILTER_QUAD 2
+#define R_FILTER_CUBIC 3
+#define R_FILTER_CATROM 4
+#define R_FILTER_GAUSS 5
+#define R_FILTER_MITCH 6
+#define R_FILTER_FAST_GAUSS 7
/* RenderData.scemode */
-#define R_DOSEQ (1 << 0)
-#define R_BG_RENDER (1 << 1)
- /* passepartout is camera option now, keep this for backward compatibility */
-#define R_PASSEPARTOUT (1 << 2)
-#define R_BUTS_PREVIEW (1 << 3)
-#define R_EXTENSION (1 << 4)
-#define R_MATNODE_PREVIEW (1 << 5)
-#define R_DOCOMP (1 << 6)
-#define R_COMP_CROP (1 << 7)
-#define R_SCEMODE_UNUSED_8 (1 << 8) /* cleared */
-#define R_SINGLE_LAYER (1 << 9)
-#define R_EXR_TILE_FILE (1 << 10)
-#define R_SCEMODE_UNUSED_11 (1 << 11) /* cleared */
-#define R_NO_IMAGE_LOAD (1 << 12)
-#define R_SCEMODE_UNUSED_13 (1 << 13) /* cleared */
-#define R_NO_FRAME_UPDATE (1 << 14)
-#define R_FULL_SAMPLE (1 << 15)
-#define R_SCEMODE_UNUSED_16 (1 << 16) /* cleared */
-#define R_SCEMODE_UNUSED_17 (1 << 17) /* cleared */
-#define R_TEXNODE_PREVIEW (1 << 18)
-#define R_SCEMODE_UNUSED_19 (1 << 19) /* cleared */
-#define R_EXR_CACHE_FILE (1 << 20)
-#define R_MULTIVIEW (1 << 21)
+#define R_DOSEQ (1 << 0)
+#define R_BG_RENDER (1 << 1)
+/* passepartout is camera option now, keep this for backward compatibility */
+#define R_PASSEPARTOUT (1 << 2)
+#define R_BUTS_PREVIEW (1 << 3)
+#define R_EXTENSION (1 << 4)
+#define R_MATNODE_PREVIEW (1 << 5)
+#define R_DOCOMP (1 << 6)
+#define R_COMP_CROP (1 << 7)
+#define R_SCEMODE_UNUSED_8 (1 << 8) /* cleared */
+#define R_SINGLE_LAYER (1 << 9)
+#define R_EXR_TILE_FILE (1 << 10)
+#define R_SCEMODE_UNUSED_11 (1 << 11) /* cleared */
+#define R_NO_IMAGE_LOAD (1 << 12)
+#define R_SCEMODE_UNUSED_13 (1 << 13) /* cleared */
+#define R_NO_FRAME_UPDATE (1 << 14)
+#define R_FULL_SAMPLE (1 << 15)
+#define R_SCEMODE_UNUSED_16 (1 << 16) /* cleared */
+#define R_SCEMODE_UNUSED_17 (1 << 17) /* cleared */
+#define R_TEXNODE_PREVIEW (1 << 18)
+#define R_SCEMODE_UNUSED_19 (1 << 19) /* cleared */
+#define R_EXR_CACHE_FILE (1 << 20)
+#define R_MULTIVIEW (1 << 21)
/* RenderData.stamp */
-#define R_STAMP_TIME (1 << 0)
-#define R_STAMP_FRAME (1 << 1)
-#define R_STAMP_DATE (1 << 2)
-#define R_STAMP_CAMERA (1 << 3)
-#define R_STAMP_SCENE (1 << 4)
-#define R_STAMP_NOTE (1 << 5)
-#define R_STAMP_DRAW (1 << 6) /* draw in the image */
-#define R_STAMP_MARKER (1 << 7)
-#define R_STAMP_FILENAME (1 << 8)
-#define R_STAMP_SEQSTRIP (1 << 9)
-#define R_STAMP_RENDERTIME (1 << 10)
-#define R_STAMP_CAMERALENS (1 << 11)
-#define R_STAMP_STRIPMETA (1 << 12)
-#define R_STAMP_MEMORY (1 << 13)
-#define R_STAMP_HIDE_LABELS (1 << 14)
-#define R_STAMP_FRAME_RANGE (1 << 15)
-#define R_STAMP_HOSTNAME (1 << 16)
-#define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE| \
- R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP| \
- R_STAMP_RENDERTIME|R_STAMP_CAMERALENS|R_STAMP_MEMORY| \
- R_STAMP_HIDE_LABELS|R_STAMP_FRAME_RANGE|R_STAMP_HOSTNAME)
+#define R_STAMP_TIME (1 << 0)
+#define R_STAMP_FRAME (1 << 1)
+#define R_STAMP_DATE (1 << 2)
+#define R_STAMP_CAMERA (1 << 3)
+#define R_STAMP_SCENE (1 << 4)
+#define R_STAMP_NOTE (1 << 5)
+#define R_STAMP_DRAW (1 << 6) /* draw in the image */
+#define R_STAMP_MARKER (1 << 7)
+#define R_STAMP_FILENAME (1 << 8)
+#define R_STAMP_SEQSTRIP (1 << 9)
+#define R_STAMP_RENDERTIME (1 << 10)
+#define R_STAMP_CAMERALENS (1 << 11)
+#define R_STAMP_STRIPMETA (1 << 12)
+#define R_STAMP_MEMORY (1 << 13)
+#define R_STAMP_HIDE_LABELS (1 << 14)
+#define R_STAMP_FRAME_RANGE (1 << 15)
+#define R_STAMP_HOSTNAME (1 << 16)
+#define R_STAMP_ALL \
+ (R_STAMP_TIME | R_STAMP_FRAME | R_STAMP_DATE | R_STAMP_CAMERA | R_STAMP_SCENE | R_STAMP_NOTE | \
+ R_STAMP_MARKER | R_STAMP_FILENAME | R_STAMP_SEQSTRIP | R_STAMP_RENDERTIME | \
+ R_STAMP_CAMERALENS | R_STAMP_MEMORY | R_STAMP_HIDE_LABELS | R_STAMP_FRAME_RANGE | \
+ R_STAMP_HOSTNAME)
/** #RenderData.alphamode */
-#define R_ADDSKY 0
-#define R_ALPHAPREMUL 1
+#define R_ADDSKY 0
+#define R_ALPHAPREMUL 1
/* RenderData.color_mgt_flag */
enum {
- /** deprecated, should only be used in versioning code only */
- R_COLOR_MANAGEMENT = (1 << 0),
- R_COLOR_MANAGEMENT_UNUSED_1 = (1 << 1),
+ /** deprecated, should only be used in versioning code only */
+ R_COLOR_MANAGEMENT = (1 << 0),
+ R_COLOR_MANAGEMENT_UNUSED_1 = (1 << 1),
};
#ifdef DNA_DEPRECATED
/* RenderData.subimtype flag options for imtype */
enum {
- R_OPENEXR_HALF = (1 << 0), /*deprecated*/
- R_OPENEXR_ZBUF = (1 << 1), /*deprecated*/
- R_PREVIEW_JPG = (1 << 2), /*deprecated*/
- R_CINEON_LOG = (1 << 3), /*deprecated*/
- R_TIFF_16BIT = (1 << 4), /*deprecated*/
-
- R_JPEG2K_12BIT = (1 << 5), /* Jpeg2000 */ /*deprecated*/
- R_JPEG2K_16BIT = (1 << 6), /*deprecated*/
- R_JPEG2K_YCC = (1 << 7), /* when disabled use RGB */ /*deprecated*/
- R_JPEG2K_CINE_PRESET = (1 << 8), /*deprecated*/
- R_JPEG2K_CINE_48FPS = (1 << 9), /*deprecated*/
+ R_OPENEXR_HALF = (1 << 0), /*deprecated*/
+ R_OPENEXR_ZBUF = (1 << 1), /*deprecated*/
+ R_PREVIEW_JPG = (1 << 2), /*deprecated*/
+ R_CINEON_LOG = (1 << 3), /*deprecated*/
+ R_TIFF_16BIT = (1 << 4), /*deprecated*/
+
+ R_JPEG2K_12BIT = (1 << 5),
+ /* Jpeg2000 */ /*deprecated*/
+ R_JPEG2K_16BIT = (1 << 6), /*deprecated*/
+ R_JPEG2K_YCC = (1 << 7),
+ /* when disabled use RGB */ /*deprecated*/
+ R_JPEG2K_CINE_PRESET = (1 << 8), /*deprecated*/
+ R_JPEG2K_CINE_48FPS = (1 << 9), /*deprecated*/
};
#endif
/* bake_mode: same as RE_BAKE_xxx defines */
/* RenderData.bake_flag */
-#define R_BAKE_CLEAR (1 << 0)
+#define R_BAKE_CLEAR (1 << 0)
/* #define R_BAKE_OSA (1 << 1) */ /* deprecated */
-#define R_BAKE_TO_ACTIVE (1 << 2)
+#define R_BAKE_TO_ACTIVE (1 << 2)
/* #define R_BAKE_NORMALIZE (1 << 3) */ /* deprecated */
-#define R_BAKE_MULTIRES (1 << 4)
-#define R_BAKE_LORES_MESH (1 << 5)
+#define R_BAKE_MULTIRES (1 << 4)
+#define R_BAKE_LORES_MESH (1 << 5)
/* #define R_BAKE_VCOL (1 << 6) */ /* deprecated */
-#define R_BAKE_USERSCALE (1 << 7)
-#define R_BAKE_CAGE (1 << 8)
-#define R_BAKE_SPLIT_MAT (1 << 9)
-#define R_BAKE_AUTO_NAME (1 << 10)
+#define R_BAKE_USERSCALE (1 << 7)
+#define R_BAKE_CAGE (1 << 8)
+#define R_BAKE_SPLIT_MAT (1 << 9)
+#define R_BAKE_AUTO_NAME (1 << 10)
/* RenderData.bake_normal_space */
-#define R_BAKE_SPACE_CAMERA 0
-#define R_BAKE_SPACE_WORLD 1
-#define R_BAKE_SPACE_OBJECT 2
+#define R_BAKE_SPACE_CAMERA 0
+#define R_BAKE_SPACE_WORLD 1
+#define R_BAKE_SPACE_OBJECT 2
#define R_BAKE_SPACE_TANGENT 3
/* RenderData.line_thickness_mode */
@@ -1961,218 +1953,212 @@ extern const char *RE_engine_id_CYCLES;
/* Current precision is 16 for the sub-frames closer to MAXFRAME. */
/* for general use */
-#define MAXFRAME 1048574
-#define MAXFRAMEF 1048574.0f
+#define MAXFRAME 1048574
+#define MAXFRAMEF 1048574.0f
-#define MINFRAME 0
-#define MINFRAMEF 0.0f
+#define MINFRAME 0
+#define MINFRAMEF 0.0f
/* (minimum frame number for current-frame) */
-#define MINAFRAME -1048574
-#define MINAFRAMEF -1048574.0f
-
-#define BASE_VISIBLE(v3d, base) ( \
- ((v3d == NULL) || ((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
- ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
- (((base)->flag & BASE_VISIBLE) != 0))
-#define BASE_SELECTABLE(v3d, base) ( \
- BASE_VISIBLE(v3d, base) && \
- ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0)) && \
- (((base)->flag & BASE_SELECTABLE) != 0))
-#define BASE_SELECTED(v3d, base) \
- (BASE_VISIBLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
-#define BASE_EDITABLE(v3d, base) \
- (BASE_VISIBLE(v3d, base) && ((base)->object->id.lib == NULL))
+#define MINAFRAME -1048574
+#define MINAFRAMEF -1048574.0f
+
+#define BASE_VISIBLE(v3d, base) \
+ (((v3d == NULL) || ((v3d)->localvd == NULL) || \
+ ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
+ ((v3d == NULL) || \
+ (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
+ (((base)->flag & BASE_VISIBLE) != 0))
+#define BASE_SELECTABLE(v3d, base) \
+ (BASE_VISIBLE(v3d, base) && \
+ ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0)) && \
+ (((base)->flag & BASE_SELECTABLE) != 0))
+#define BASE_SELECTED(v3d, base) (BASE_VISIBLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
+#define BASE_EDITABLE(v3d, base) (BASE_VISIBLE(v3d, base) && ((base)->object->id.lib == NULL))
#define BASE_SELECTED_EDITABLE(v3d, base) \
- (BASE_EDITABLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
+ (BASE_EDITABLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
/* deprecate this! */
-#define FIRSTBASE(_view_layer) ((_view_layer)->object_bases.first)
-#define LASTBASE(_view_layer) ((_view_layer)->object_bases.last)
-#define BASACT(_view_layer) ((_view_layer)->basact)
-#define OBACT(_view_layer) (BASACT(_view_layer) ? BASACT(_view_layer)->object: NULL)
+#define FIRSTBASE(_view_layer) ((_view_layer)->object_bases.first)
+#define LASTBASE(_view_layer) ((_view_layer)->object_bases.last)
+#define BASACT(_view_layer) ((_view_layer)->basact)
+#define OBACT(_view_layer) (BASACT(_view_layer) ? BASACT(_view_layer)->object : NULL)
#define OBEDIT_FROM_WORKSPACE(workspace, _view_layer) \
- (((workspace)->object_mode & OD_MODE_EDIT) ? OBACT(_view_layer) : NULL)
-#define OBEDIT_FROM_OBACT(ob) \
- ((ob) ? (((ob)->mode & OB_MODE_EDIT) ? ob : NULL) : NULL)
-#define OBPOSE_FROM_OBACT(ob) \
- ((ob) ? (((ob)->mode & OB_MODE_POSE) ? ob : NULL) : NULL)
-#define OBEDIT_FROM_VIEW_LAYER(view_layer) \
- OBEDIT_FROM_OBACT(OBACT(view_layer))
+ (((workspace)->object_mode & OD_MODE_EDIT) ? OBACT(_view_layer) : NULL)
+#define OBEDIT_FROM_OBACT(ob) ((ob) ? (((ob)->mode & OB_MODE_EDIT) ? ob : NULL) : NULL)
+#define OBPOSE_FROM_OBACT(ob) ((ob) ? (((ob)->mode & OB_MODE_POSE) ? ob : NULL) : NULL)
+#define OBEDIT_FROM_VIEW_LAYER(view_layer) OBEDIT_FROM_OBACT(OBACT(view_layer))
#define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
-#define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
-
-#define CFRA (scene->r.cfra)
-#define SUBFRA (scene->r.subframe)
-#define SFRA (scene->r.sfra)
-#define EFRA (scene->r.efra)
-#define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
-#define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
-#define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
-#define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec)
-#define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
-#define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base)
+#define V3D_CAMERA_SCENE(scene, v3d) \
+ ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
+
+#define CFRA (scene->r.cfra)
+#define SUBFRA (scene->r.subframe)
+#define SFRA (scene->r.sfra)
+#define EFRA (scene->r.efra)
+#define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
+#define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
+#define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
+#define FRA2TIME(a) ((((double)scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec)
+#define TIME2FRA(a) ((((double)scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
+#define FPS (((double)scene->r.frs_sec) / (double)scene->r.frs_sec_base)
/* Base.flag is in DNA_object_types.h */
/* ToolSettings.transform_flag */
enum {
- SCE_XFORM_AXIS_ALIGN = (1 << 0),
+ SCE_XFORM_AXIS_ALIGN = (1 << 0),
};
/* ToolSettings.object_flag */
enum {
- SCE_OBJECT_MODE_LOCK = (1 << 0),
+ SCE_OBJECT_MODE_LOCK = (1 << 0),
};
/* ToolSettings.snap_flag */
-#define SCE_SNAP (1 << 0)
-#define SCE_SNAP_ROTATE (1 << 1)
-#define SCE_SNAP_PEEL_OBJECT (1 << 2)
-#define SCE_SNAP_PROJECT (1 << 3)
-#define SCE_SNAP_NO_SELF (1 << 4)
-#define SCE_SNAP_ABS_GRID (1 << 5)
+#define SCE_SNAP (1 << 0)
+#define SCE_SNAP_ROTATE (1 << 1)
+#define SCE_SNAP_PEEL_OBJECT (1 << 2)
+#define SCE_SNAP_PROJECT (1 << 3)
+#define SCE_SNAP_NO_SELF (1 << 4)
+#define SCE_SNAP_ABS_GRID (1 << 5)
/* ToolSettings.snap_target */
-#define SCE_SNAP_TARGET_CLOSEST 0
-#define SCE_SNAP_TARGET_CENTER 1
-#define SCE_SNAP_TARGET_MEDIAN 2
-#define SCE_SNAP_TARGET_ACTIVE 3
+#define SCE_SNAP_TARGET_CLOSEST 0
+#define SCE_SNAP_TARGET_CENTER 1
+#define SCE_SNAP_TARGET_MEDIAN 2
+#define SCE_SNAP_TARGET_ACTIVE 3
/* ToolSettings.snap_mode */
-#define SCE_SNAP_MODE_VERTEX (1 << 0)
-#define SCE_SNAP_MODE_EDGE (1 << 1)
-#define SCE_SNAP_MODE_FACE (1 << 2)
-#define SCE_SNAP_MODE_VOLUME (1 << 3)
+#define SCE_SNAP_MODE_VERTEX (1 << 0)
+#define SCE_SNAP_MODE_EDGE (1 << 1)
+#define SCE_SNAP_MODE_FACE (1 << 2)
+#define SCE_SNAP_MODE_VOLUME (1 << 3)
#define SCE_SNAP_MODE_INCREMENT (1 << 4)
/* ToolSettings.snap_node_mode */
-#define SCE_SNAP_MODE_GRID (1 << 5)
-#define SCE_SNAP_MODE_NODE_X (1 << 6)
-#define SCE_SNAP_MODE_NODE_Y (1 << 7)
+#define SCE_SNAP_MODE_GRID (1 << 5)
+#define SCE_SNAP_MODE_NODE_X (1 << 6)
+#define SCE_SNAP_MODE_NODE_Y (1 << 7)
/** #ToolSettings.snap_transform_mode_flag */
enum {
- SCE_SNAP_TRANSFORM_MODE_TRANSLATE = (1 << 0),
- SCE_SNAP_TRANSFORM_MODE_ROTATE = (1 << 1),
- SCE_SNAP_TRANSFORM_MODE_SCALE = (1 << 2),
+ SCE_SNAP_TRANSFORM_MODE_TRANSLATE = (1 << 0),
+ SCE_SNAP_TRANSFORM_MODE_ROTATE = (1 << 1),
+ SCE_SNAP_TRANSFORM_MODE_SCALE = (1 << 2),
};
/* ToolSettings.selectmode */
-#define SCE_SELECT_VERTEX (1 << 0) /* for mesh */
-#define SCE_SELECT_EDGE (1 << 1)
-#define SCE_SELECT_FACE (1 << 2)
+#define SCE_SELECT_VERTEX (1 << 0) /* for mesh */
+#define SCE_SELECT_EDGE (1 << 1)
+#define SCE_SELECT_FACE (1 << 2)
/* MeshStatVis.type */
-#define SCE_STATVIS_OVERHANG 0
-#define SCE_STATVIS_THICKNESS 1
-#define SCE_STATVIS_INTERSECT 2
-#define SCE_STATVIS_DISTORT 3
-#define SCE_STATVIS_SHARP 4
+#define SCE_STATVIS_OVERHANG 0
+#define SCE_STATVIS_THICKNESS 1
+#define SCE_STATVIS_INTERSECT 2
+#define SCE_STATVIS_DISTORT 3
+#define SCE_STATVIS_SHARP 4
/* ParticleEditSettings.selectmode for particles */
-#define SCE_SELECT_PATH (1 << 0)
-#define SCE_SELECT_POINT (1 << 1)
-#define SCE_SELECT_END (1 << 2)
+#define SCE_SELECT_PATH (1 << 0)
+#define SCE_SELECT_POINT (1 << 1)
+#define SCE_SELECT_END (1 << 2)
/* ToolSettings.prop_mode (proportional falloff) */
-#define PROP_SMOOTH 0
-#define PROP_SPHERE 1
-#define PROP_ROOT 2
-#define PROP_SHARP 3
-#define PROP_LIN 4
-#define PROP_CONST 5
-#define PROP_RANDOM 6
-#define PROP_INVSQUARE 7
-#define PROP_MODE_MAX 8
+#define PROP_SMOOTH 0
+#define PROP_SPHERE 1
+#define PROP_ROOT 2
+#define PROP_SHARP 3
+#define PROP_LIN 4
+#define PROP_CONST 5
+#define PROP_RANDOM 6
+#define PROP_INVSQUARE 7
+#define PROP_MODE_MAX 8
/* ToolSettings.proportional */
-#define PROP_EDIT_OFF 0
-#define PROP_EDIT_ON 1
-#define PROP_EDIT_CONNECTED 2
-#define PROP_EDIT_PROJECTED 3
+#define PROP_EDIT_OFF 0
+#define PROP_EDIT_ON 1
+#define PROP_EDIT_CONNECTED 2
+#define PROP_EDIT_PROJECTED 3
/* ToolSettings.weightuser */
enum {
- OB_DRAW_GROUPUSER_NONE = 0,
- OB_DRAW_GROUPUSER_ACTIVE = 1,
- OB_DRAW_GROUPUSER_ALL = 2,
+ OB_DRAW_GROUPUSER_NONE = 0,
+ OB_DRAW_GROUPUSER_ACTIVE = 1,
+ OB_DRAW_GROUPUSER_ALL = 2,
};
/* toolsettings->face_strength */
enum {
- FACE_STRENGTH_WEAK = -16384,
- FACE_STRENGTH_MEDIUM = 0,
- FACE_STRENGTH_STRONG = 16384,
+ FACE_STRENGTH_WEAK = -16384,
+ FACE_STRENGTH_MEDIUM = 0,
+ FACE_STRENGTH_STRONG = 16384,
};
/* object_vgroup.c */
/* ToolSettings.vgroupsubset */
typedef enum eVGroupSelect {
- WT_VGROUP_ALL = 0,
- WT_VGROUP_ACTIVE = 1,
- WT_VGROUP_BONE_SELECT = 2,
- WT_VGROUP_BONE_DEFORM = 3,
- WT_VGROUP_BONE_DEFORM_OFF = 4,
+ WT_VGROUP_ALL = 0,
+ WT_VGROUP_ACTIVE = 1,
+ WT_VGROUP_BONE_SELECT = 2,
+ WT_VGROUP_BONE_DEFORM = 3,
+ WT_VGROUP_BONE_DEFORM_OFF = 4,
} eVGroupSelect;
#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))
-
+ ((1 << WT_VGROUP_ACTIVE) | (1 << WT_VGROUP_BONE_SELECT) | (1 << WT_VGROUP_BONE_DEFORM) | \
+ (1 << WT_VGROUP_BONE_DEFORM_OFF) | (1 << WT_VGROUP_ALL))
/* Scene.flag */
-#define SCE_DS_SELECTED (1 << 0)
-#define SCE_DS_COLLAPSED (1 << 1)
-#define SCE_NLA_EDIT_ON (1 << 2)
-#define SCE_FRAME_DROP (1 << 3)
-#define SCE_KEYS_NO_SELONLY (1 << 4)
-
- /* return flag BKE_scene_base_iter_next functions */
-/* #define F_ERROR -1 */ /* UNUSED */
-#define F_START 0
-#define F_SCENE 1
-#define F_DUPLI 3
+#define SCE_DS_SELECTED (1 << 0)
+#define SCE_DS_COLLAPSED (1 << 1)
+#define SCE_NLA_EDIT_ON (1 << 2)
+#define SCE_FRAME_DROP (1 << 3)
+#define SCE_KEYS_NO_SELONLY (1 << 4)
+
+/* return flag BKE_scene_base_iter_next functions */
+/* #define F_ERROR -1 */ /* UNUSED */
+#define F_START 0
+#define F_SCENE 1
+#define F_DUPLI 3
/* AudioData.flag */
-#define AUDIO_MUTE (1 << 0)
-#define AUDIO_SYNC (1 << 1)
-#define AUDIO_SCRUB (1 << 2)
-#define AUDIO_VOLUME_ANIMATED (1 << 3)
+#define AUDIO_MUTE (1 << 0)
+#define AUDIO_SYNC (1 << 1)
+#define AUDIO_SCRUB (1 << 2)
+#define AUDIO_VOLUME_ANIMATED (1 << 3)
/* FFMpegCodecData.flags */
enum {
#ifdef DNA_DEPRECATED
- FFMPEG_MULTIPLEX_AUDIO = (1 << 0), /* deprecated, you can choose none as audiocodec now */
+ FFMPEG_MULTIPLEX_AUDIO = (1 << 0), /* deprecated, you can choose none as audiocodec now */
#endif
- FFMPEG_AUTOSPLIT_OUTPUT = (1 << 1),
- FFMPEG_LOSSLESS_OUTPUT = (1 << 2),
- FFMPEG_USE_MAX_B_FRAMES = (1 << 3),
+ FFMPEG_AUTOSPLIT_OUTPUT = (1 << 1),
+ FFMPEG_LOSSLESS_OUTPUT = (1 << 2),
+ FFMPEG_USE_MAX_B_FRAMES = (1 << 3),
};
/* Paint.flags */
typedef enum ePaintFlags {
- PAINT_SHOW_BRUSH = (1 << 0),
- PAINT_FAST_NAVIGATE = (1 << 1),
- PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
- PAINT_USE_CAVITY_MASK = (1 << 3),
+ PAINT_SHOW_BRUSH = (1 << 0),
+ PAINT_FAST_NAVIGATE = (1 << 1),
+ PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
+ PAINT_USE_CAVITY_MASK = (1 << 3),
} ePaintFlags;
/* Paint.symmetry_flags
* (for now just a duplicate of sculpt symmetry flags) */
typedef enum ePaintSymmetryFlags {
- 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),
+ 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),
} ePaintSymmetryFlags;
#define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)
@@ -2180,244 +2166,244 @@ typedef enum ePaintSymmetryFlags {
/* Sculpt.flags */
/* These can eventually be moved to paint flags? */
typedef enum eSculptFlags {
- SCULPT_FLAG_UNUSED_0 = (1 << 0), /* cleared */
- SCULPT_FLAG_UNUSED_1 = (1 << 1), /* cleared */
- SCULPT_FLAG_UNUSED_2 = (1 << 2), /* cleared */
+ SCULPT_FLAG_UNUSED_0 = (1 << 0), /* cleared */
+ SCULPT_FLAG_UNUSED_1 = (1 << 1), /* cleared */
+ SCULPT_FLAG_UNUSED_2 = (1 << 2), /* cleared */
- SCULPT_LOCK_X = (1 << 3),
- SCULPT_LOCK_Y = (1 << 4),
- SCULPT_LOCK_Z = (1 << 5),
+ SCULPT_LOCK_X = (1 << 3),
+ SCULPT_LOCK_Y = (1 << 4),
+ SCULPT_LOCK_Z = (1 << 5),
- SCULPT_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ SCULPT_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- SCULPT_USE_OPENMP = (1 << 7),
- SCULPT_ONLY_DEFORM = (1 << 8),
- SCULPT_SHOW_DIFFUSE = (1 << 9),
+ SCULPT_USE_OPENMP = (1 << 7),
+ SCULPT_ONLY_DEFORM = (1 << 8),
+ SCULPT_SHOW_DIFFUSE = (1 << 9),
- /* If set, the mesh will be drawn with smooth-shading in
- * dynamic-topology mode */
- SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10),
+ /* If set, the mesh will be drawn with smooth-shading in
+ * dynamic-topology mode */
+ SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10),
- /* If set, dynamic-topology brushes will subdivide short edges */
- SCULPT_DYNTOPO_SUBDIVIDE = (1 << 12),
- /* If set, dynamic-topology brushes will collapse short edges */
- SCULPT_DYNTOPO_COLLAPSE = (1 << 11),
+ /* If set, dynamic-topology brushes will subdivide short edges */
+ SCULPT_DYNTOPO_SUBDIVIDE = (1 << 12),
+ /* If set, dynamic-topology brushes will collapse short edges */
+ SCULPT_DYNTOPO_COLLAPSE = (1 << 11),
- /* If set, dynamic-topology detail size will be constant in object space */
- SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
- SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
- SCULPT_DYNTOPO_DETAIL_MANUAL = (1 << 16),
+ /* If set, dynamic-topology detail size will be constant in object space */
+ SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
+ SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
+ SCULPT_DYNTOPO_DETAIL_MANUAL = (1 << 16),
- /* Don't display mask in viewport, but still use it for strokes. */
- SCULPT_HIDE_MASK = (1 << 15),
+ /* Don't display mask in viewport, but still use it for strokes. */
+ SCULPT_HIDE_MASK = (1 << 15),
} eSculptFlags;
/* ImagePaintSettings.mode */
typedef enum eImagePaintMode {
- IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
- IMAGEPAINT_MODE_IMAGE, /* select texture paint image directly */
+ IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
+ IMAGEPAINT_MODE_IMAGE, /* select texture paint image directly */
} eImagePaintMode;
/* ImagePaintSettings.interp */
enum {
- IMAGEPAINT_INTERP_LINEAR = 0,
- IMAGEPAINT_INTERP_CLOSEST,
+ IMAGEPAINT_INTERP_LINEAR = 0,
+ IMAGEPAINT_INTERP_CLOSEST,
};
/* ImagePaintSettings.flag */
-#define IMAGEPAINT_DRAWING (1 << 0)
-// #define IMAGEPAINT_DRAW_TOOL (1 << 1) // deprecated
-// #define IMAGEPAINT_DRAW_TOOL_DRAWING (1 << 2) // deprecated
+#define IMAGEPAINT_DRAWING (1 << 0)
+// #define IMAGEPAINT_DRAW_TOOL (1 << 1) // deprecated
+// #define IMAGEPAINT_DRAW_TOOL_DRAWING (1 << 2) // deprecated
/* projection painting only */
/* ImagePaintSettings.flag */
-#define IMAGEPAINT_PROJECT_XRAY (1 << 4)
-#define IMAGEPAINT_PROJECT_BACKFACE (1 << 5)
-#define IMAGEPAINT_PROJECT_FLAT (1 << 6)
-#define IMAGEPAINT_PROJECT_LAYER_CLONE (1 << 7)
-#define IMAGEPAINT_PROJECT_LAYER_STENCIL (1 << 8)
-#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV (1 << 9)
+#define IMAGEPAINT_PROJECT_XRAY (1 << 4)
+#define IMAGEPAINT_PROJECT_BACKFACE (1 << 5)
+#define IMAGEPAINT_PROJECT_FLAT (1 << 6)
+#define IMAGEPAINT_PROJECT_LAYER_CLONE (1 << 7)
+#define IMAGEPAINT_PROJECT_LAYER_STENCIL (1 << 8)
+#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV (1 << 9)
/* ImagePaintSettings.missing_data */
-#define IMAGEPAINT_MISSING_UVS (1 << 0)
-#define IMAGEPAINT_MISSING_MATERIAL (1 << 1)
-#define IMAGEPAINT_MISSING_TEX (1 << 2)
-#define IMAGEPAINT_MISSING_STENCIL (1 << 3)
+#define IMAGEPAINT_MISSING_UVS (1 << 0)
+#define IMAGEPAINT_MISSING_MATERIAL (1 << 1)
+#define IMAGEPAINT_MISSING_TEX (1 << 2)
+#define IMAGEPAINT_MISSING_STENCIL (1 << 3)
/* ToolSettings.uvcalc_flag */
-#define UVCALC_FILLHOLES (1 << 0)
+#define UVCALC_FILLHOLES (1 << 0)
/** would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
-#define UVCALC_NO_ASPECT_CORRECT (1 << 1)
+#define UVCALC_NO_ASPECT_CORRECT (1 << 1)
/** adjust UV's while transforming to avoid distortion */
-#define UVCALC_TRANSFORM_CORRECT (1 << 2)
+#define UVCALC_TRANSFORM_CORRECT (1 << 2)
/** Use mesh data after subsurf to compute UVs*/
-#define UVCALC_USESUBSURF (1 << 3)
+#define UVCALC_USESUBSURF (1 << 3)
/* ToolSettings.uv_flag */
-#define UV_SYNC_SELECTION 1
-#define UV_SHOW_SAME_IMAGE 2
+#define UV_SYNC_SELECTION 1
+#define UV_SHOW_SAME_IMAGE 2
/* ToolSettings.uv_selectmode */
-#define UV_SELECT_VERTEX 1
-#define UV_SELECT_EDGE 2
-#define UV_SELECT_FACE 4
-#define UV_SELECT_ISLAND 8
+#define UV_SELECT_VERTEX 1
+#define UV_SELECT_EDGE 2
+#define UV_SELECT_FACE 4
+#define UV_SELECT_ISLAND 8
/* ToolSettings.edge_mode */
-#define EDGE_MODE_SELECT 0
-#define EDGE_MODE_TAG_SEAM 1
-#define EDGE_MODE_TAG_SHARP 2
-#define EDGE_MODE_TAG_CREASE 3
-#define EDGE_MODE_TAG_BEVEL 4
-#define EDGE_MODE_TAG_FREESTYLE 5
+#define EDGE_MODE_SELECT 0
+#define EDGE_MODE_TAG_SEAM 1
+#define EDGE_MODE_TAG_SHARP 2
+#define EDGE_MODE_TAG_CREASE 3
+#define EDGE_MODE_TAG_BEVEL 4
+#define EDGE_MODE_TAG_FREESTYLE 5
/* ToolSettings.gpencil_flags */
typedef enum eGPencil_Flags {
- /* When creating new frames, the last frame gets used as the basis for the new one */
- GP_TOOL_FLAG_RETAIN_LAST = (1 << 1),
- /* Add the strokes below all strokes in the layer */
- GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2),
- /* Show compact list of colors */
- GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3),
- /* Generate wheight data for new strokes */
- GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
+ /* When creating new frames, the last frame gets used as the basis for the new one */
+ GP_TOOL_FLAG_RETAIN_LAST = (1 << 1),
+ /* Add the strokes below all strokes in the layer */
+ GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2),
+ /* Show compact list of colors */
+ GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3),
+ /* Generate wheight data for new strokes */
+ GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
} eGPencil_Flags;
/* scene->r.simplify_gpencil */
typedef enum eGPencil_SimplifyFlags {
- /* Simplify */
- SIMPLIFY_GPENCIL_ENABLE = (1 << 0),
- /* Simplify on play */
- SIMPLIFY_GPENCIL_ON_PLAY = (1 << 1),
- /* Simplify fill on viewport */
- SIMPLIFY_GPENCIL_FILL = (1 << 2),
- /* Simplify modifier on viewport */
- SIMPLIFY_GPENCIL_MODIFIER = (1 << 3),
- /* Remove fill external line */
- SIMPLIFY_GPENCIL_REMOVE_FILL_LINE = (1 << 4),
- /* Simplify Shader FX */
- SIMPLIFY_GPENCIL_FX = (1 << 5),
- /* Simplify layer blending */
- SIMPLIFY_GPENCIL_BLEND = (1 << 6),
+ /* Simplify */
+ SIMPLIFY_GPENCIL_ENABLE = (1 << 0),
+ /* Simplify on play */
+ SIMPLIFY_GPENCIL_ON_PLAY = (1 << 1),
+ /* Simplify fill on viewport */
+ SIMPLIFY_GPENCIL_FILL = (1 << 2),
+ /* Simplify modifier on viewport */
+ SIMPLIFY_GPENCIL_MODIFIER = (1 << 3),
+ /* Remove fill external line */
+ SIMPLIFY_GPENCIL_REMOVE_FILL_LINE = (1 << 4),
+ /* Simplify Shader FX */
+ SIMPLIFY_GPENCIL_FX = (1 << 5),
+ /* Simplify layer blending */
+ SIMPLIFY_GPENCIL_BLEND = (1 << 6),
} eGPencil_SimplifyFlags;
/* ToolSettings.gpencil_*_align - Stroke Placement mode flags */
typedef enum eGPencil_Placement_Flags {
- /* New strokes are added in viewport/data space (i.e. not screen space) */
- GP_PROJECT_VIEWSPACE = (1 << 0),
+ /* New strokes are added in viewport/data space (i.e. not screen space) */
+ GP_PROJECT_VIEWSPACE = (1 << 0),
- /* Viewport space, but relative to render canvas (Sequencer Preview Only) */
- GP_PROJECT_CANVAS = (1 << 1),
+ /* Viewport space, but relative to render canvas (Sequencer Preview Only) */
+ GP_PROJECT_CANVAS = (1 << 1),
- /* Project into the screen's Z values */
- GP_PROJECT_DEPTH_VIEW = (1 << 2),
- GP_PROJECT_DEPTH_STROKE = (1 << 3),
+ /* Project into the screen's Z values */
+ GP_PROJECT_DEPTH_VIEW = (1 << 2),
+ GP_PROJECT_DEPTH_STROKE = (1 << 3),
- /* "Use Endpoints" */
- GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
- GP_PROJECT_CURSOR = (1 << 5),
- GP_PROJECT_DEPTH_STROKE_FIRST = (1 << 6),
+ /* "Use Endpoints" */
+ GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
+ GP_PROJECT_CURSOR = (1 << 5),
+ GP_PROJECT_DEPTH_STROKE_FIRST = (1 << 6),
} eGPencil_Placement_Flags;
/* ToolSettings.gpencil_selectmode */
typedef enum eGPencil_Selectmode_types {
- GP_SELECTMODE_POINT = 0,
- GP_SELECTMODE_STROKE = 1,
- GP_SELECTMODE_SEGMENT = 2,
+ GP_SELECTMODE_POINT = 0,
+ GP_SELECTMODE_STROKE = 1,
+ GP_SELECTMODE_SEGMENT = 2,
} eGPencil_Selectmode_types;
/* ToolSettings.gpencil_guide_types */
typedef enum eGPencil_GuideTypes {
- GP_GUIDE_CIRCULAR = 0,
- GP_GUIDE_RADIAL,
- GP_GUIDE_PARALLEL,
- GP_GUIDE_GRID,
+ GP_GUIDE_CIRCULAR = 0,
+ GP_GUIDE_RADIAL,
+ GP_GUIDE_PARALLEL,
+ GP_GUIDE_GRID,
} eGPencil_GuideTypes;
/* ToolSettings.gpencil_guide_references */
typedef enum eGPencil_Guide_Reference {
- GP_GUIDE_REF_CURSOR = 0,
- GP_GUIDE_REF_CUSTOM,
- GP_GUIDE_REF_OBJECT,
+ GP_GUIDE_REF_CURSOR = 0,
+ GP_GUIDE_REF_CUSTOM,
+ GP_GUIDE_REF_OBJECT,
} eGPencil_Guide_Reference;
/* ToolSettings.particle flag */
-#define PE_KEEP_LENGTHS (1 << 0)
-#define PE_LOCK_FIRST (1 << 1)
-#define PE_DEFLECT_EMITTER (1 << 2)
-#define PE_INTERPOLATE_ADDED (1 << 3)
-#define PE_DRAW_PART (1 << 4)
-#define PE_UNUSED_6 (1 << 6) /* cleared */
-#define PE_FADE_TIME (1 << 7)
-#define PE_AUTO_VELOCITY (1 << 8)
+#define PE_KEEP_LENGTHS (1 << 0)
+#define PE_LOCK_FIRST (1 << 1)
+#define PE_DEFLECT_EMITTER (1 << 2)
+#define PE_INTERPOLATE_ADDED (1 << 3)
+#define PE_DRAW_PART (1 << 4)
+#define PE_UNUSED_6 (1 << 6) /* cleared */
+#define PE_FADE_TIME (1 << 7)
+#define PE_AUTO_VELOCITY (1 << 8)
/* ParticleEditSettings.brushtype */
-#define PE_BRUSH_NONE -1
-#define PE_BRUSH_COMB 0
-#define PE_BRUSH_CUT 1
-#define PE_BRUSH_LENGTH 2
-#define PE_BRUSH_PUFF 3
-#define PE_BRUSH_ADD 4
-#define PE_BRUSH_SMOOTH 5
-#define PE_BRUSH_WEIGHT 6
+#define PE_BRUSH_NONE -1
+#define PE_BRUSH_COMB 0
+#define PE_BRUSH_CUT 1
+#define PE_BRUSH_LENGTH 2
+#define PE_BRUSH_PUFF 3
+#define PE_BRUSH_ADD 4
+#define PE_BRUSH_SMOOTH 5
+#define PE_BRUSH_WEIGHT 6
/* ParticleBrushData.flag */
#define PE_BRUSH_DATA_PUFF_VOLUME 1
/* ParticleBrushData.edittype */
-#define PE_TYPE_PARTICLES 0
-#define PE_TYPE_SOFTBODY 1
-#define PE_TYPE_CLOTH 2
+#define PE_TYPE_PARTICLES 0
+#define PE_TYPE_SOFTBODY 1
+#define PE_TYPE_CLOTH 2
/* PhysicsSettings.flag */
-#define PHYS_GLOBAL_GRAVITY 1
+#define PHYS_GLOBAL_GRAVITY 1
/* UnitSettings */
#define USER_UNIT_ADAPTIVE 0xFF
/* UnitSettings.system */
-#define USER_UNIT_NONE 0
-#define USER_UNIT_METRIC 1
-#define USER_UNIT_IMPERIAL 2
+#define USER_UNIT_NONE 0
+#define USER_UNIT_METRIC 1
+#define USER_UNIT_IMPERIAL 2
/* UnitSettings.flag */
-#define USER_UNIT_OPT_SPLIT 1
-#define USER_UNIT_ROT_RADIANS 2
+#define USER_UNIT_OPT_SPLIT 1
+#define USER_UNIT_ROT_RADIANS 2
/* SceneEEVEE->flag */
enum {
- SCE_EEVEE_VOLUMETRIC_ENABLED = (1 << 0),
- SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1),
- SCE_EEVEE_VOLUMETRIC_SHADOWS = (1 << 2),
-// SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3), /* Unused */
- SCE_EEVEE_GTAO_ENABLED = (1 << 4),
- SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
- SCE_EEVEE_GTAO_BOUNCE = (1 << 6),
- SCE_EEVEE_DOF_ENABLED = (1 << 7),
- SCE_EEVEE_BLOOM_ENABLED = (1 << 8),
- SCE_EEVEE_MOTION_BLUR_ENABLED = (1 << 9),
- SCE_EEVEE_SHADOW_HIGH_BITDEPTH = (1 << 10),
- SCE_EEVEE_TAA_REPROJECTION = (1 << 11),
- SCE_EEVEE_SSS_ENABLED = (1 << 12),
- SCE_EEVEE_SSS_SEPARATE_ALBEDO = (1 << 13),
- SCE_EEVEE_SSR_ENABLED = (1 << 14),
- SCE_EEVEE_SSR_REFRACTION = (1 << 15),
- SCE_EEVEE_SSR_HALF_RESOLUTION = (1 << 16),
- SCE_EEVEE_SHOW_IRRADIANCE = (1 << 17),
- SCE_EEVEE_SHOW_CUBEMAPS = (1 << 18),
- SCE_EEVEE_GI_AUTOBAKE = (1 << 19),
- SCE_EEVEE_SHADOW_SOFT = (1 << 20),
- SCE_EEVEE_OVERSCAN = (1 << 21),
+ SCE_EEVEE_VOLUMETRIC_ENABLED = (1 << 0),
+ SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1),
+ SCE_EEVEE_VOLUMETRIC_SHADOWS = (1 << 2),
+ // SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3), /* Unused */
+ SCE_EEVEE_GTAO_ENABLED = (1 << 4),
+ SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
+ SCE_EEVEE_GTAO_BOUNCE = (1 << 6),
+ SCE_EEVEE_DOF_ENABLED = (1 << 7),
+ SCE_EEVEE_BLOOM_ENABLED = (1 << 8),
+ SCE_EEVEE_MOTION_BLUR_ENABLED = (1 << 9),
+ SCE_EEVEE_SHADOW_HIGH_BITDEPTH = (1 << 10),
+ SCE_EEVEE_TAA_REPROJECTION = (1 << 11),
+ SCE_EEVEE_SSS_ENABLED = (1 << 12),
+ SCE_EEVEE_SSS_SEPARATE_ALBEDO = (1 << 13),
+ SCE_EEVEE_SSR_ENABLED = (1 << 14),
+ SCE_EEVEE_SSR_REFRACTION = (1 << 15),
+ SCE_EEVEE_SSR_HALF_RESOLUTION = (1 << 16),
+ SCE_EEVEE_SHOW_IRRADIANCE = (1 << 17),
+ SCE_EEVEE_SHOW_CUBEMAPS = (1 << 18),
+ SCE_EEVEE_GI_AUTOBAKE = (1 << 19),
+ SCE_EEVEE_SHADOW_SOFT = (1 << 20),
+ SCE_EEVEE_OVERSCAN = (1 << 21),
};
/* SceneEEVEE->shadow_method */
enum {
- SHADOW_ESM = 1,
- SHADOW_VSM = 2,
- SHADOW_METHOD_MAX = 3,
+ SHADOW_ESM = 1,
+ SHADOW_VSM = 2,
+ SHADOW_METHOD_MAX = 3,
};
#ifdef __cplusplus
}
#endif
-#endif /* __DNA_SCENE_TYPES_H__ */
+#endif /* __DNA_SCENE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index a04d16b56fa..48418ee5035 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -42,129 +42,127 @@ struct wmDrawBuffer;
struct wmTimer;
struct wmTooltipState;
-
/* 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)
typedef struct bScreen {
- 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. */
- ListBase vertbase;
- ListBase edgebase;
- ListBase areabase;
-
- /** Screen level regions (menus), runtime only. */
- ListBase regionbase;
-
- struct Scene *scene DNA_DEPRECATED;
-
- /** General flags. */
- short flag;
- /** Winid from WM, starts with 1. */
- short winid;
- /** User-setting for which editors get redrawn during anim playback. */
- short redraws_flag;
-
- /** Temp screen in a temp window, don't save (like user prefs). */
- char temp;
- /** Temp screen for image render display or fileselect. */
- char state;
- /** Notifier for drawing edges. */
- char do_draw;
- /** Notifier for scale screen, changed screen, etc. */
- char do_refresh;
- /** Notifier for gesture draw. */
- char do_draw_gesture;
- /** Notifier for paint cursor draw. */
- char do_draw_paintcursor;
- /** Notifier for dragging draw. */
- char do_draw_drag;
- /** Set to delay screen handling after switching back from maximized area. */
- char skip_handling;
- /** Set when scrubbing to avoid some costly updates. */
- char scrubbing;
- char _pad[1];
-
- /** Active region that has mouse focus. */
- struct ARegion *active_region;
-
- /** If set, screen has timer handler added in window. */
- struct wmTimer *animtimer;
- /** Context callback. */
- void *context;
-
- /** Runtime. */
- struct wmTooltipState *tool_tip;
-
- PreviewImage *preview;
+ 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. */
+ ListBase vertbase;
+ ListBase edgebase;
+ ListBase areabase;
+
+ /** Screen level regions (menus), runtime only. */
+ ListBase regionbase;
+
+ struct Scene *scene DNA_DEPRECATED;
+
+ /** General flags. */
+ short flag;
+ /** Winid from WM, starts with 1. */
+ short winid;
+ /** User-setting for which editors get redrawn during anim playback. */
+ short redraws_flag;
+
+ /** Temp screen in a temp window, don't save (like user prefs). */
+ char temp;
+ /** Temp screen for image render display or fileselect. */
+ char state;
+ /** Notifier for drawing edges. */
+ char do_draw;
+ /** Notifier for scale screen, changed screen, etc. */
+ char do_refresh;
+ /** Notifier for gesture draw. */
+ char do_draw_gesture;
+ /** Notifier for paint cursor draw. */
+ char do_draw_paintcursor;
+ /** Notifier for dragging draw. */
+ char do_draw_drag;
+ /** Set to delay screen handling after switching back from maximized area. */
+ char skip_handling;
+ /** Set when scrubbing to avoid some costly updates. */
+ char scrubbing;
+ char _pad[1];
+
+ /** Active region that has mouse focus. */
+ struct ARegion *active_region;
+
+ /** If set, screen has timer handler added in window. */
+ struct wmTimer *animtimer;
+ /** Context callback. */
+ void *context;
+
+ /** Runtime. */
+ struct wmTooltipState *tool_tip;
+
+ PreviewImage *preview;
} bScreen;
typedef struct ScrVert {
- struct ScrVert *next, *prev, *newv;
- vec2s vec;
- /* first one used internally, second one for tools */
- short flag, editflag;
+ struct ScrVert *next, *prev, *newv;
+ vec2s vec;
+ /* first one used internally, second one for tools */
+ short flag, editflag;
} ScrVert;
typedef struct ScrEdge {
- struct ScrEdge *next, *prev;
- ScrVert *v1, *v2;
- /** 1 when at edge of screen. */
- short border;
- short flag;
- char _pad[4];
+ struct ScrEdge *next, *prev;
+ ScrVert *v1, *v2;
+ /** 1 when at edge of screen. */
+ short border;
+ short flag;
+ char _pad[4];
} ScrEdge;
typedef struct ScrAreaMap {
- /* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
-
- /** ScrVert - screens have vertices/edges to define areas. */
- ListBase vertbase;
- /** ScrEdge. */
- ListBase edgebase;
- /** ScrArea. */
- ListBase areabase;
+ /* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
+
+ /** ScrVert - screens have vertices/edges to define areas. */
+ ListBase vertbase;
+ /** ScrEdge. */
+ ListBase edgebase;
+ /** ScrArea. */
+ ListBase areabase;
} ScrAreaMap;
/** The part from uiBlock that needs saved in file. */
typedef struct Panel {
- struct Panel *next, *prev;
-
- /** Runtime. */
- struct PanelType *type;
- /** Runtime for drawing. */
- struct uiLayout *layout;
-
- /** Defined as UI_MAX_NAME_STR. */
- char panelname[64], tabname[64];
- /** Panel name is identifier for restoring location. */
- char drawname[64];
- /** Offset within the region. */
- int ofsx, ofsy;
- /** Panel size including children. */
- int sizex, sizey;
- /** Panel size excluding children. */
- int blocksizex, blocksizey;
- short labelofs;
- char _pad[2];
- short flag, runtime_flag;
- short control;
- short snap;
- /** Panels are aligned according to increasing sort-order. */
- int sortorder;
- /** This panel is tabbed in *paneltab. */
- struct Panel *paneltab;
- /** Runtime for panel manipulation. */
- void *activedata;
- /** Sub panels. */
- ListBase children;
+ struct Panel *next, *prev;
+
+ /** Runtime. */
+ struct PanelType *type;
+ /** Runtime for drawing. */
+ struct uiLayout *layout;
+
+ /** Defined as UI_MAX_NAME_STR. */
+ char panelname[64], tabname[64];
+ /** Panel name is identifier for restoring location. */
+ char drawname[64];
+ /** Offset within the region. */
+ int ofsx, ofsy;
+ /** Panel size including children. */
+ int sizex, sizey;
+ /** Panel size excluding children. */
+ int blocksizex, blocksizey;
+ short labelofs;
+ char _pad[2];
+ short flag, runtime_flag;
+ short control;
+ short snap;
+ /** Panels are aligned according to increasing sort-order. */
+ int sortorder;
+ /** This panel is tabbed in *paneltab. */
+ struct Panel *paneltab;
+ /** Runtime for panel manipulation. */
+ void *activedata;
+ /** Sub panels. */
+ ListBase children;
} Panel;
-
/**
* Notes on Panel Categories:
*
@@ -183,96 +181,95 @@ typedef struct Panel {
#
#
typedef struct PanelCategoryDyn {
- struct PanelCategoryDyn *next, *prev;
- char idname[64];
- rcti rect;
+ struct PanelCategoryDyn *next, *prev;
+ char idname[64];
+ rcti rect;
} PanelCategoryDyn;
/* region stack of active tabs */
typedef struct PanelCategoryStack {
- struct PanelCategoryStack *next, *prev;
- char idname[64];
+ struct PanelCategoryStack *next, *prev;
+ char idname[64];
} PanelCategoryStack;
-
/* uiList dynamic data... */
/* These two Lines with # tell makesdna this struct can be excluded. */
#
#
typedef struct uiListDyn {
- /** Number of rows needed to draw all elements. */
- int height;
- /** Actual visual height of the list (in rows). */
- int visual_height;
- /** Minimal visual height of the list (in rows). */
- int visual_height_min;
-
- /** Number of items in collection. */
- int items_len;
- /** Number of items actually visible after filtering. */
- int items_shown;
-
- /* 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;
- int resize_prev;
-
- /* Filtering data. */
- /** Items_len length. */
- int *items_filter_flags;
- /** Org_idx -> new_idx, items_len length. */
- int *items_filter_neworder;
+ /** Number of rows needed to draw all elements. */
+ int height;
+ /** Actual visual height of the list (in rows). */
+ int visual_height;
+ /** Minimal visual height of the list (in rows). */
+ int visual_height_min;
+
+ /** Number of items in collection. */
+ int items_len;
+ /** Number of items actually visible after filtering. */
+ int items_shown;
+
+ /* 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;
+ int resize_prev;
+
+ /* Filtering data. */
+ /** Items_len length. */
+ int *items_filter_flags;
+ /** Org_idx -> new_idx, items_len length. */
+ int *items_filter_neworder;
} uiListDyn;
-typedef struct uiList { /* some list UI data need to be saved in file */
- struct uiList *next, *prev;
+typedef struct uiList { /* some list UI data need to be saved in file */
+ struct uiList *next, *prev;
- /** Runtime. */
- struct uiListType *type;
+ /** Runtime. */
+ struct uiListType *type;
- /** Defined as UI_MAX_NAME_STR. */
- char list_id[64];
+ /** Defined as UI_MAX_NAME_STR. */
+ char list_id[64];
- /** How items are layedout in the list. */
- int layout_type;
- int flag;
+ /** How items are layedout in the list. */
+ int layout_type;
+ int flag;
- int list_scroll;
- int list_grip;
- int list_last_len;
- int list_last_activei;
+ int list_scroll;
+ int list_grip;
+ int list_last_len;
+ int list_last_activei;
- /* Filtering data. */
- /** Defined as UI_MAX_NAME_STR. */
- char filter_byname[64];
- int filter_flag;
- int filter_sort_flag;
+ /* Filtering data. */
+ /** Defined as UI_MAX_NAME_STR. */
+ char filter_byname[64];
+ int filter_flag;
+ int filter_sort_flag;
- /* Custom sub-classes properties. */
- IDProperty *properties;
+ /* Custom sub-classes properties. */
+ IDProperty *properties;
- /* Dynamic data (runtime). */
- uiListDyn *dyn_data;
+ /* Dynamic data (runtime). */
+ uiListDyn *dyn_data;
} uiList;
typedef struct TransformOrientation {
- struct TransformOrientation *next, *prev;
- /** MAX_NAME. */
- char name[64];
- float mat[3][3];
- char _pad[4];
+ struct TransformOrientation *next, *prev;
+ /** MAX_NAME. */
+ char name[64];
+ float mat[3][3];
+ char _pad[4];
} TransformOrientation;
/** Some preview UI data need to be saved in file. */
typedef struct uiPreview {
- struct uiPreview *next, *prev;
+ struct uiPreview *next, *prev;
- /** Defined as UI_MAX_NAME_STR. */
- char preview_id[64];
- short height;
- char _pad1[6];
+ /** Defined as UI_MAX_NAME_STR. */
+ char preview_id[64];
+ short height;
+ char _pad1[6];
} uiPreview;
/* These two lines with # tell makesdna this struct can be excluded.
@@ -280,268 +277,267 @@ typedef struct uiPreview {
#
#
typedef 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;
- /* For global areas, this is the min and max size they can use depending on
- * if they are 'collapsed' or not. */
- short size_min, size_max;
- /** GlobalAreaAlign. */
- short align;
-
- /** GlobalAreaFlag. */
- short flag;
- char _pad[2];
+ /* 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;
+ /* For global areas, this is the min and max size they can use depending on
+ * if they are 'collapsed' or not. */
+ short size_min, size_max;
+ /** GlobalAreaAlign. */
+ short align;
+
+ /** GlobalAreaFlag. */
+ short flag;
+ char _pad[2];
} ScrGlobalAreaData;
enum GlobalAreaFlag {
- GLOBAL_AREA_IS_HIDDEN = (1 << 0),
+ GLOBAL_AREA_IS_HIDDEN = (1 << 0),
};
typedef enum GlobalAreaAlign {
- GLOBAL_AREA_ALIGN_TOP,
- GLOBAL_AREA_ALIGN_BOTTOM,
+ GLOBAL_AREA_ALIGN_TOP,
+ GLOBAL_AREA_ALIGN_BOTTOM,
} GlobalAreaAlign;
typedef struct ScrArea_Runtime {
- struct bToolRef *tool;
- char is_tool_set;
- char _pad0[7];
+ struct bToolRef *tool;
+ char is_tool_set;
+ char _pad0[7];
} ScrArea_Runtime;
typedef struct ScrArea {
- struct ScrArea *next, *prev;
-
- /** Ordered (bl, tl, tr, br). */
- ScrVert *v1, *v2, *v3, *v4;
- /** If area==full, this is the parent. */
- bScreen *full;
-
- /** Rect bound by v1 v2 v3 v4. */
- rcti totrct;
-
- /**
- * 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 spacetype;
- /** #eSpace_Type (SPACE_FOO). */
- char butspacetype;
- short butspacetype_subtype;
-
- /** Size. */
- short winx, winy;
-
- /** OLD! 0=no header, 1= down, 2= up. */
- char headertype DNA_DEPRECATED;
- /** Private, for spacetype refresh callback. */
- char do_refresh;
- short flag;
- /**
- * Index of last used region of 'RGN_TYPE_WINDOW'
- * runtime variable, updated by executing operators.
- */
- short region_active_win;
- char temp, _pad;
-
- /** Callbacks for this space type. */
- struct SpaceType *type;
-
- /* Non-NULL if this area is global. */
- ScrGlobalAreaData *global;
-
- /* 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.
- */
- /** #SpaceLink. */
- ListBase spacedata;
- /* 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)!
- */
- /** #ARegion. */
- ListBase regionbase;
- /** #wmEventHandler. */
- ListBase handlers;
-
- /** #AZone. */
- ListBase actionzones;
-
- ScrArea_Runtime runtime;
+ struct ScrArea *next, *prev;
+
+ /** Ordered (bl, tl, tr, br). */
+ ScrVert *v1, *v2, *v3, *v4;
+ /** If area==full, this is the parent. */
+ bScreen *full;
+
+ /** Rect bound by v1 v2 v3 v4. */
+ rcti totrct;
+
+ /**
+ * 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 spacetype;
+ /** #eSpace_Type (SPACE_FOO). */
+ char butspacetype;
+ short butspacetype_subtype;
+
+ /** Size. */
+ short winx, winy;
+
+ /** OLD! 0=no header, 1= down, 2= up. */
+ char headertype DNA_DEPRECATED;
+ /** Private, for spacetype refresh callback. */
+ char do_refresh;
+ short flag;
+ /**
+ * Index of last used region of 'RGN_TYPE_WINDOW'
+ * runtime variable, updated by executing operators.
+ */
+ short region_active_win;
+ char temp, _pad;
+
+ /** Callbacks for this space type. */
+ struct SpaceType *type;
+
+ /* Non-NULL if this area is global. */
+ ScrGlobalAreaData *global;
+
+ /* 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.
+ */
+ /** #SpaceLink. */
+ ListBase spacedata;
+ /* 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)!
+ */
+ /** #ARegion. */
+ ListBase regionbase;
+ /** #wmEventHandler. */
+ ListBase handlers;
+
+ /** #AZone. */
+ ListBase actionzones;
+
+ ScrArea_Runtime runtime;
} ScrArea;
-
typedef struct ARegion_Runtime {
- /* Panel category to use between 'layout' and 'draw'. */
- const char *category;
+ /* Panel category to use between 'layout' and 'draw'. */
+ const char *category;
} ARegion_Runtime;
typedef struct ARegion {
- struct ARegion *next, *prev;
-
- /** 2D-View scrolling/zoom info (most regions are 2d anyways). */
- View2D v2d;
- /** Coordinates of region. */
- rcti winrct;
- /** Runtime for partial redraw, same or smaller than winrct. */
- rcti drawrct;
- /** Size. */
- short winx, winy;
-
- /** Region is currently visible on screen. */
- short visible;
- /** Window, header, etc. identifier for drawing. */
- short regiontype;
- /** How it should split. */
- short alignment;
- /** Hide, .... */
- short flag;
-
- /** Current split size in unscaled pixels (if zero it uses regiontype).
- * To convert to pixels use: `UI_DPI_FAC * ar->sizex + 0.5f`. */
- short sizex, sizey;
-
- /** Private, cached notifier events. */
- short do_draw;
- /** Private, cached notifier events. */
- short do_draw_overlay;
- /** Private, set for indicate drawing overlapped. */
- short overlap;
- /** Temporary copy of flag settings for clean fullscreen. */
- short flagfullscreen;
-
- /** Callbacks for this region type. */
- struct ARegionType *type;
-
- /** #uiBlock. */
- ListBase uiblocks;
- /** Panel. */
- ListBase panels;
- /** Stack of panel categories. */
- ListBase panels_category_active;
- /** #uiList. */
- ListBase ui_lists;
- /** #uiPreview. */
- ListBase ui_previews;
- /** #wmEventHandler. */
- ListBase handlers;
- /** Panel categories runtime. */
- ListBase panels_category;
-
- /** Gizmo-map of this region. */
- struct wmGizmoMap *gizmo_map;
- /** Blend in/out. */
- struct wmTimer *regiontimer;
- struct wmDrawBuffer *draw_buffer;
-
- /** Use this string to draw info. */
- char *headerstr;
- /** XXX 2.50, need spacedata equivalent?. */
- void *regiondata;
-
- ARegion_Runtime runtime;
+ struct ARegion *next, *prev;
+
+ /** 2D-View scrolling/zoom info (most regions are 2d anyways). */
+ View2D v2d;
+ /** Coordinates of region. */
+ rcti winrct;
+ /** Runtime for partial redraw, same or smaller than winrct. */
+ rcti drawrct;
+ /** Size. */
+ short winx, winy;
+
+ /** Region is currently visible on screen. */
+ short visible;
+ /** Window, header, etc. identifier for drawing. */
+ short regiontype;
+ /** How it should split. */
+ short alignment;
+ /** Hide, .... */
+ short flag;
+
+ /** Current split size in unscaled pixels (if zero it uses regiontype).
+ * To convert to pixels use: `UI_DPI_FAC * ar->sizex + 0.5f`. */
+ short sizex, sizey;
+
+ /** Private, cached notifier events. */
+ short do_draw;
+ /** Private, cached notifier events. */
+ short do_draw_overlay;
+ /** Private, set for indicate drawing overlapped. */
+ short overlap;
+ /** Temporary copy of flag settings for clean fullscreen. */
+ short flagfullscreen;
+
+ /** Callbacks for this region type. */
+ struct ARegionType *type;
+
+ /** #uiBlock. */
+ ListBase uiblocks;
+ /** Panel. */
+ ListBase panels;
+ /** Stack of panel categories. */
+ ListBase panels_category_active;
+ /** #uiList. */
+ ListBase ui_lists;
+ /** #uiPreview. */
+ ListBase ui_previews;
+ /** #wmEventHandler. */
+ ListBase handlers;
+ /** Panel categories runtime. */
+ ListBase panels_category;
+
+ /** Gizmo-map of this region. */
+ struct wmGizmoMap *gizmo_map;
+ /** Blend in/out. */
+ struct wmTimer *regiontimer;
+ struct wmDrawBuffer *draw_buffer;
+
+ /** Use this string to draw info. */
+ char *headerstr;
+ /** XXX 2.50, need spacedata equivalent?. */
+ void *regiondata;
+
+ ARegion_Runtime runtime;
} ARegion;
/** #ScrArea.flag */
enum {
- HEADER_NO_PULLDOWN = (1 << 0),
-// AREA_FLAG_UNUSED_1 = (1 << 1),
-// AREA_FLAG_UNUSED_2 = (1 << 2),
+ 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 */
+ 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),
- /* used to check if we should switch back to prevspace (of a different type) */
- AREA_FLAG_TEMP_TYPE = (1 << 6),
- /* for temporary fullscreens (file browser, image editor render)
- * that are opened above user set fullscreens */
- AREA_FLAG_STACKED_FULLSCREEN = (1 << 7),
- /* update action zones (even if the mouse is not intersecting them) */
- AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8),
+ /* 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),
+ /* used to check if we should switch back to prevspace (of a different type) */
+ AREA_FLAG_TEMP_TYPE = (1 << 6),
+ /* for temporary fullscreens (file browser, image editor render)
+ * that are opened above user set fullscreens */
+ AREA_FLAG_STACKED_FULLSCREEN = (1 << 7),
+ /* update action zones (even if the mouse is not intersecting them) */
+ AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8),
};
-#define AREAGRID 4
-#define AREAMINX 32
-#define HEADER_PADDING_Y 6
-#define HEADERY (20 + HEADER_PADDING_Y)
+#define AREAGRID 4
+#define AREAMINX 32
+#define HEADER_PADDING_Y 6
+#define HEADERY (20 + HEADER_PADDING_Y)
/** #bScreen.flag */
enum {
- SCREEN_COLLAPSE_TOPBAR = 1,
- SCREEN_COLLAPSE_STATUSBAR = 2,
+ SCREEN_COLLAPSE_TOPBAR = 1,
+ SCREEN_COLLAPSE_STATUSBAR = 2,
};
/** #bScreen.state */
enum {
- SCREENNORMAL = 0,
- SCREENMAXIMIZED = 1, /* one editor taking over the screen */
- SCREENFULL = 2, /* one editor taking over the screen with no bare-minimum UI elements */
+ SCREENNORMAL = 0,
+ SCREENMAXIMIZED = 1, /* one editor taking over the screen */
+ SCREENFULL = 2, /* one editor taking over the screen with no bare-minimum UI elements */
};
/** #bScreen.redraws_flag */
typedef enum eScreen_Redraws_Flag {
- 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_FOLLOW = (1 << 15),
+ 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_FOLLOW = (1 << 15),
} eScreen_Redraws_Flag;
/** #Panel.flag */
enum {
- PNL_SELECT = (1 << 0),
- PNL_CLOSEDX = (1 << 1),
- PNL_CLOSEDY = (1 << 2),
- PNL_CLOSED = (PNL_CLOSEDX | PNL_CLOSEDY),
- /*PNL_TABBED = (1 << 3), */ /*UNUSED*/
- PNL_OVERLAP = (1 << 4),
- PNL_PIN = (1 << 5),
- PNL_POPOVER = (1 << 6),
+ PNL_SELECT = (1 << 0),
+ PNL_CLOSEDX = (1 << 1),
+ PNL_CLOSEDY = (1 << 2),
+ PNL_CLOSED = (PNL_CLOSEDX | PNL_CLOSEDY),
+ /*PNL_TABBED = (1 << 3), */ /*UNUSED*/
+ PNL_OVERLAP = (1 << 4),
+ PNL_PIN = (1 << 5),
+ PNL_POPOVER = (1 << 6),
};
/** #Panel.snap - for snapping to screen edges */
-#define PNL_SNAP_NONE 0
-/* #define PNL_SNAP_TOP 1 */
-/* #define PNL_SNAP_RIGHT 2 */
-#define PNL_SNAP_BOTTOM 4
-/* #define PNL_SNAP_LEFT 8 */
+#define PNL_SNAP_NONE 0
+/* #define PNL_SNAP_TOP 1 */
+/* #define PNL_SNAP_RIGHT 2 */
+#define PNL_SNAP_BOTTOM 4
+/* #define PNL_SNAP_LEFT 8 */
-/* #define PNL_SNAP_DIST 9.0 */
+/* #define PNL_SNAP_DIST 9.0 */
/* paneltype flag */
-#define PNL_DEFAULT_CLOSED 1
-#define PNL_NO_HEADER 2
-#define PNL_LAYOUT_VERT_BAR 4
+#define PNL_DEFAULT_CLOSED 1
+#define PNL_NO_HEADER 2
+#define PNL_LAYOUT_VERT_BAR 4
/* Fallback panel category (only for old scripts which need updating) */
#define PNL_CATEGORY_FALLBACK "Misc"
/** #uiList.layout_type */
enum {
- UILST_LAYOUT_DEFAULT = 0,
- UILST_LAYOUT_COMPACT = 1,
- UILST_LAYOUT_GRID = 2,
+ UILST_LAYOUT_DEFAULT = 0,
+ UILST_LAYOUT_COMPACT = 1,
+ UILST_LAYOUT_GRID = 2,
};
/** #uiList.flag */
enum {
- /* Scroll list to make active item visible. */
- UILST_SCROLL_TO_ACTIVE_ITEM = 1 << 0,
+ /* Scroll list to make active item visible. */
+ UILST_SCROLL_TO_ACTIVE_ITEM = 1 << 0,
};
/* Value (in number of items) we have to go below minimum shown items to enable auto size. */
@@ -551,27 +547,27 @@ enum {
/* 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 {
- UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
+ UILST_FLT_ITEM = 1 << 30, /* This item has passed the filter process successfully. */
};
/** #uiList.filter_flag */
enum {
- UILST_FLT_SHOW = 1 << 0, /* Show filtering UI. */
- UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */
+ UILST_FLT_SHOW = 1 << 0, /* Show filtering UI. */
+ UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */
};
/** #uiList.filter_sort_flag */
enum {
- /* 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,
- 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 = 1u << 30,
- /** Special value, bitflag used to reverse order! */
- UILST_FLT_SORT_REVERSE = 1u << 31,
+ /* 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,
+ 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 = 1u << 30,
+ /** Special value, bitflag used to reverse order! */
+ UILST_FLT_SORT_REVERSE = 1u << 31,
};
#define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1)
@@ -579,20 +575,20 @@ enum {
/* regiontype, first two are the default set */
/* Do NOT change order, append on end. Types are hardcoded needed */
enum {
- 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_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,
};
/* use for function args */
#define RGN_TYPE_ANY -1
@@ -601,41 +597,41 @@ enum {
#define RGN_TYPE_HAS_CATEGORY_MASK (1 << RGN_TYPE_UI)
/* region alignment */
-#define RGN_ALIGN_NONE 0
-#define RGN_ALIGN_TOP 1
-#define RGN_ALIGN_BOTTOM 2
-#define RGN_ALIGN_LEFT 3
-#define RGN_ALIGN_RIGHT 4
-#define RGN_ALIGN_HSPLIT 5
-#define RGN_ALIGN_VSPLIT 6
-#define RGN_ALIGN_FLOAT 7
-#define RGN_ALIGN_QSPLIT 8
+#define RGN_ALIGN_NONE 0
+#define RGN_ALIGN_TOP 1
+#define RGN_ALIGN_BOTTOM 2
+#define RGN_ALIGN_LEFT 3
+#define RGN_ALIGN_RIGHT 4
+#define RGN_ALIGN_HSPLIT 5
+#define RGN_ALIGN_VSPLIT 6
+#define RGN_ALIGN_FLOAT 7
+#define RGN_ALIGN_QSPLIT 8
#define RGN_ALIGN_ENUM_MASK 0x0F
-#define RGN_SPLIT_PREV 32
+#define RGN_SPLIT_PREV 32
/** #ARegion.flag */
enum {
- RGN_FLAG_HIDDEN = (1 << 0),
- RGN_FLAG_TOO_SMALL = (1 << 1),
- /* Force delayed reinit of region size data, so that region size is calculated
- * just big enough to show all its content (if enough space is available).
- * Note that only ED_region_header supports this right now. */
- RGN_FLAG_DYNAMIC_SIZE = (1 << 2),
- /* Region data is NULL'd on read, never written. */
- RGN_FLAG_TEMP_REGIONDATA = (1 << 3),
- /* The region must either use its prefsizex/y or be hidden. */
- RGN_FLAG_PREFSIZE_OR_HIDDEN = (1 << 4),
- /** Size has been clamped (floating regions only). */
- RGN_FLAG_SIZE_CLAMP_X = (1 << 5),
- RGN_FLAG_SIZE_CLAMP_Y = (1 << 6),
+ RGN_FLAG_HIDDEN = (1 << 0),
+ RGN_FLAG_TOO_SMALL = (1 << 1),
+ /* Force delayed reinit of region size data, so that region size is calculated
+ * just big enough to show all its content (if enough space is available).
+ * Note that only ED_region_header supports this right now. */
+ RGN_FLAG_DYNAMIC_SIZE = (1 << 2),
+ /* Region data is NULL'd on read, never written. */
+ RGN_FLAG_TEMP_REGIONDATA = (1 << 3),
+ /* The region must either use its prefsizex/y or be hidden. */
+ RGN_FLAG_PREFSIZE_OR_HIDDEN = (1 << 4),
+ /** Size has been clamped (floating regions only). */
+ RGN_FLAG_SIZE_CLAMP_X = (1 << 5),
+ RGN_FLAG_SIZE_CLAMP_Y = (1 << 6),
};
/** #ARegion.do_draw */
-#define RGN_DRAW 1
-#define RGN_DRAW_PARTIAL 2
-#define RGN_DRAWING 4
-#define RGN_DRAW_REFRESH_UI 8 /* re-create uiBlock's where possible */
-#define RGN_DRAW_NO_REBUILD 16
+#define RGN_DRAW 1
+#define RGN_DRAW_PARTIAL 2
+#define RGN_DRAWING 4
+#define RGN_DRAW_REFRESH_UI 8 /* re-create uiBlock's where possible */
+#define RGN_DRAW_NO_REBUILD 16
-#endif /* __DNA_SCREEN_TYPES_H__ */
+#endif /* __DNA_SCREEN_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h
index bf7a8193246..01e74da4e3b 100644
--- a/source/blender/makesdna/DNA_sdna_types.h
+++ b/source/blender/makesdna/DNA_sdna_types.h
@@ -28,75 +28,75 @@ struct MemArena;
#
#
typedef struct SDNA {
- /** Full copy of 'encoded' data (when data_alloc is set, otherwise borrowed). */
- const char *data;
- /** Length of data. */
- int data_len;
- bool data_alloc;
+ /** Full copy of 'encoded' data (when data_alloc is set, otherwise borrowed). */
+ const char *data;
+ /** Length of data. */
+ int data_len;
+ bool data_alloc;
- /** Total number of struct members. */
- int nr_names, nr_names_alloc;
- /** Struct member names. */
- const char **names;
- /** Result of #DNA_elem_array_size (aligned with #names). */
- short *names_array_len;
+ /** Total number of struct members. */
+ int nr_names, nr_names_alloc;
+ /** Struct member names. */
+ const char **names;
+ /** Result of #DNA_elem_array_size (aligned with #names). */
+ short *names_array_len;
- /** Size of a pointer in bytes. */
- int pointer_size;
+ /** Size of a pointer in bytes. */
+ int pointer_size;
- /** Number of basic types + struct types. */
- int nr_types;
- /** Type names. */
- const char **types;
- /** Type lengths. */
- short *types_size;
+ /** Number of basic types + struct types. */
+ int nr_types;
+ /** Type names. */
+ const char **types;
+ /** Type lengths. */
+ short *types_size;
- /** Number of struct types. */
- int nr_structs;
- /**
- * sp = structs[a] is the address of a struct definition
- * sp[0] is struct type number, sp[1] amount of members
- *
- * (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
- * type and name numbers respectively.
- */
- short **structs;
+ /** Number of struct types. */
+ int nr_structs;
+ /**
+ * sp = structs[a] is the address of a struct definition
+ * sp[0] is struct type number, sp[1] amount of members
+ *
+ * (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
+ * type and name numbers respectively.
+ */
+ short **structs;
- /** #GHash for faster lookups, requires WITH_DNA_GHASH to be used for now. */
- struct GHash *structs_map;
+ /** #GHash for faster lookups, requires WITH_DNA_GHASH to be used for now. */
+ struct GHash *structs_map;
- /** Temporary memory currently only used for version patching DNA. */
- struct MemArena *mem_arena;
- /** Runtime versions of data stored in DNA, lazy initialized,
- * only different when renaming is done. */
- struct {
- /** Aligned with #SDNA.names, same pointers when unchanged. */
- const char **names;
- /** Aligned with #SDNA.types, same pointers when unchanged. */
- const char **types;
- } alias;
+ /** Temporary memory currently only used for version patching DNA. */
+ struct MemArena *mem_arena;
+ /** Runtime versions of data stored in DNA, lazy initialized,
+ * only different when renaming is done. */
+ struct {
+ /** Aligned with #SDNA.names, same pointers when unchanged. */
+ const char **names;
+ /** Aligned with #SDNA.types, same pointers when unchanged. */
+ const char **types;
+ } alias;
} SDNA;
#
#
typedef struct BHead {
- int code, len;
- const void *old;
- int SDNAnr, nr;
+ int code, len;
+ const void *old;
+ int SDNAnr, nr;
} BHead;
#
#
typedef struct BHead4 {
- int code, len;
- int old;
- int SDNAnr, nr;
+ int code, len;
+ int old;
+ int SDNAnr, nr;
} BHead4;
#
#
typedef struct BHead8 {
- int code, len;
- int64_t old;
- int SDNAnr, nr;
+ int code, len;
+ int64_t old;
+ int SDNAnr, nr;
} BHead8;
#endif
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 1593ceb9063..ba3dee405ad 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -45,74 +45,74 @@ struct bSound;
/* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
typedef struct StripAnim {
- struct StripAnim *next, *prev;
- struct anim *anim;
+ struct StripAnim *next, *prev;
+ struct anim *anim;
} StripAnim;
typedef struct StripElem {
- char name[256];
- int orig_width, orig_height;
+ char name[256];
+ int orig_width, orig_height;
} StripElem;
typedef struct StripCrop {
- int top;
- int bottom;
- int left;
- int right;
+ int top;
+ int bottom;
+ int left;
+ int right;
} StripCrop;
typedef struct StripTransform {
- int xofs;
- int yofs;
+ int xofs;
+ int yofs;
} StripTransform;
typedef struct StripColorBalance {
- float lift[3];
- float gamma[3];
- float gain[3];
- int flag;
- char _pad[4];
- // float exposure;
- // float saturation;
+ float lift[3];
+ float gamma[3];
+ float gain[3];
+ int flag;
+ char _pad[4];
+ // float exposure;
+ // float saturation;
} StripColorBalance;
typedef struct StripProxy {
- char dir[768]; // custom directory for index and proxy files
- // (defaults to BL_proxy)
-
- char file[256]; // custom file
- struct anim *anim; // custom proxy anim file
-
- short tc; // time code in use
-
- short quality; // proxy build quality
- short build_size_flags; // size flags (see below) of all proxies
- // to build
- short build_tc_flags; // time code flags (see below) of all tc indices
- // to build
- short build_flags;
- char storage;
- char _pad[5];
+ char dir[768]; // custom directory for index and proxy files
+ // (defaults to BL_proxy)
+
+ char file[256]; // custom file
+ struct anim *anim; // custom proxy anim file
+
+ short tc; // time code in use
+
+ short quality; // proxy build quality
+ short build_size_flags; // size flags (see below) of all proxies
+ // to build
+ short build_tc_flags; // time code flags (see below) of all tc indices
+ // to build
+ short build_flags;
+ char storage;
+ char _pad[5];
} StripProxy;
typedef struct Strip {
- struct Strip *next, *prev;
- int us, done;
- int startstill, endstill;
- /**
- * Only used as an array in IMAGE sequences(!),
- * and as a 1-element array in MOVIE sequences,
- * NULL for all other strip-types.
- */
- StripElem *stripdata;
- char dir[768];
- StripProxy *proxy;
- StripCrop *crop;
- StripTransform *transform;
- StripColorBalance *color_balance DNA_DEPRECATED;
-
- /* color management */
- ColorManagedColorspaceSettings colorspace_settings;
+ struct Strip *next, *prev;
+ int us, done;
+ int startstill, endstill;
+ /**
+ * Only used as an array in IMAGE sequences(!),
+ * and as a 1-element array in MOVIE sequences,
+ * NULL for all other strip-types.
+ */
+ StripElem *stripdata;
+ char dir[768];
+ StripProxy *proxy;
+ StripCrop *crop;
+ StripTransform *transform;
+ StripColorBalance *color_balance DNA_DEPRECATED;
+
+ /* color management */
+ ColorManagedColorspaceSettings colorspace_settings;
} Strip;
/**
@@ -126,383 +126,382 @@ typedef struct Strip {
* \warning This is really a 'Strip' in the UI!, name is highly confusing.
*/
typedef struct Sequence {
- struct Sequence *next, *prev;
- /** Tmp var for copying, and tagging for linked selection. */
- void *tmp;
- /** Needed (to be like ipo), else it will raise libdata warnings, this should never be used. */
- void *lib;
- /** SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths. */
- char name[64];
-
- /**fLags bitmap (see below) and the type of sequenc.e*/
- int flag, type;
- /** The length of the contents of this strip - before handles are applied. */
- int len;
- /**
- * Start frame of contents of strip in absolute frame coordinates.
- * For metastrips start of first strip startdisp.
- */
- int start;
- /**
- * Frames after the first frame where display starts,
- * frames before the last frame where display ends.
- */
- int startofs, endofs;
- /**
- * Frames that use the first frame before data begins,
- * frames that use the last frame after data ends.
- */
- int startstill, endstill;
- /** Machine: the strip channel, depth the depth in the sequence when dealing with metastrips. */
- int machine, depth;
- /** Starting and ending points of the strip in the sequenc.e*/
- int startdisp, enddisp;
- float sat;
- float mul, handsize;
-
- short anim_preseek;
- /** Streamindex for movie or sound files with several streams. */
- short streamindex;
- /** For multicam source selection. */
- int multicam_source;
- /** MOVIECLIP render flags. */
- int clip_flag;
-
- Strip *strip;
-
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
-
- /** these ID vars should never be NULL but can be when linked libs fail to load,
- * so check on access */
- struct Scene *scene;
- /** Override scene camera. */
- struct Object *scene_camera;
- /** For MOVIECLIP strips. */
- struct MovieClip *clip;
- /** For MASK strips. */
- struct Mask *mask;
- /** For MOVIE strips. */
- ListBase anims;
-
- float effect_fader;
- float speed_fader;
-
- /* pointers for effects: */
- struct Sequence *seq1, *seq2, *seq3;
-
- /** List of strips for metastrips. */
- ListBase seqbase;
-
- /** The linked "bSound" object. */
- struct bSound *sound;
- void *scene_sound;
- float volume;
-
- /** Pitch (-0.1..10), pan -2..2. */
- float pitch, pan;
- float strobe;
-
- /** Struct pointer for effect settings. */
- void *effectdata;
-
- /** Only use part of animation file. */
- int anim_startofs;
- /** Is subtle different to startofs / endofs. */
- int anim_endofs;
-
-
- int blend_mode;
- float blend_opacity;
-
- /* is sfra needed anymore? - it looks like its only used in one place */
- /** Starting frame according to the timeline of the scene. */
- int sfra;
-
- char alpha_mode;
- char _pad[2];
-
- /* Multiview */
- char views_format;
- struct Stereo3dFormat *stereo3d_format;
-
- struct IDProperty *prop;
-
- /* modifiers */
- ListBase modifiers;
+ struct Sequence *next, *prev;
+ /** Tmp var for copying, and tagging for linked selection. */
+ void *tmp;
+ /** Needed (to be like ipo), else it will raise libdata warnings, this should never be used. */
+ void *lib;
+ /** SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths. */
+ char name[64];
+
+ /**fLags bitmap (see below) and the type of sequenc.e*/
+ int flag, type;
+ /** The length of the contents of this strip - before handles are applied. */
+ int len;
+ /**
+ * Start frame of contents of strip in absolute frame coordinates.
+ * For metastrips start of first strip startdisp.
+ */
+ int start;
+ /**
+ * Frames after the first frame where display starts,
+ * frames before the last frame where display ends.
+ */
+ int startofs, endofs;
+ /**
+ * Frames that use the first frame before data begins,
+ * frames that use the last frame after data ends.
+ */
+ int startstill, endstill;
+ /** Machine: the strip channel, depth the depth in the sequence when dealing with metastrips. */
+ int machine, depth;
+ /** Starting and ending points of the strip in the sequenc.e*/
+ int startdisp, enddisp;
+ float sat;
+ float mul, handsize;
+
+ short anim_preseek;
+ /** Streamindex for movie or sound files with several streams. */
+ short streamindex;
+ /** For multicam source selection. */
+ int multicam_source;
+ /** MOVIECLIP render flags. */
+ int clip_flag;
+
+ Strip *strip;
+
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+
+ /** these ID vars should never be NULL but can be when linked libs fail to load,
+ * so check on access */
+ struct Scene *scene;
+ /** Override scene camera. */
+ struct Object *scene_camera;
+ /** For MOVIECLIP strips. */
+ struct MovieClip *clip;
+ /** For MASK strips. */
+ struct Mask *mask;
+ /** For MOVIE strips. */
+ ListBase anims;
+
+ float effect_fader;
+ float speed_fader;
+
+ /* pointers for effects: */
+ struct Sequence *seq1, *seq2, *seq3;
+
+ /** List of strips for metastrips. */
+ ListBase seqbase;
+
+ /** The linked "bSound" object. */
+ struct bSound *sound;
+ void *scene_sound;
+ float volume;
+
+ /** Pitch (-0.1..10), pan -2..2. */
+ float pitch, pan;
+ float strobe;
+
+ /** Struct pointer for effect settings. */
+ void *effectdata;
+
+ /** Only use part of animation file. */
+ int anim_startofs;
+ /** Is subtle different to startofs / endofs. */
+ int anim_endofs;
+
+ int blend_mode;
+ float blend_opacity;
+
+ /* is sfra needed anymore? - it looks like its only used in one place */
+ /** Starting frame according to the timeline of the scene. */
+ int sfra;
+
+ char alpha_mode;
+ char _pad[2];
+
+ /* Multiview */
+ char views_format;
+ struct Stereo3dFormat *stereo3d_format;
+
+ struct IDProperty *prop;
+
+ /* modifiers */
+ ListBase modifiers;
} Sequence;
typedef struct MetaStack {
- struct MetaStack *next, *prev;
- ListBase *oldbasep;
- Sequence *parseq;
- /* the startdisp/enddisp when entering the meta */
- int disp_range[2];
+ struct MetaStack *next, *prev;
+ ListBase *oldbasep;
+ Sequence *parseq;
+ /* the startdisp/enddisp when entering the meta */
+ int disp_range[2];
} MetaStack;
typedef struct Editing {
- /** Pointer to the current list of seq's being edited (can be within a meta strip). */
- ListBase *seqbasep;
- /** Pointer to the top-most seq's. */
- ListBase seqbase;
- ListBase metastack;
-
- /* Context vars, used to be static */
- Sequence *act_seq;
- /** 1024 = FILE_MAX. */
- char act_imagedir[1024];
- /** 1024 = FILE_MAX. */
- char act_sounddir[1024];
- /** 1024 = FILE_MAX. */
- char proxy_dir[1024];
-
- int over_ofs, over_cfra;
- int over_flag, proxy_storage;
- rctf over_border;
+ /** Pointer to the current list of seq's being edited (can be within a meta strip). */
+ ListBase *seqbasep;
+ /** Pointer to the top-most seq's. */
+ ListBase seqbase;
+ ListBase metastack;
+
+ /* Context vars, used to be static */
+ Sequence *act_seq;
+ /** 1024 = FILE_MAX. */
+ char act_imagedir[1024];
+ /** 1024 = FILE_MAX. */
+ char act_sounddir[1024];
+ /** 1024 = FILE_MAX. */
+ char proxy_dir[1024];
+
+ int over_ofs, over_cfra;
+ int over_flag, proxy_storage;
+ rctf over_border;
} Editing;
/* ************* Effect Variable Structs ********* */
typedef struct WipeVars {
- float edgeWidth, angle;
- short forward, wipetype;
+ float edgeWidth, angle;
+ short forward, wipetype;
} WipeVars;
typedef struct GlowVars {
- /** Minimum intensity to trigger a glow. */
- float fMini;
- float fClamp;
- /** Amount to multiply glow intensity. */
- float fBoost;
- /** Radius of glow blurring. */
- float dDist;
- int dQuality;
- /** SHOW/HIDE glow buffer. */
- int bNoComp;
+ /** Minimum intensity to trigger a glow. */
+ float fMini;
+ float fClamp;
+ /** Amount to multiply glow intensity. */
+ float fBoost;
+ /** Radius of glow blurring. */
+ float dDist;
+ int dQuality;
+ /** SHOW/HIDE glow buffer. */
+ int bNoComp;
} GlowVars;
typedef struct TransformVars {
- float ScalexIni;
- float ScaleyIni;
- float xIni;
- float yIni;
- float rotIni;
- int percent;
- int interpolation;
- /** Preserve aspect/ratio when scaling. */
- int uniform_scale;
+ float ScalexIni;
+ float ScaleyIni;
+ float xIni;
+ float yIni;
+ float rotIni;
+ int percent;
+ int interpolation;
+ /** Preserve aspect/ratio when scaling. */
+ int uniform_scale;
} TransformVars;
typedef struct SolidColorVars {
- float col[3];
- char _pad[4];
+ float col[3];
+ char _pad[4];
} SolidColorVars;
typedef struct SpeedControlVars {
- float *frameMap;
- float globalSpeed;
- int flags;
- int length;
- int lastValidFrame;
+ float *frameMap;
+ float globalSpeed;
+ int flags;
+ int length;
+ int lastValidFrame;
} SpeedControlVars;
typedef struct GaussianBlurVars {
- float size_x;
- float size_y;
+ float size_x;
+ float size_y;
} GaussianBlurVars;
typedef struct TextVars {
- char text[512];
- VFont *text_font;
- int text_blf_id;
- int text_size;
- float color[4], shadow_color[4];
- float loc[2];
- float wrap_width;
- char flag;
- char align, align_y;
- char _pad[1];
+ char text[512];
+ VFont *text_font;
+ int text_blf_id;
+ int text_size;
+ float color[4], shadow_color[4];
+ float loc[2];
+ float wrap_width;
+ char flag;
+ char align, align_y;
+ char _pad[1];
} TextVars;
/* TextVars.flag */
enum {
- SEQ_TEXT_SHADOW = (1 << 0),
+ SEQ_TEXT_SHADOW = (1 << 0),
};
/* TextVars.align */
enum {
- SEQ_TEXT_ALIGN_X_LEFT = 0,
- SEQ_TEXT_ALIGN_X_CENTER = 1,
- SEQ_TEXT_ALIGN_X_RIGHT = 2,
+ SEQ_TEXT_ALIGN_X_LEFT = 0,
+ SEQ_TEXT_ALIGN_X_CENTER = 1,
+ SEQ_TEXT_ALIGN_X_RIGHT = 2,
};
/* TextVars.align_y */
enum {
- SEQ_TEXT_ALIGN_Y_TOP = 0,
- SEQ_TEXT_ALIGN_Y_CENTER = 1,
- SEQ_TEXT_ALIGN_Y_BOTTOM = 2,
+ SEQ_TEXT_ALIGN_Y_TOP = 0,
+ SEQ_TEXT_ALIGN_Y_CENTER = 1,
+ SEQ_TEXT_ALIGN_Y_BOTTOM = 2,
};
#define SEQ_FONT_NOT_LOADED -2
typedef struct ColorMixVars {
- /** Value from SEQ_TYPE_XXX enumeration. */
- int blend_effect;
- /** Blend factor [0.0f, 1.0f]. */
- float factor;
+ /** Value from SEQ_TYPE_XXX enumeration. */
+ int blend_effect;
+ /** Blend factor [0.0f, 1.0f]. */
+ float factor;
} ColorMixVars;
/* ***************** Sequence modifiers ****************** */
typedef struct SequenceModifierData {
- struct SequenceModifierData *next, *prev;
- int type, flag;
- /** MAX_NAME. */
- char name[64];
+ struct SequenceModifierData *next, *prev;
+ int type, flag;
+ /** MAX_NAME. */
+ char name[64];
- /* mask input, either sequence or mask ID */
- int mask_input_type;
- int mask_time;
+ /* mask input, either sequence or mask ID */
+ int mask_input_type;
+ int mask_time;
- struct Sequence *mask_sequence;
- struct Mask *mask_id;
+ struct Sequence *mask_sequence;
+ struct Mask *mask_id;
} SequenceModifierData;
typedef struct ColorBalanceModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
- StripColorBalance color_balance;
- float color_multiply;
+ StripColorBalance color_balance;
+ float color_multiply;
} ColorBalanceModifierData;
typedef struct CurvesModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
- struct CurveMapping curve_mapping;
+ struct CurveMapping curve_mapping;
} CurvesModifierData;
typedef struct HueCorrectModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
- struct CurveMapping curve_mapping;
+ struct CurveMapping curve_mapping;
} HueCorrectModifierData;
typedef struct BrightContrastModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
- float bright;
- float contrast;
+ float bright;
+ float contrast;
} BrightContrastModifierData;
typedef struct SequencerMaskModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
} SequencerMaskModifierData;
typedef struct WhiteBalanceModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
- float white_value[3];
- char _pad[4];
+ float white_value[3];
+ char _pad[4];
} WhiteBalanceModifierData;
typedef struct SequencerTonemapModifierData {
- SequenceModifierData modifier;
+ SequenceModifierData modifier;
- float key, offset, gamma;
- float intensity, contrast, adaptation, correction;
- int type;
+ float key, offset, gamma;
+ float intensity, contrast, adaptation, correction;
+ int type;
} SequencerTonemapModifierData;
enum {
- SEQ_TONEMAP_RH_SIMPLE = 0,
- SEQ_TONEMAP_RD_PHOTORECEPTOR = 1,
+ SEQ_TONEMAP_RH_SIMPLE = 0,
+ SEQ_TONEMAP_RD_PHOTORECEPTOR = 1,
};
/* ***************** Scopes ****************** */
typedef struct SequencerScopes {
- struct ImBuf *reference_ibuf;
+ struct ImBuf *reference_ibuf;
- struct ImBuf *zebra_ibuf;
- struct ImBuf *waveform_ibuf;
- struct ImBuf *sep_waveform_ibuf;
- struct ImBuf *vector_ibuf;
- struct ImBuf *histogram_ibuf;
+ struct ImBuf *zebra_ibuf;
+ struct ImBuf *waveform_ibuf;
+ struct ImBuf *sep_waveform_ibuf;
+ struct ImBuf *vector_ibuf;
+ struct ImBuf *histogram_ibuf;
} SequencerScopes;
-#define MAXSEQ 32
+#define MAXSEQ 32
#define SELECT 1
/* Editor->over_flag */
-#define SEQ_EDIT_OVERLAY_SHOW 1
-#define SEQ_EDIT_OVERLAY_ABS 2
+#define SEQ_EDIT_OVERLAY_SHOW 1
+#define SEQ_EDIT_OVERLAY_ABS 2
-#define SEQ_STRIP_OFSBOTTOM 0.05f
-#define SEQ_STRIP_OFSTOP 0.95f
+#define SEQ_STRIP_OFSBOTTOM 0.05f
+#define SEQ_STRIP_OFSTOP 0.95f
/* Editor->proxy_storage */
/* store proxies in project directory */
#define SEQ_EDIT_PROXY_DIR_STORAGE 1
/* SpeedControlVars->flags */
-#define SEQ_SPEED_INTEGRATE (1 << 0)
-#define SEQ_SPEED_UNUSED_1 (1 << 1) /* cleared */
+#define SEQ_SPEED_INTEGRATE (1 << 0)
+#define SEQ_SPEED_UNUSED_1 (1 << 1) /* cleared */
#define SEQ_SPEED_COMPRESS_IPO_Y (1 << 2)
/* ***************** SEQUENCE ****************** */
-#define SEQ_NAME_MAXSTR 64
+#define SEQ_NAME_MAXSTR 64
/* seq->flag */
enum {
- /* SELECT */
- SEQ_LEFTSEL = (1 << 1),
- SEQ_RIGHTSEL = (1 << 2),
- SEQ_OVERLAP = (1 << 3),
- SEQ_FILTERY = (1 << 4),
- SEQ_MUTE = (1 << 5),
- SEQ_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- SEQ_REVERSE_FRAMES = (1 << 7),
- SEQ_IPO_FRAME_LOCKED = (1 << 8),
- SEQ_EFFECT_NOT_LOADED = (1 << 9),
- SEQ_FLAG_DELETE = (1 << 10),
- SEQ_FLIPX = (1 << 11),
- SEQ_FLIPY = (1 << 12),
- SEQ_MAKE_FLOAT = (1 << 13),
- SEQ_LOCK = (1 << 14),
- SEQ_USE_PROXY = (1 << 15),
- SEQ_USE_TRANSFORM = (1 << 16),
- SEQ_USE_CROP = (1 << 17),
- SEQ_FLAG_UNUSED_18 = (1 << 18), /* cleared */
- SEQ_FLAG_UNUSED_19 = (1 << 19), /* cleared */
- SEQ_FLAG_UNUSED_21 = (1 << 21), /* cleared */
-
- SEQ_USE_EFFECT_DEFAULT_FADE = (1 << 22),
- SEQ_USE_LINEAR_MODIFIERS = (1 << 23),
-
- /* flags for whether those properties are animated or not */
- SEQ_AUDIO_VOLUME_ANIMATED = (1 << 24),
- SEQ_AUDIO_PITCH_ANIMATED = (1 << 25),
- SEQ_AUDIO_PAN_ANIMATED = (1 << 26),
- SEQ_AUDIO_DRAW_WAVEFORM = (1 << 27),
-
- /* don't include Grease Pencil in OpenGL previews of Scene strips */
- SEQ_SCENE_NO_GPENCIL = (1 << 28),
- SEQ_USE_VIEWS = (1 << 29),
-
- /* access scene strips directly (like a metastrip) */
- SEQ_SCENE_STRIPS = (1 << 30),
-
- SEQ_INVALID_EFFECT = (1u << 31),
+ /* SELECT */
+ SEQ_LEFTSEL = (1 << 1),
+ SEQ_RIGHTSEL = (1 << 2),
+ SEQ_OVERLAP = (1 << 3),
+ SEQ_FILTERY = (1 << 4),
+ SEQ_MUTE = (1 << 5),
+ SEQ_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ SEQ_REVERSE_FRAMES = (1 << 7),
+ SEQ_IPO_FRAME_LOCKED = (1 << 8),
+ SEQ_EFFECT_NOT_LOADED = (1 << 9),
+ SEQ_FLAG_DELETE = (1 << 10),
+ SEQ_FLIPX = (1 << 11),
+ SEQ_FLIPY = (1 << 12),
+ SEQ_MAKE_FLOAT = (1 << 13),
+ SEQ_LOCK = (1 << 14),
+ SEQ_USE_PROXY = (1 << 15),
+ SEQ_USE_TRANSFORM = (1 << 16),
+ SEQ_USE_CROP = (1 << 17),
+ SEQ_FLAG_UNUSED_18 = (1 << 18), /* cleared */
+ SEQ_FLAG_UNUSED_19 = (1 << 19), /* cleared */
+ SEQ_FLAG_UNUSED_21 = (1 << 21), /* cleared */
+
+ SEQ_USE_EFFECT_DEFAULT_FADE = (1 << 22),
+ SEQ_USE_LINEAR_MODIFIERS = (1 << 23),
+
+ /* flags for whether those properties are animated or not */
+ SEQ_AUDIO_VOLUME_ANIMATED = (1 << 24),
+ SEQ_AUDIO_PITCH_ANIMATED = (1 << 25),
+ SEQ_AUDIO_PAN_ANIMATED = (1 << 26),
+ SEQ_AUDIO_DRAW_WAVEFORM = (1 << 27),
+
+ /* don't include Grease Pencil in OpenGL previews of Scene strips */
+ SEQ_SCENE_NO_GPENCIL = (1 << 28),
+ SEQ_USE_VIEWS = (1 << 29),
+
+ /* access scene strips directly (like a metastrip) */
+ SEQ_SCENE_STRIPS = (1 << 30),
+
+ SEQ_INVALID_EFFECT = (1u << 31),
};
/* StripProxy->storage */
enum {
- SEQ_STORAGE_PROXY_CUSTOM_FILE = (1 << 1), /* store proxy in custom directory */
- SEQ_STORAGE_PROXY_CUSTOM_DIR = (1 << 2), /* store proxy in custom file */
+ SEQ_STORAGE_PROXY_CUSTOM_FILE = (1 << 1), /* store proxy in custom directory */
+ SEQ_STORAGE_PROXY_CUSTOM_DIR = (1 << 2), /* store proxy in custom file */
};
/* convenience define for all selection flags */
-#define SEQ_ALLSEL (SELECT + SEQ_LEFTSEL + SEQ_RIGHTSEL)
+#define SEQ_ALLSEL (SELECT + SEQ_LEFTSEL + SEQ_RIGHTSEL)
/* deprecated, don't use a flag anymore*/
/*#define SEQ_ACTIVE 1048576*/
@@ -513,127 +512,127 @@ enum {
/* !!! has to be same as IMB_imbuf.h IMB_PROXY_... and IMB_TC_... */
-#define SEQ_PROXY_IMAGE_SIZE_25 1
-#define SEQ_PROXY_IMAGE_SIZE_50 2
-#define SEQ_PROXY_IMAGE_SIZE_75 4
-#define SEQ_PROXY_IMAGE_SIZE_100 8
+#define SEQ_PROXY_IMAGE_SIZE_25 1
+#define SEQ_PROXY_IMAGE_SIZE_50 2
+#define SEQ_PROXY_IMAGE_SIZE_75 4
+#define SEQ_PROXY_IMAGE_SIZE_100 8
-#define SEQ_PROXY_TC_NONE 0
-#define SEQ_PROXY_TC_RECORD_RUN 1
-#define SEQ_PROXY_TC_FREE_RUN 2
-#define SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN 4
-#define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS 8
-#define SEQ_PROXY_TC_ALL 15
+#define SEQ_PROXY_TC_NONE 0
+#define SEQ_PROXY_TC_RECORD_RUN 1
+#define SEQ_PROXY_TC_FREE_RUN 2
+#define SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN 4
+#define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS 8
+#define SEQ_PROXY_TC_ALL 15
/* SeqProxy->build_flags */
enum {
- SEQ_PROXY_SKIP_EXISTING = 1,
+ SEQ_PROXY_SKIP_EXISTING = 1,
};
/* seq->alpha_mode */
enum {
- SEQ_ALPHA_STRAIGHT = 0,
- SEQ_ALPHA_PREMUL = 1,
+ SEQ_ALPHA_STRAIGHT = 0,
+ SEQ_ALPHA_PREMUL = 1,
};
/* seq->type WATCH IT: SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!!! */
enum {
- SEQ_TYPE_IMAGE = 0,
- SEQ_TYPE_META = 1,
- SEQ_TYPE_SCENE = 2,
- SEQ_TYPE_MOVIE = 3,
- SEQ_TYPE_SOUND_RAM = 4,
- SEQ_TYPE_SOUND_HD = 5,
- SEQ_TYPE_MOVIECLIP = 6,
- SEQ_TYPE_MASK = 7,
-
- SEQ_TYPE_EFFECT = 8,
- SEQ_TYPE_CROSS = 8,
- SEQ_TYPE_ADD = 9,
- SEQ_TYPE_SUB = 10,
- SEQ_TYPE_ALPHAOVER = 11,
- SEQ_TYPE_ALPHAUNDER = 12,
- SEQ_TYPE_GAMCROSS = 13,
- SEQ_TYPE_MUL = 14,
- SEQ_TYPE_OVERDROP = 15,
- /* SEQ_TYPE_PLUGIN = 24, */ /* Deprecated */
- SEQ_TYPE_WIPE = 25,
- SEQ_TYPE_GLOW = 26,
- SEQ_TYPE_TRANSFORM = 27,
- SEQ_TYPE_COLOR = 28,
- SEQ_TYPE_SPEED = 29,
- SEQ_TYPE_MULTICAM = 30,
- SEQ_TYPE_ADJUSTMENT = 31,
- SEQ_TYPE_GAUSSIAN_BLUR = 40,
- SEQ_TYPE_TEXT = 41,
- SEQ_TYPE_COLORMIX = 42,
-
- /* Blend modes */
- SEQ_TYPE_SCREEN = 43,
- SEQ_TYPE_LIGHTEN = 44,
- SEQ_TYPE_DODGE = 45,
- SEQ_TYPE_DARKEN = 46,
- SEQ_TYPE_BURN = 47,
- SEQ_TYPE_LINEAR_BURN = 48,
- SEQ_TYPE_OVERLAY = 49,
- SEQ_TYPE_HARD_LIGHT = 50,
- SEQ_TYPE_SOFT_LIGHT = 51,
- SEQ_TYPE_PIN_LIGHT = 52,
- SEQ_TYPE_LIN_LIGHT = 53,
- SEQ_TYPE_VIVID_LIGHT = 54,
- SEQ_TYPE_HUE = 55,
- SEQ_TYPE_SATURATION = 56,
- SEQ_TYPE_VALUE = 57,
- SEQ_TYPE_BLEND_COLOR = 58,
- SEQ_TYPE_DIFFERENCE = 59,
- SEQ_TYPE_EXCLUSION = 60,
-
- SEQ_TYPE_MAX = 60,
+ SEQ_TYPE_IMAGE = 0,
+ SEQ_TYPE_META = 1,
+ SEQ_TYPE_SCENE = 2,
+ SEQ_TYPE_MOVIE = 3,
+ SEQ_TYPE_SOUND_RAM = 4,
+ SEQ_TYPE_SOUND_HD = 5,
+ SEQ_TYPE_MOVIECLIP = 6,
+ SEQ_TYPE_MASK = 7,
+
+ SEQ_TYPE_EFFECT = 8,
+ SEQ_TYPE_CROSS = 8,
+ SEQ_TYPE_ADD = 9,
+ SEQ_TYPE_SUB = 10,
+ SEQ_TYPE_ALPHAOVER = 11,
+ SEQ_TYPE_ALPHAUNDER = 12,
+ SEQ_TYPE_GAMCROSS = 13,
+ SEQ_TYPE_MUL = 14,
+ SEQ_TYPE_OVERDROP = 15,
+ /* SEQ_TYPE_PLUGIN = 24, */ /* Deprecated */
+ SEQ_TYPE_WIPE = 25,
+ SEQ_TYPE_GLOW = 26,
+ SEQ_TYPE_TRANSFORM = 27,
+ SEQ_TYPE_COLOR = 28,
+ SEQ_TYPE_SPEED = 29,
+ SEQ_TYPE_MULTICAM = 30,
+ SEQ_TYPE_ADJUSTMENT = 31,
+ SEQ_TYPE_GAUSSIAN_BLUR = 40,
+ SEQ_TYPE_TEXT = 41,
+ SEQ_TYPE_COLORMIX = 42,
+
+ /* Blend modes */
+ SEQ_TYPE_SCREEN = 43,
+ SEQ_TYPE_LIGHTEN = 44,
+ SEQ_TYPE_DODGE = 45,
+ SEQ_TYPE_DARKEN = 46,
+ SEQ_TYPE_BURN = 47,
+ SEQ_TYPE_LINEAR_BURN = 48,
+ SEQ_TYPE_OVERLAY = 49,
+ SEQ_TYPE_HARD_LIGHT = 50,
+ SEQ_TYPE_SOFT_LIGHT = 51,
+ SEQ_TYPE_PIN_LIGHT = 52,
+ SEQ_TYPE_LIN_LIGHT = 53,
+ SEQ_TYPE_VIVID_LIGHT = 54,
+ SEQ_TYPE_HUE = 55,
+ SEQ_TYPE_SATURATION = 56,
+ SEQ_TYPE_VALUE = 57,
+ SEQ_TYPE_BLEND_COLOR = 58,
+ SEQ_TYPE_DIFFERENCE = 59,
+ SEQ_TYPE_EXCLUSION = 60,
+
+ SEQ_TYPE_MAX = 60,
};
#define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1 << 0)
-#define SEQ_MOVIECLIP_RENDER_STABILIZED (1 << 1)
+#define SEQ_MOVIECLIP_RENDER_STABILIZED (1 << 1)
-#define SEQ_BLEND_REPLACE 0
+#define SEQ_BLEND_REPLACE 0
/* all other BLEND_MODEs are simple SEQ_TYPE_EFFECT ids and therefore identical
* to the table above. (Only those effects that handle _exactly_ two inputs,
* otherwise, you can't really blend, right :) !)
*/
-
-#define SEQ_HAS_PATH(_seq) (ELEM((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
+#define SEQ_HAS_PATH(_seq) \
+ (ELEM((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
/* modifiers */
/* SequenceModifierData->type */
enum {
- seqModifierType_ColorBalance = 1,
- seqModifierType_Curves = 2,
- seqModifierType_HueCorrect = 3,
- seqModifierType_BrightContrast = 4,
- seqModifierType_Mask = 5,
- seqModifierType_WhiteBalance = 6,
- seqModifierType_Tonemap = 7,
-
- NUM_SEQUENCE_MODIFIER_TYPES,
+ seqModifierType_ColorBalance = 1,
+ seqModifierType_Curves = 2,
+ seqModifierType_HueCorrect = 3,
+ seqModifierType_BrightContrast = 4,
+ seqModifierType_Mask = 5,
+ seqModifierType_WhiteBalance = 6,
+ seqModifierType_Tonemap = 7,
+
+ NUM_SEQUENCE_MODIFIER_TYPES,
};
/* SequenceModifierData->flag */
enum {
- SEQUENCE_MODIFIER_MUTE = (1 << 0),
- SEQUENCE_MODIFIER_EXPANDED = (1 << 1),
+ SEQUENCE_MODIFIER_MUTE = (1 << 0),
+ SEQUENCE_MODIFIER_EXPANDED = (1 << 1),
};
enum {
- SEQUENCE_MASK_INPUT_STRIP = 0,
- SEQUENCE_MASK_INPUT_ID = 1,
+ SEQUENCE_MASK_INPUT_STRIP = 0,
+ SEQUENCE_MASK_INPUT_ID = 1,
};
enum {
- /* Mask animation will be remapped relative to the strip start frame. */
- SEQUENCE_MASK_TIME_RELATIVE = 0,
- /* Global (scene) frame number will be used to access the mask. */
- SEQUENCE_MASK_TIME_ABSOLUTE = 1,
+ /* Mask animation will be remapped relative to the strip start frame. */
+ SEQUENCE_MASK_TIME_RELATIVE = 0,
+ /* Global (scene) frame number will be used to access the mask. */
+ SEQUENCE_MASK_TIME_ABSOLUTE = 1,
};
-#endif /* __DNA_SEQUENCE_TYPES_H__ */
+#endif /* __DNA_SEQUENCE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index 2b12d522245..c996b3bb829 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -31,230 +31,230 @@ struct DRWShadingGroup;
*/
typedef enum ShaderFxType {
- eShaderFxType_None = 0,
- eShaderFxType_Blur = 1,
- eShaderFxType_Flip = 2,
- eShaderFxType_Light = 3,
- eShaderFxType_Pixel = 4,
- eShaderFxType_Swirl = 5,
- eShaderFxType_Wave = 6,
- eShaderFxType_Rim = 7,
- eShaderFxType_Colorize = 8,
- eShaderFxType_Shadow = 9,
- eShaderFxType_Glow = 10,
- NUM_SHADER_FX_TYPES,
+ eShaderFxType_None = 0,
+ eShaderFxType_Blur = 1,
+ eShaderFxType_Flip = 2,
+ eShaderFxType_Light = 3,
+ eShaderFxType_Pixel = 4,
+ eShaderFxType_Swirl = 5,
+ eShaderFxType_Wave = 6,
+ eShaderFxType_Rim = 7,
+ eShaderFxType_Colorize = 8,
+ eShaderFxType_Shadow = 9,
+ eShaderFxType_Glow = 10,
+ NUM_SHADER_FX_TYPES,
} ShaderFxType;
typedef enum ShaderFxMode {
- eShaderFxMode_Realtime = (1 << 0),
- eShaderFxMode_Render = (1 << 1),
- eShaderFxMode_Editmode = (1 << 2),
- eShaderFxMode_Expanded = (1 << 3),
+ eShaderFxMode_Realtime = (1 << 0),
+ eShaderFxMode_Render = (1 << 1),
+ eShaderFxMode_Editmode = (1 << 2),
+ eShaderFxMode_Expanded = (1 << 3),
} ShaderFxMode;
typedef enum {
- /* This fx has been inserted in local override, and hence can be fully edited. */
- eShaderFxFlag_StaticOverride_Local = (1 << 0),
+ /* This fx has been inserted in local override, and hence can be fully edited. */
+ eShaderFxFlag_StaticOverride_Local = (1 << 0),
} ShaderFxFlag;
typedef struct ShaderFxData {
- struct ShaderFxData *next, *prev;
+ struct ShaderFxData *next, *prev;
- int type, mode;
- int stackindex;
- short flag;
- char _pad[2];
- /** MAX_NAME. */
- char name[64];
+ int type, mode;
+ int stackindex;
+ short flag;
+ char _pad[2];
+ /** MAX_NAME. */
+ char name[64];
- char *error;
+ char *error;
} ShaderFxData;
/* Runtime temp data */
typedef struct ShaderFxData_Runtime {
- float loc[3];
- char _pad[4];
- struct DRWShadingGroup *fx_sh;
- struct DRWShadingGroup *fx_sh_b;
- struct DRWShadingGroup *fx_sh_c;
+ float loc[3];
+ char _pad[4];
+ struct DRWShadingGroup *fx_sh;
+ struct DRWShadingGroup *fx_sh_b;
+ struct DRWShadingGroup *fx_sh_c;
} ShaderFxData_Runtime;
typedef struct BlurShaderFxData {
- ShaderFxData shaderfx;
- int radius[2];
- /** Flags. */
- int flag;
- /** Number of samples. */
- int samples;
- /** Circle of confusion. */
- float coc;
- /** Not visible in rna. */
- int blur[2];
- char _pad[4];
-
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ int radius[2];
+ /** Flags. */
+ int flag;
+ /** Number of samples. */
+ int samples;
+ /** Circle of confusion. */
+ float coc;
+ /** Not visible in rna. */
+ int blur[2];
+ char _pad[4];
+
+ ShaderFxData_Runtime runtime;
} BlurShaderFxData;
typedef enum eBlurShaderFx_Flag {
- FX_BLUR_DOF_MODE = (1 << 0),
+ FX_BLUR_DOF_MODE = (1 << 0),
} eBlurShaderFx_Flag;
typedef struct ColorizeShaderFxData {
- ShaderFxData shaderfx;
- int mode;
- float low_color[4];
- float high_color[4];
- float factor;
- /** Flags. */
- int flag;
- char _pad[4];
-
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ int mode;
+ float low_color[4];
+ float high_color[4];
+ float factor;
+ /** Flags. */
+ int flag;
+ char _pad[4];
+
+ ShaderFxData_Runtime runtime;
} ColorizeShaderFxData;
typedef enum ColorizeShaderFxModes {
- eShaderFxColorizeMode_GrayScale = 0,
- eShaderFxColorizeMode_Sepia = 1,
- eShaderFxColorizeMode_Duotone = 2,
- eShaderFxColorizeMode_Custom = 3,
- eShaderFxColorizeMode_Transparent = 4,
+ eShaderFxColorizeMode_GrayScale = 0,
+ eShaderFxColorizeMode_Sepia = 1,
+ eShaderFxColorizeMode_Duotone = 2,
+ eShaderFxColorizeMode_Custom = 3,
+ eShaderFxColorizeMode_Transparent = 4,
} ColorizeShaderFxModes;
typedef struct FlipShaderFxData {
- ShaderFxData shaderfx;
- /** Flags. */
- int flag;
- /** Internal, not visible in rna. */
- int flipmode;
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ /** Flags. */
+ int flag;
+ /** Internal, not visible in rna. */
+ int flipmode;
+ ShaderFxData_Runtime runtime;
} FlipShaderFxData;
typedef enum eFlipShaderFx_Flag {
- FX_FLIP_HORIZONTAL = (1 << 0),
- FX_FLIP_VERTICAL = (1 << 1),
+ FX_FLIP_HORIZONTAL = (1 << 0),
+ FX_FLIP_VERTICAL = (1 << 1),
} eFlipShaderFx_Flag;
typedef struct GlowShaderFxData {
- ShaderFxData shaderfx;
- float glow_color[3];
- float select_color[3];
- float threshold;
- /** Flags. */
- int flag;
- int mode;
- int blur[2];
- int samples;
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ float glow_color[3];
+ float select_color[3];
+ float threshold;
+ /** Flags. */
+ int flag;
+ int mode;
+ int blur[2];
+ int samples;
+ ShaderFxData_Runtime runtime;
} GlowShaderFxData;
typedef enum GlowShaderFxModes {
- eShaderFxGlowMode_Luminance = 0,
- eShaderFxGlowMode_Color = 1,
+ eShaderFxGlowMode_Luminance = 0,
+ eShaderFxGlowMode_Color = 1,
} GlowShaderFxModes;
typedef enum eGlowShaderFx_Flag {
- FX_GLOW_USE_ALPHA = (1 << 0),
+ FX_GLOW_USE_ALPHA = (1 << 0),
} eGlowShaderFx_Flag;
typedef struct LightShaderFxData {
- ShaderFxData shaderfx;
- struct Object *object;
- /** Flags. */
- int flag;
- float energy;
- float ambient;
- /** Internal, not visible in rna. */
- float loc[4];
- char _pad[4];
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ struct Object *object;
+ /** Flags. */
+ int flag;
+ float energy;
+ float ambient;
+ /** Internal, not visible in rna. */
+ float loc[4];
+ char _pad[4];
+ ShaderFxData_Runtime runtime;
} LightShaderFxData;
typedef struct PixelShaderFxData {
- ShaderFxData shaderfx;
- /** Last element used for shader only. */
- int size[3];
- /** Flags. */
- int flag;
- float rgba[4];
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ /** Last element used for shader only. */
+ int size[3];
+ /** Flags. */
+ int flag;
+ float rgba[4];
+ ShaderFxData_Runtime runtime;
} PixelShaderFxData;
typedef enum ePixelShaderFx_Flag {
- FX_PIXEL_USE_LINES = (1 << 0),
+ FX_PIXEL_USE_LINES = (1 << 0),
} ePixelShaderFx_Flag;
typedef struct RimShaderFxData {
- ShaderFxData shaderfx;
- int offset[2];
- /** Flags. */
- int flag;
- float rim_rgb[3];
- float mask_rgb[3];
- int mode;
- int blur[2];
- int samples;
- char _pad[4];
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ int offset[2];
+ /** Flags. */
+ int flag;
+ float rim_rgb[3];
+ float mask_rgb[3];
+ int mode;
+ int blur[2];
+ int samples;
+ char _pad[4];
+ ShaderFxData_Runtime runtime;
} RimShaderFxData;
typedef enum RimShaderFxModes {
- eShaderFxRimMode_Normal = 0,
- eShaderFxRimMode_Overlay = 1,
- eShaderFxRimMode_Add = 2,
- eShaderFxRimMode_Subtract = 3,
- eShaderFxRimMode_Multiply = 4,
- eShaderFxRimMode_Divide = 5,
+ eShaderFxRimMode_Normal = 0,
+ eShaderFxRimMode_Overlay = 1,
+ eShaderFxRimMode_Add = 2,
+ eShaderFxRimMode_Subtract = 3,
+ eShaderFxRimMode_Multiply = 4,
+ eShaderFxRimMode_Divide = 5,
} RimShaderFxModes;
typedef struct ShadowShaderFxData {
- ShaderFxData shaderfx;
- struct Object *object;
- int offset[2];
- /** Flags. */
- int flag;
- float shadow_rgba[4];
- float amplitude;
- float period;
- float phase;
- int orientation;
- float scale[2];
- float rotation;
- int blur[2];
- int samples;
- char _pad[4];
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ struct Object *object;
+ int offset[2];
+ /** Flags. */
+ int flag;
+ float shadow_rgba[4];
+ float amplitude;
+ float period;
+ float phase;
+ int orientation;
+ float scale[2];
+ float rotation;
+ int blur[2];
+ int samples;
+ char _pad[4];
+ ShaderFxData_Runtime runtime;
} ShadowShaderFxData;
typedef enum eShadowShaderFx_Flag {
- FX_SHADOW_USE_OBJECT = (1 << 0),
- FX_SHADOW_USE_WAVE = (1 << 1),
+ FX_SHADOW_USE_OBJECT = (1 << 0),
+ FX_SHADOW_USE_WAVE = (1 << 1),
} eShadowShaderFx_Flag;
typedef struct SwirlShaderFxData {
- ShaderFxData shaderfx;
- struct Object *object;
- /** Flags. */
- int flag;
- int radius;
- float angle;
- /** Not visible in rna. */
- int transparent;
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ struct Object *object;
+ /** Flags. */
+ int flag;
+ int radius;
+ float angle;
+ /** Not visible in rna. */
+ int transparent;
+ ShaderFxData_Runtime runtime;
} SwirlShaderFxData;
typedef enum eSwirlShaderFx_Flag {
- FX_SWIRL_MAKE_TRANSPARENT = (1 << 0),
+ FX_SWIRL_MAKE_TRANSPARENT = (1 << 0),
} eSwirlShaderFx_Flag;
typedef struct WaveShaderFxData {
- ShaderFxData shaderfx;
- float amplitude;
- float period;
- float phase;
- int orientation;
- /** Flags. */
- int flag;
- char _pad[4];
- ShaderFxData_Runtime runtime;
+ ShaderFxData shaderfx;
+ float amplitude;
+ float period;
+ float phase;
+ int orientation;
+ /** Flags. */
+ int flag;
+ char _pad[4];
+ ShaderFxData_Runtime runtime;
} WaveShaderFxData;
-#endif /* __DNA_SHADER_FX_TYPES_H__ */
+#endif /* __DNA_SHADER_FX_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index e4f4db0be78..641a1fbf8e3 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -26,15 +26,15 @@
/* flags */
enum {
- MOD_SMOKE_HIGHRES = (1 << 1), /* enable high resolution */
- MOD_SMOKE_DISSOLVE = (1 << 2), /* let smoke dissolve */
- MOD_SMOKE_DISSOLVE_LOG = (1 << 3), /* using 1/x for dissolve */
+ MOD_SMOKE_HIGHRES = (1 << 1), /* enable high resolution */
+ MOD_SMOKE_DISSOLVE = (1 << 2), /* let smoke dissolve */
+ MOD_SMOKE_DISSOLVE_LOG = (1 << 3), /* using 1/x for dissolve */
#ifdef DNA_DEPRECATED
- MOD_SMOKE_HIGH_SMOOTH = (1 << 5), /* -- Deprecated -- */
+ MOD_SMOKE_HIGH_SMOOTH = (1 << 5), /* -- Deprecated -- */
#endif
- MOD_SMOKE_FILE_LOAD = (1 << 6), /* flag for file load */
- MOD_SMOKE_ADAPTIVE_DOMAIN = (1 << 7),
+ MOD_SMOKE_FILE_LOAD = (1 << 6), /* flag for file load */
+ MOD_SMOKE_ADAPTIVE_DOMAIN = (1 << 7),
};
/* noise */
@@ -46,219 +46,218 @@ enum {
/* slice method */
enum {
- MOD_SMOKE_SLICE_VIEW_ALIGNED = 0,
- MOD_SMOKE_SLICE_AXIS_ALIGNED = 1,
+ MOD_SMOKE_SLICE_VIEW_ALIGNED = 0,
+ MOD_SMOKE_SLICE_AXIS_ALIGNED = 1,
};
/* axis aligned method */
enum {
- AXIS_SLICE_FULL = 0,
- AXIS_SLICE_SINGLE = 1,
+ AXIS_SLICE_FULL = 0,
+ AXIS_SLICE_SINGLE = 1,
};
/* single slice direction */
enum {
- SLICE_AXIS_AUTO = 0,
- SLICE_AXIS_X = 1,
- SLICE_AXIS_Y = 2,
- SLICE_AXIS_Z = 3,
+ SLICE_AXIS_AUTO = 0,
+ SLICE_AXIS_X = 1,
+ SLICE_AXIS_Y = 2,
+ SLICE_AXIS_Z = 3,
};
/* axis aligned method */
enum {
- VOLUME_INTERP_LINEAR = 0,
- VOLUME_INTERP_CUBIC = 1,
+ VOLUME_INTERP_LINEAR = 0,
+ VOLUME_INTERP_CUBIC = 1,
};
enum {
- VECTOR_DRAW_NEEDLE = 0,
- VECTOR_DRAW_STREAMLINE = 1,
+ VECTOR_DRAW_NEEDLE = 0,
+ VECTOR_DRAW_STREAMLINE = 1,
};
enum {
- FLUID_FIELD_DENSITY = 0,
- FLUID_FIELD_HEAT = 1,
- FLUID_FIELD_FUEL = 2,
- FLUID_FIELD_REACT = 3,
- FLUID_FIELD_FLAME = 4,
- FLUID_FIELD_VELOCITY_X = 5,
- FLUID_FIELD_VELOCITY_Y = 6,
- FLUID_FIELD_VELOCITY_Z = 7,
- FLUID_FIELD_COLOR_R = 8,
- FLUID_FIELD_COLOR_G = 9,
- FLUID_FIELD_COLOR_B = 10,
- FLUID_FIELD_FORCE_X = 11,
- FLUID_FIELD_FORCE_Y = 12,
- FLUID_FIELD_FORCE_Z = 13,
+ FLUID_FIELD_DENSITY = 0,
+ FLUID_FIELD_HEAT = 1,
+ FLUID_FIELD_FUEL = 2,
+ FLUID_FIELD_REACT = 3,
+ FLUID_FIELD_FLAME = 4,
+ FLUID_FIELD_VELOCITY_X = 5,
+ FLUID_FIELD_VELOCITY_Y = 6,
+ FLUID_FIELD_VELOCITY_Z = 7,
+ FLUID_FIELD_COLOR_R = 8,
+ FLUID_FIELD_COLOR_G = 9,
+ FLUID_FIELD_COLOR_B = 10,
+ FLUID_FIELD_FORCE_X = 11,
+ FLUID_FIELD_FORCE_Y = 12,
+ FLUID_FIELD_FORCE_Z = 13,
};
/* cache compression */
-#define SM_CACHE_LIGHT 0
-#define SM_CACHE_HEAVY 1
+#define SM_CACHE_LIGHT 0
+#define SM_CACHE_HEAVY 1
/* domain border collision */
-#define SM_BORDER_OPEN 0
-#define SM_BORDER_VERTICAL 1
-#define SM_BORDER_CLOSED 2
+#define SM_BORDER_OPEN 0
+#define SM_BORDER_VERTICAL 1
+#define SM_BORDER_CLOSED 2
/* collision types */
-#define SM_COLL_STATIC 0
-#define SM_COLL_RIGID 1
-#define SM_COLL_ANIMATED 2
+#define SM_COLL_STATIC 0
+#define SM_COLL_RIGID 1
+#define SM_COLL_ANIMATED 2
/* high resolution sampling types */
-#define SM_HRES_NEAREST 0
-#define SM_HRES_LINEAR 1
-#define SM_HRES_FULLSAMPLE 2
+#define SM_HRES_NEAREST 0
+#define SM_HRES_LINEAR 1
+#define SM_HRES_FULLSAMPLE 2
/* smoke data fields (active_fields) */
-#define SM_ACTIVE_HEAT (1 << 0)
-#define SM_ACTIVE_FIRE (1 << 1)
-#define SM_ACTIVE_COLORS (1 << 2)
-#define SM_ACTIVE_COLOR_SET (1 << 3)
+#define SM_ACTIVE_HEAT (1 << 0)
+#define SM_ACTIVE_FIRE (1 << 1)
+#define SM_ACTIVE_COLORS (1 << 2)
+#define SM_ACTIVE_COLOR_SET (1 << 3)
enum {
- VDB_COMPRESSION_BLOSC = 0,
- VDB_COMPRESSION_ZIP = 1,
- VDB_COMPRESSION_NONE = 2,
+ VDB_COMPRESSION_BLOSC = 0,
+ VDB_COMPRESSION_ZIP = 1,
+ VDB_COMPRESSION_NONE = 2,
};
typedef struct SmokeDomainSettings {
- /** For fast RNA access. */
- struct SmokeModifierData *smd;
- struct FLUID_3D *fluid;
- void *fluid_mutex;
- struct Collection *fluid_group;
- struct Collection *eff_group; // UNUSED
- struct Collection *coll_group; // collision objects group
- struct WTURBULENCE *wt; // WTURBULENCE object, if active
- struct GPUTexture *tex;
- struct GPUTexture *tex_wt;
- struct GPUTexture *tex_shadow;
- struct GPUTexture *tex_flame;
- struct GPUTexture *tex_flame_coba;
- struct GPUTexture *tex_coba;
- struct GPUTexture *tex_field;
- struct GPUTexture *tex_velocity_x;
- struct GPUTexture *tex_velocity_y;
- struct GPUTexture *tex_velocity_z;
- float *shadow;
-
- /* simulation data */
- /** Start point of BB in local space (includes sub-cell shift for adaptive domain.)*/
- float p0[3];
- /** End point of BB in local space. */
- float p1[3];
- /** Difference from object center to grid start point. */
- float dp0[3];
- /** Size of simulation cell in local space. */
- float cell_size[3];
- /** Global size of domain axises. */
- float global_size[3];
- float prev_loc[3];
- /** Current domain shift in simulation cells. */
- int shift[3];
- /** Exact domain shift. */
- float shift_f[3];
- /**
- * How much object has shifted since previous smoke frame
- * (used to "lock" domain while drawing).
- */
- float obj_shift_f[3];
- /** Domain object imat. */
- float imat[4][4];
- /** Domain obmat. */
- float obmat[4][4];
- /** Low res fluid matrix. */
- float fluidmat[4][4];
- /** High res fluid matrix. */
- float fluidmat_wt[4][4];
-
- /** Initial "non-adapted" resolution. */
- int base_res[3];
- /** Cell min. */
- int res_min[3];
- /** Cell max. */
- int res_max[3];
- /** Data resolution (res_max-res_min). */
- int res[3];
- int total_cells;
- /** 1.0f / res. */
- float dx;
- /** Largest domain size. */
- float scale;
-
- /* user settings */
- int adapt_margin;
- int adapt_res;
- float adapt_threshold;
-
- float alpha;
- float beta;
- /** Wavelet amplification. */
- int amplify;
- /** Longest axis on the BB gets this resolution assigned. */
- int maxres;
- /** Show up-res or low res, etc. */
- int flags;
- int viewsettings;
- /** Noise type: wave, curl, anisotropic. */
- short noise;
- short diss_percent;
- /** In frames. */
- int diss_speed;
- float strength;
- int res_wt[3];
- float dx_wt;
- /* point cache options */
- int cache_comp;
- int cache_high_comp;
- /* OpenVDB cache options */
- int openvdb_comp;
- char cache_file_format;
- char data_depth;
- char _pad[2];
-
- /* Smoke uses only one cache from now on (index [0]),
- * but keeping the array for now for reading old files. */
- /** Definition is in DNA_object_force_types.h. */
- struct PointCache *point_cache[2];
- struct ListBase ptcaches[2];
- struct EffectorWeights *effector_weights;
- /** How domain border collisions are handled. */
- int border_collisions;
- float time_scale;
- float vorticity;
- int active_fields;
- /** Monitor color situation of simulation. */
- float active_color[3];
- int highres_sampling;
-
- /* flame parameters */
- float burning_rate, flame_smoke, flame_vorticity;
- float flame_ignition, flame_max_temp;
- float flame_smoke_color[3];
-
- /* Display settings */
- char slice_method, axis_slice_method;
- char slice_axis, draw_velocity;
- float slice_per_voxel;
- float slice_depth;
- float display_thickness;
-
- struct ColorBand *coba;
- float vector_scale;
- char vector_draw_type;
- char use_coba;
- /** Simulation field used for the color mapping. */
- char coba_field;
- char interp_method;
-
- float clipping;
- char _pad3[4];
+ /** For fast RNA access. */
+ struct SmokeModifierData *smd;
+ struct FLUID_3D *fluid;
+ void *fluid_mutex;
+ struct Collection *fluid_group;
+ struct Collection *eff_group; // UNUSED
+ struct Collection *coll_group; // collision objects group
+ struct WTURBULENCE *wt; // WTURBULENCE object, if active
+ struct GPUTexture *tex;
+ struct GPUTexture *tex_wt;
+ struct GPUTexture *tex_shadow;
+ struct GPUTexture *tex_flame;
+ struct GPUTexture *tex_flame_coba;
+ struct GPUTexture *tex_coba;
+ struct GPUTexture *tex_field;
+ struct GPUTexture *tex_velocity_x;
+ struct GPUTexture *tex_velocity_y;
+ struct GPUTexture *tex_velocity_z;
+ float *shadow;
+
+ /* simulation data */
+ /** Start point of BB in local space (includes sub-cell shift for adaptive domain.)*/
+ float p0[3];
+ /** End point of BB in local space. */
+ float p1[3];
+ /** Difference from object center to grid start point. */
+ float dp0[3];
+ /** Size of simulation cell in local space. */
+ float cell_size[3];
+ /** Global size of domain axises. */
+ float global_size[3];
+ float prev_loc[3];
+ /** Current domain shift in simulation cells. */
+ int shift[3];
+ /** Exact domain shift. */
+ float shift_f[3];
+ /**
+ * How much object has shifted since previous smoke frame
+ * (used to "lock" domain while drawing).
+ */
+ float obj_shift_f[3];
+ /** Domain object imat. */
+ float imat[4][4];
+ /** Domain obmat. */
+ float obmat[4][4];
+ /** Low res fluid matrix. */
+ float fluidmat[4][4];
+ /** High res fluid matrix. */
+ float fluidmat_wt[4][4];
+
+ /** Initial "non-adapted" resolution. */
+ int base_res[3];
+ /** Cell min. */
+ int res_min[3];
+ /** Cell max. */
+ int res_max[3];
+ /** Data resolution (res_max-res_min). */
+ int res[3];
+ int total_cells;
+ /** 1.0f / res. */
+ float dx;
+ /** Largest domain size. */
+ float scale;
+
+ /* user settings */
+ int adapt_margin;
+ int adapt_res;
+ float adapt_threshold;
+
+ float alpha;
+ float beta;
+ /** Wavelet amplification. */
+ int amplify;
+ /** Longest axis on the BB gets this resolution assigned. */
+ int maxres;
+ /** Show up-res or low res, etc. */
+ int flags;
+ int viewsettings;
+ /** Noise type: wave, curl, anisotropic. */
+ short noise;
+ short diss_percent;
+ /** In frames. */
+ int diss_speed;
+ float strength;
+ int res_wt[3];
+ float dx_wt;
+ /* point cache options */
+ int cache_comp;
+ int cache_high_comp;
+ /* OpenVDB cache options */
+ int openvdb_comp;
+ char cache_file_format;
+ char data_depth;
+ char _pad[2];
+
+ /* Smoke uses only one cache from now on (index [0]),
+ * but keeping the array for now for reading old files. */
+ /** Definition is in DNA_object_force_types.h. */
+ struct PointCache *point_cache[2];
+ struct ListBase ptcaches[2];
+ struct EffectorWeights *effector_weights;
+ /** How domain border collisions are handled. */
+ int border_collisions;
+ float time_scale;
+ float vorticity;
+ int active_fields;
+ /** Monitor color situation of simulation. */
+ float active_color[3];
+ int highres_sampling;
+
+ /* flame parameters */
+ float burning_rate, flame_smoke, flame_vorticity;
+ float flame_ignition, flame_max_temp;
+ float flame_smoke_color[3];
+
+ /* Display settings */
+ char slice_method, axis_slice_method;
+ char slice_axis, draw_velocity;
+ float slice_per_voxel;
+ float slice_depth;
+ float display_thickness;
+
+ struct ColorBand *coba;
+ float vector_scale;
+ char vector_draw_type;
+ char use_coba;
+ /** Simulation field used for the color mapping. */
+ char coba_field;
+ char interp_method;
+
+ float clipping;
+ char _pad3[4];
} SmokeDomainSettings;
-
/* inflow / outflow */
/* type */
@@ -277,72 +276,71 @@ typedef struct SmokeDomainSettings {
/* flags */
enum {
- /**old style emission*/
- MOD_SMOKE_FLOW_ABSOLUTE = (1 << 1),
- /** passes particles speed to the smoke */
- MOD_SMOKE_FLOW_INITVELOCITY = (1 << 2),
- /** use texture to control emission speed */
- MOD_SMOKE_FLOW_TEXTUREEMIT = (1 << 3),
- /** use specific size for particles instead of closest cell */
- MOD_SMOKE_FLOW_USE_PART_SIZE = (1 << 4),
+ /**old style emission*/
+ MOD_SMOKE_FLOW_ABSOLUTE = (1 << 1),
+ /** passes particles speed to the smoke */
+ MOD_SMOKE_FLOW_INITVELOCITY = (1 << 2),
+ /** use texture to control emission speed */
+ MOD_SMOKE_FLOW_TEXTUREEMIT = (1 << 3),
+ /** use specific size for particles instead of closest cell */
+ MOD_SMOKE_FLOW_USE_PART_SIZE = (1 << 4),
};
typedef struct SmokeFlowSettings {
- /** For fast RNA access. */
- struct SmokeModifierData *smd;
- struct Mesh *mesh;
- struct ParticleSystem *psys;
- struct Tex *noise_texture;
-
- /* initial velocity */
- /** Previous vertex positions in domain space. */
- float *verts_old;
- int numverts;
- float vel_multi; // Multiplier for inherited velocity
- float vel_normal;
- float vel_random;
- /* emission */
- float density;
- float color[3];
- float fuel_amount;
- /** Delta temperature (temp - ambient temp). */
- float temp;
- /** Density emitted within mesh volume. */
- float volume_density;
- /** Maximum emission distance from mesh surface. */
- float surface_distance;
- float particle_size;
- int subframes;
- /* texture control */
- float texture_size;
- float texture_offset;
- char _pad[4];
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvlayer_name[64];
- short vgroup_density;
-
- /** Smoke, flames, both, outflow. */
- short type;
- short source;
- short texture_type;
- /** Absolute emission et.c*/
- int flags;
+ /** For fast RNA access. */
+ struct SmokeModifierData *smd;
+ struct Mesh *mesh;
+ struct ParticleSystem *psys;
+ struct Tex *noise_texture;
+
+ /* initial velocity */
+ /** Previous vertex positions in domain space. */
+ float *verts_old;
+ int numverts;
+ float vel_multi; // Multiplier for inherited velocity
+ float vel_normal;
+ float vel_random;
+ /* emission */
+ float density;
+ float color[3];
+ float fuel_amount;
+ /** Delta temperature (temp - ambient temp). */
+ float temp;
+ /** Density emitted within mesh volume. */
+ float volume_density;
+ /** Maximum emission distance from mesh surface. */
+ float surface_distance;
+ float particle_size;
+ int subframes;
+ /* texture control */
+ float texture_size;
+ float texture_offset;
+ char _pad[4];
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvlayer_name[64];
+ short vgroup_density;
+
+ /** Smoke, flames, both, outflow. */
+ short type;
+ short source;
+ short texture_type;
+ /** Absolute emission et.c*/
+ int flags;
} SmokeFlowSettings;
-
// struct BVHTreeFromMesh *bvh;
// float mat[4][4];
// float mat_old[4][4];
/* collision objects (filled with smoke) */
typedef struct SmokeCollSettings {
- /** For fast RNA access. */
- struct SmokeModifierData *smd;
- struct Mesh *mesh;
- float *verts_old;
- int numverts;
- short type; // static = 0, rigid = 1, dynamic = 2
- char _pad[2];
+ /** For fast RNA access. */
+ struct SmokeModifierData *smd;
+ struct Mesh *mesh;
+ float *verts_old;
+ int numverts;
+ short type; // static = 0, rigid = 1, dynamic = 2
+ char _pad[2];
} SmokeCollSettings;
#endif
diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h
index d17852312d0..3f73270493a 100644
--- a/source/blender/makesdna/DNA_sound_types.h
+++ b/source/blender/makesdna/DNA_sound_types.h
@@ -33,98 +33,98 @@ struct Ipo;
struct PackedFile;
typedef struct bSound {
- ID id;
-
- /**
- * The path to the sound file.
- */
- /** 1024 = FILE_MAX. */
- char name[1024];
-
- /**
- * The packed file.
- */
- struct PackedFile *packedfile;
-
- /**
- * The handle for audaspace.
- */
- void *handle;
-
- /**
- * Deprecated; used for loading pre 2.5 files.
- */
- struct PackedFile *newpackedfile;
- struct Ipo *ipo;
-
- float volume;
- float attenuation;
- float pitch;
- float min_gain;
- float max_gain;
- float distance;
- short flags;
- /** Runtime only, always reset in readfile. */
- short tags;
- char _pad[4];
-
- /* unused currently
- int type;
- struct bSound *child_sound; */
-
- /**
- * The audaspace handle for cache.
- */
- void *cache;
-
- /**
- * Waveform display data.
- */
- void *waveform;
-
- /**
- * The audaspace handle that should actually be played back.
- * Should be cache if cache != NULL; otherwise it's handle
- */
- void *playback_handle;
-
- /** Spinlock for asynchronous loading of sounds. */
- void *spinlock;
- /* XXX unused currently (SOUND_TYPE_LIMITER) */
- /* float start, end; */
+ ID id;
+
+ /**
+ * The path to the sound file.
+ */
+ /** 1024 = FILE_MAX. */
+ char name[1024];
+
+ /**
+ * The packed file.
+ */
+ struct PackedFile *packedfile;
+
+ /**
+ * The handle for audaspace.
+ */
+ void *handle;
+
+ /**
+ * Deprecated; used for loading pre 2.5 files.
+ */
+ struct PackedFile *newpackedfile;
+ struct Ipo *ipo;
+
+ float volume;
+ float attenuation;
+ float pitch;
+ float min_gain;
+ float max_gain;
+ float distance;
+ short flags;
+ /** Runtime only, always reset in readfile. */
+ short tags;
+ char _pad[4];
+
+ /* unused currently
+ int type;
+ struct bSound *child_sound; */
+
+ /**
+ * The audaspace handle for cache.
+ */
+ void *cache;
+
+ /**
+ * Waveform display data.
+ */
+ void *waveform;
+
+ /**
+ * The audaspace handle that should actually be played back.
+ * Should be cache if cache != NULL; otherwise it's handle
+ */
+ void *playback_handle;
+
+ /** Spinlock for asynchronous loading of sounds. */
+ void *spinlock;
+ /* XXX unused currently (SOUND_TYPE_LIMITER) */
+ /* float start, end; */
} bSound;
/* XXX unused currently */
#if 0
typedef enum eSound_Type {
- SOUND_TYPE_INVALID = -1,
- SOUND_TYPE_FILE = 0,
- SOUND_TYPE_BUFFER = 1,
- SOUND_TYPE_LIMITER = 2,
+ SOUND_TYPE_INVALID = -1,
+ SOUND_TYPE_FILE = 0,
+ SOUND_TYPE_BUFFER = 1,
+ SOUND_TYPE_LIMITER = 2,
} eSound_Type;
#endif
/* spacesound->flag */
enum {
- SND_DRAWFRAMES = 1,
- SND_CFRA_NUM = 2,
+ SND_DRAWFRAMES = 1,
+ SND_CFRA_NUM = 2,
};
/* bSound->flags */
enum {
#ifdef DNA_DEPRECATED
- /* deprecated! used for sound actuator loading */
- SOUND_FLAGS_3D = (1 << 3),
+ /* deprecated! used for sound actuator loading */
+ SOUND_FLAGS_3D = (1 << 3),
#endif
- SOUND_FLAGS_CACHING = (1 << 4),
- SOUND_FLAGS_MONO = (1 << 5),
+ SOUND_FLAGS_CACHING = (1 << 4),
+ SOUND_FLAGS_MONO = (1 << 5),
};
/* bSound->tags */
enum {
- /* Do not free/reset waveform on sound load, only used by undo code. */
- SOUND_TAGS_WAVEFORM_NO_RELOAD = 1 << 0,
- SOUND_TAGS_WAVEFORM_LOADING = (1 << 6),
+ /* Do not free/reset waveform on sound load, only used by undo code. */
+ SOUND_TAGS_WAVEFORM_NO_RELOAD = 1 << 0,
+ SOUND_TAGS_WAVEFORM_LOADING = (1 << 6),
};
/* to DNA_sound_types.h*/
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 919afef4b32..8323a64bce1 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -27,13 +27,13 @@
#include "DNA_defs.h"
#include "DNA_listBase.h"
-#include "DNA_color_types.h" /* for Histogram */
+#include "DNA_color_types.h" /* for Histogram */
#include "DNA_vec_types.h"
-#include "DNA_outliner_types.h" /* for TreeStoreElem */
-#include "DNA_image_types.h" /* ImageUser */
-#include "DNA_movieclip_types.h" /* MovieClipUser */
-#include "DNA_sequence_types.h" /* SequencerScopes */
-#include "DNA_node_types.h" /* for bNodeInstanceKey */
+#include "DNA_outliner_types.h" /* for TreeStoreElem */
+#include "DNA_image_types.h" /* ImageUser */
+#include "DNA_movieclip_types.h" /* MovieClipUser */
+#include "DNA_sequence_types.h" /* SequencerScopes */
+#include "DNA_node_types.h" /* for bNodeInstanceKey */
/* Hum ... Not really nice... but needed for spacebuts. */
#include "DNA_view2d_types.h"
@@ -61,7 +61,6 @@ struct wmTimer;
* define to enable writing (should become the default in a bit). */
//#define WITH_GLOBAL_AREA_WRITING
-
/* -------------------------------------------------------------------- */
/** \name SpaceLink (Base)
* \{ */
@@ -72,12 +71,12 @@ struct wmTimer;
* good to make this explicit.
*/
typedef struct SpaceLink {
- struct SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
+ struct SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
} SpaceLink;
/** \} */
@@ -88,25 +87,25 @@ typedef struct SpaceLink {
/* Info Header */
typedef struct SpaceInfo {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- char rpt_mask;
- char _pad[7];
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ char rpt_mask;
+ char _pad[7];
} SpaceInfo;
/* SpaceInfo.rpt_mask */
typedef enum eSpaceInfo_RptMask {
- INFO_RPT_DEBUG = (1 << 0),
- INFO_RPT_INFO = (1 << 1),
- INFO_RPT_OP = (1 << 2),
- INFO_RPT_WARN = (1 << 3),
- INFO_RPT_ERR = (1 << 4),
+ INFO_RPT_DEBUG = (1 << 0),
+ INFO_RPT_INFO = (1 << 1),
+ INFO_RPT_OP = (1 << 2),
+ INFO_RPT_WARN = (1 << 3),
+ INFO_RPT_ERR = (1 << 4),
} eSpaceInfo_RptMask;
/** \} */
@@ -117,99 +116,99 @@ typedef enum eSpaceInfo_RptMask {
/* Properties Editor */
typedef struct SpaceProperties {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
-
- /* For different kinds of property editors (exposed in the space type selector). */
- short space_subtype;
-
- /** Context tabs. */
- short mainb, mainbo, mainbuser;
- /** Preview is signal to refresh. */
- short preview;
- char _pad[5];
- char flag;
-
- /** Runtime. */
- void *path;
- /** Runtime. */
- int pathflag, dataicon;
- ID *pinid;
-
- void *texuser;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** Deprecated, copied to region. */
+ View2D v2d DNA_DEPRECATED;
+
+ /* For different kinds of property editors (exposed in the space type selector). */
+ short space_subtype;
+
+ /** Context tabs. */
+ short mainb, mainbo, mainbuser;
+ /** Preview is signal to refresh. */
+ short preview;
+ char _pad[5];
+ char flag;
+
+ /** Runtime. */
+ void *path;
+ /** Runtime. */
+ int pathflag, dataicon;
+ ID *pinid;
+
+ void *texuser;
} SpaceProperties;
/* button defines (deprecated) */
#ifdef DNA_DEPRECATED_ALLOW
/* warning: the values of these defines are used in SpaceProperties.tabs[8] */
/* SpaceProperties.mainb new */
-#define CONTEXT_SCENE 0
-#define CONTEXT_OBJECT 1
+# define CONTEXT_SCENE 0
+# define CONTEXT_OBJECT 1
// #define CONTEXT_TYPES 2
-#define CONTEXT_SHADING 3
-#define CONTEXT_EDITING 4
+# define CONTEXT_SHADING 3
+# define CONTEXT_EDITING 4
// #define CONTEXT_SCRIPT 5
// #define CONTEXT_LOGIC 6
/* SpaceProperties.mainb old (deprecated) */
// #define BUTS_VIEW 0
-#define BUTS_LAMP 1
-#define BUTS_MAT 2
-#define BUTS_TEX 3
-#define BUTS_ANIM 4
-#define BUTS_WORLD 5
-#define BUTS_RENDER 6
-#define BUTS_EDIT 7
+# define BUTS_LAMP 1
+# define BUTS_MAT 2
+# define BUTS_TEX 3
+# define BUTS_ANIM 4
+# define BUTS_WORLD 5
+# define BUTS_RENDER 6
+# define BUTS_EDIT 7
// #define BUTS_GAME 8
-#define BUTS_FPAINT 9
-#define BUTS_RADIO 10
-#define BUTS_SCRIPT 11
+# define BUTS_FPAINT 9
+# define BUTS_RADIO 10
+# define BUTS_SCRIPT 11
// #define BUTS_SOUND 12
-#define BUTS_CONSTRAINT 13
+# define BUTS_CONSTRAINT 13
// #define BUTS_EFFECTS 14
#endif /* DNA_DEPRECATED_ALLOW */
/* SpaceProperties.mainb new */
typedef enum eSpaceButtons_Context {
- BCONTEXT_RENDER = 0,
- BCONTEXT_SCENE = 1,
- BCONTEXT_WORLD = 2,
- BCONTEXT_OBJECT = 3,
- BCONTEXT_DATA = 4,
- BCONTEXT_MATERIAL = 5,
- BCONTEXT_TEXTURE = 6,
- BCONTEXT_PARTICLE = 7,
- BCONTEXT_PHYSICS = 8,
- BCONTEXT_BONE = 9,
- BCONTEXT_MODIFIER = 10,
- BCONTEXT_CONSTRAINT = 11,
- BCONTEXT_BONE_CONSTRAINT = 12,
- BCONTEXT_VIEW_LAYER = 13,
- BCONTEXT_TOOL = 14,
- BCONTEXT_SHADERFX = 15,
- BCONTEXT_OUTPUT = 16,
-
- /* always as last... */
- BCONTEXT_TOT,
+ BCONTEXT_RENDER = 0,
+ BCONTEXT_SCENE = 1,
+ BCONTEXT_WORLD = 2,
+ BCONTEXT_OBJECT = 3,
+ BCONTEXT_DATA = 4,
+ BCONTEXT_MATERIAL = 5,
+ BCONTEXT_TEXTURE = 6,
+ BCONTEXT_PARTICLE = 7,
+ BCONTEXT_PHYSICS = 8,
+ BCONTEXT_BONE = 9,
+ BCONTEXT_MODIFIER = 10,
+ BCONTEXT_CONSTRAINT = 11,
+ BCONTEXT_BONE_CONSTRAINT = 12,
+ BCONTEXT_VIEW_LAYER = 13,
+ BCONTEXT_TOOL = 14,
+ BCONTEXT_SHADERFX = 15,
+ BCONTEXT_OUTPUT = 16,
+
+ /* always as last... */
+ BCONTEXT_TOT,
} eSpaceButtons_Context;
/* SpaceProperties.flag */
typedef enum eSpaceButtons_Flag {
- SB_PRV_OSA = (1 << 0),
- SB_PIN_CONTEXT = (1 << 1),
- SB_FLAG_UNUSED_2 = (1 << 2),
- SB_FLAG_UNUSED_3 = (1 << 3),
- /** Do not add materials, particles, etc. in TemplateTextureUser list. */
- SB_TEX_USER_LIMITED = (1 << 3),
- SB_SHADING_CONTEXT = (1 << 4),
+ SB_PRV_OSA = (1 << 0),
+ SB_PIN_CONTEXT = (1 << 1),
+ SB_FLAG_UNUSED_2 = (1 << 2),
+ SB_FLAG_UNUSED_3 = (1 << 3),
+ /** Do not add materials, particles, etc. in TemplateTextureUser list. */
+ SB_TEX_USER_LIMITED = (1 << 3),
+ SB_SHADING_CONTEXT = (1 << 4),
} eSpaceButtons_Flag;
/** \} */
@@ -220,138 +219,131 @@ typedef enum eSpaceButtons_Flag {
/* Outliner */
typedef struct SpaceOutliner {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
-
- ListBase tree;
-
- /* treestore is an ordered list of TreeStoreElem's from outliner tree;
- * Note that treestore may contain duplicate elements if element
- * is used multiple times in outliner tree (e. g. linked objects)
- * Also note that BLI_mempool can not be read/written in DNA directly,
- * therefore readfile.c/writefile.c linearize treestore into TreeStore structure
- */
- struct BLI_mempool *treestore;
-
- /* search stuff */
- char search_string[64];
- struct TreeStoreElem search_tse;
-
- short flag, outlinevis, storeflag, search_flags;
- int filter;
- char filter_state;
- char _pad;
- short filter_id_type;
-
- /**
- * Pointers to treestore elements, grouped by (id, type, nr)
- * in hashtable for faster searching */
- void *treehash;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** Deprecated, copied to region. */
+ View2D v2d DNA_DEPRECATED;
+
+ ListBase tree;
+
+ /* treestore is an ordered list of TreeStoreElem's from outliner tree;
+ * Note that treestore may contain duplicate elements if element
+ * is used multiple times in outliner tree (e. g. linked objects)
+ * Also note that BLI_mempool can not be read/written in DNA directly,
+ * therefore readfile.c/writefile.c linearize treestore into TreeStore structure
+ */
+ struct BLI_mempool *treestore;
+
+ /* search stuff */
+ char search_string[64];
+ struct TreeStoreElem search_tse;
+
+ short flag, outlinevis, storeflag, search_flags;
+ int filter;
+ char filter_state;
+ char _pad;
+ short filter_id_type;
+
+ /**
+ * Pointers to treestore elements, grouped by (id, type, nr)
+ * in hashtable for faster searching */
+ void *treehash;
} SpaceOutliner;
-
/* SpaceOutliner.flag */
typedef enum eSpaceOutliner_Flag {
- SO_TESTBLOCKS = (1 << 0),
- SO_NEWSELECTED = (1 << 1),
- SO_HIDE_RESTRICTCOLS = (1 << 2),
- SO_HIDE_KEYINGSETINFO = (1 << 3),
- SO_SKIP_SORT_ALPHA = (1 << 4),
+ SO_TESTBLOCKS = (1 << 0),
+ SO_NEWSELECTED = (1 << 1),
+ SO_HIDE_RESTRICTCOLS = (1 << 2),
+ SO_HIDE_KEYINGSETINFO = (1 << 3),
+ SO_SKIP_SORT_ALPHA = (1 << 4),
} eSpaceOutliner_Flag;
/* SpaceOutliner.filter */
typedef enum eSpaceOutliner_Filter {
- SO_FILTER_SEARCH = (1 << 0), /* Run-time flag. */
- SO_FILTER_UNUSED_1 = (1 << 1), /* cleared */
- SO_FILTER_NO_OBJECT = (1 << 2),
- SO_FILTER_NO_OB_CONTENT = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */
- SO_FILTER_NO_CHILDREN = (1 << 4),
-
- SO_FILTER_UNUSED_5 = (1 << 5), /* cleared */
- SO_FILTER_NO_OB_MESH = (1 << 6),
- SO_FILTER_NO_OB_ARMATURE = (1 << 7),
- SO_FILTER_NO_OB_EMPTY = (1 << 8),
- SO_FILTER_NO_OB_LAMP = (1 << 9),
- SO_FILTER_NO_OB_CAMERA = (1 << 10),
- SO_FILTER_NO_OB_OTHERS = (1 << 11),
-
- SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */
- SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
- SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */
- SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
- SO_FILTER_NO_COLLECTION = (1 << 16),
-
- SO_FILTER_ID_TYPE = (1 << 17),
+ SO_FILTER_SEARCH = (1 << 0), /* Run-time flag. */
+ SO_FILTER_UNUSED_1 = (1 << 1), /* cleared */
+ SO_FILTER_NO_OBJECT = (1 << 2),
+ SO_FILTER_NO_OB_CONTENT = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */
+ SO_FILTER_NO_CHILDREN = (1 << 4),
+
+ SO_FILTER_UNUSED_5 = (1 << 5), /* cleared */
+ SO_FILTER_NO_OB_MESH = (1 << 6),
+ SO_FILTER_NO_OB_ARMATURE = (1 << 7),
+ SO_FILTER_NO_OB_EMPTY = (1 << 8),
+ SO_FILTER_NO_OB_LAMP = (1 << 9),
+ SO_FILTER_NO_OB_CAMERA = (1 << 10),
+ SO_FILTER_NO_OB_OTHERS = (1 << 11),
+
+ SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */
+ SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
+ SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */
+ SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
+ SO_FILTER_NO_COLLECTION = (1 << 16),
+
+ SO_FILTER_ID_TYPE = (1 << 17),
} eSpaceOutliner_Filter;
-#define SO_FILTER_OB_TYPE (SO_FILTER_NO_OB_MESH | \
- SO_FILTER_NO_OB_ARMATURE | \
- SO_FILTER_NO_OB_EMPTY | \
- SO_FILTER_NO_OB_LAMP | \
- SO_FILTER_NO_OB_CAMERA | \
- SO_FILTER_NO_OB_OTHERS)
+#define SO_FILTER_OB_TYPE \
+ (SO_FILTER_NO_OB_MESH | SO_FILTER_NO_OB_ARMATURE | SO_FILTER_NO_OB_EMPTY | \
+ SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_OTHERS)
-#define SO_FILTER_OB_STATE (SO_FILTER_OB_STATE_VISIBLE | \
- SO_FILTER_OB_STATE_SELECTED | \
- SO_FILTER_OB_STATE_ACTIVE)
+#define SO_FILTER_OB_STATE \
+ (SO_FILTER_OB_STATE_VISIBLE | SO_FILTER_OB_STATE_SELECTED | SO_FILTER_OB_STATE_ACTIVE)
-#define SO_FILTER_ANY (SO_FILTER_NO_OB_CONTENT | \
- SO_FILTER_NO_CHILDREN | \
- SO_FILTER_OB_TYPE | \
- SO_FILTER_OB_STATE | \
- SO_FILTER_NO_COLLECTION)
+#define SO_FILTER_ANY \
+ (SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_OB_TYPE | SO_FILTER_OB_STATE | \
+ SO_FILTER_NO_COLLECTION)
/* SpaceOutliner.filter_state */
typedef enum eSpaceOutliner_StateFilter {
- SO_FILTER_OB_ALL = 0,
- SO_FILTER_OB_VISIBLE = 1,
- SO_FILTER_OB_SELECTED = 2,
- SO_FILTER_OB_ACTIVE = 3,
+ SO_FILTER_OB_ALL = 0,
+ SO_FILTER_OB_VISIBLE = 1,
+ SO_FILTER_OB_SELECTED = 2,
+ SO_FILTER_OB_ACTIVE = 3,
} eSpaceOutliner_StateFilter;
/* SpaceOutliner.outlinevis */
typedef enum eSpaceOutliner_Mode {
- SO_SCENES = 0,
- /* SO_CUR_SCENE = 1, */ /* deprecated! */
- /* SO_VISIBLE = 2, */ /* deprecated! */
- /* SO_SELECTED = 3, */ /* deprecated! */
- /* SO_ACTIVE = 4, */ /* deprecated! */
- /* SO_SAME_TYPE = 5, */ /* deprecated! */
- /* SO_GROUPS = 6, */ /* deprecated! */
- SO_LIBRARIES = 7,
- /* SO_VERSE_SESSION = 8, */ /* deprecated! */
- /* SO_VERSE_MS = 9, */ /* deprecated! */
- SO_SEQUENCE = 10,
- SO_DATA_API = 11,
- /* SO_USERDEF = 12, */ /* deprecated! */
- /* SO_KEYMAP = 13, */ /* deprecated! */
- SO_ID_ORPHANS = 14,
- SO_VIEW_LAYER = 15,
+ SO_SCENES = 0,
+ /* SO_CUR_SCENE = 1, */ /* deprecated! */
+ /* SO_VISIBLE = 2, */ /* deprecated! */
+ /* SO_SELECTED = 3, */ /* deprecated! */
+ /* SO_ACTIVE = 4, */ /* deprecated! */
+ /* SO_SAME_TYPE = 5, */ /* deprecated! */
+ /* SO_GROUPS = 6, */ /* deprecated! */
+ SO_LIBRARIES = 7,
+ /* SO_VERSE_SESSION = 8, */ /* deprecated! */
+ /* SO_VERSE_MS = 9, */ /* deprecated! */
+ SO_SEQUENCE = 10,
+ SO_DATA_API = 11,
+ /* SO_USERDEF = 12, */ /* deprecated! */
+ /* SO_KEYMAP = 13, */ /* deprecated! */
+ SO_ID_ORPHANS = 14,
+ SO_VIEW_LAYER = 15,
} eSpaceOutliner_Mode;
/* SpaceOutliner.storeflag */
typedef enum eSpaceOutliner_StoreFlag {
- /* cleanup tree */
- SO_TREESTORE_CLEANUP = (1 << 0),
- SO_TREESTORE_UNUSED_1 = (1 << 1), /* cleared */
- /* rebuild the tree, similar to cleanup,
- * but defer a call to BKE_outliner_treehash_rebuild_from_treestore instead */
- SO_TREESTORE_REBUILD = (1 << 2),
+ /* cleanup tree */
+ SO_TREESTORE_CLEANUP = (1 << 0),
+ SO_TREESTORE_UNUSED_1 = (1 << 1), /* cleared */
+ /* rebuild the tree, similar to cleanup,
+ * but defer a call to BKE_outliner_treehash_rebuild_from_treestore instead */
+ SO_TREESTORE_REBUILD = (1 << 2),
} eSpaceOutliner_StoreFlag;
/* outliner search flags (SpaceOutliner.search_flags) */
typedef enum eSpaceOutliner_Search_Flags {
- SO_FIND_CASE_SENSITIVE = (1 << 0),
- SO_FIND_COMPLETE = (1 << 1),
- SO_SEARCH_RECURSIVE = (1 << 2),
+ SO_FIND_CASE_SENSITIVE = (1 << 0),
+ SO_FIND_COMPLETE = (1 << 1),
+ SO_SEARCH_RECURSIVE = (1 << 2),
} eSpaceOutliner_Search_Flags;
/** \} */
@@ -361,102 +353,101 @@ typedef enum eSpaceOutliner_Search_Flags {
* \{ */
typedef struct SpaceGraph_Runtime {
- /** #eGraphEdit_Runtime_Flag */
- char flag;
- char _pad[7];
- /** Sampled snapshots of F-Curves used as in-session guides */
- ListBase ghost_curves;
+ /** #eGraphEdit_Runtime_Flag */
+ char flag;
+ char _pad[7];
+ /** Sampled snapshots of F-Curves used as in-session guides */
+ ListBase ghost_curves;
} SpaceGraph_Runtime;
/* 'Graph' Editor (formerly known as the IPO Editor) */
typedef struct SpaceGraph {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
-
- /** Settings for filtering animation data
- * \note we use a pointer due to code-linking issues. */
- struct bDopeSheet *ads;
-
- /** Mode for the Graph editor (eGraphEdit_Mode). */
- short mode;
- /**
- * Time-transform autosnapping settings for Graph editor
- * (eAnimEdit_AutoSnap in DNA_action_types.h).
- */
- short autosnap;
- /** Settings for Graph editor (eGraphEdit_Flag). */
- int flag;
-
- /** Time value for cursor (when in drivers mode; animation uses current frame). */
- float cursorTime;
- /** Cursor value (y-value, x-value is current frame). */
- float cursorVal;
- /** Pivot point for transforms. */
- int around;
- char _pad[4];
-
- SpaceGraph_Runtime runtime;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** Deprecated, copied to region. */
+ View2D v2d DNA_DEPRECATED;
+
+ /** Settings for filtering animation data
+ * \note we use a pointer due to code-linking issues. */
+ struct bDopeSheet *ads;
+
+ /** Mode for the Graph editor (eGraphEdit_Mode). */
+ short mode;
+ /**
+ * Time-transform autosnapping settings for Graph editor
+ * (eAnimEdit_AutoSnap in DNA_action_types.h).
+ */
+ short autosnap;
+ /** Settings for Graph editor (eGraphEdit_Flag). */
+ int flag;
+
+ /** Time value for cursor (when in drivers mode; animation uses current frame). */
+ float cursorTime;
+ /** Cursor value (y-value, x-value is current frame). */
+ float cursorVal;
+ /** Pivot point for transforms. */
+ int around;
+ char _pad[4];
+
+ SpaceGraph_Runtime runtime;
} SpaceGraph;
-
/* SpaceGraph.flag (Graph Editor Settings) */
typedef enum eGraphEdit_Flag {
- /* OLD DEPRECEATED SETTING */
- /* SIPO_LOCK_VIEW = (1 << 0), */
-
- /* don't merge keyframes on the same frame after a transform */
- SIPO_NOTRANSKEYCULL = (1 << 1),
- /* don't show any keyframe handles at all */
- SIPO_NOHANDLES = (1 << 2),
- /* don't show current frame number beside indicator line */
- SIPO_NODRAWCFRANUM = (1 << 3),
- /* show timing in seconds instead of frames */
- SIPO_DRAWTIME = (1 << 4),
- /* only show keyframes for selected F-Curves */
- SIPO_SELCUVERTSONLY = (1 << 5),
- /* draw names of F-Curves beside the respective curves */
- /* NOTE: currently not used */
- SIPO_DRAWNAMES = (1 << 6),
- /* show sliders in channels list */
- SIPO_SLIDERS = (1 << 7),
- /* don't show the horizontal component of the cursor */
- SIPO_NODRAWCURSOR = (1 << 8),
- /* only show handles of selected keyframes */
- SIPO_SELVHANDLESONLY = (1 << 9),
- /* don't perform realtime updates */
- SIPO_NOREALTIMEUPDATES = (1 << 11),
- /* don't draw curves with AA ("beauty-draw") for performance */
- SIPO_BEAUTYDRAW_OFF = (1 << 12),
- /* draw grouped channels with colors set in group */
- SIPO_NODRAWGCOLORS = (1 << 13),
- /* normalize curves on display */
- SIPO_NORMALIZE = (1 << 14),
- SIPO_NORMALIZE_FREEZE = (1 << 15),
- /* show vertical line for every marker */
- SIPO_MARKER_LINES = (1 << 16),
+ /* OLD DEPRECEATED SETTING */
+ /* SIPO_LOCK_VIEW = (1 << 0), */
+
+ /* don't merge keyframes on the same frame after a transform */
+ SIPO_NOTRANSKEYCULL = (1 << 1),
+ /* don't show any keyframe handles at all */
+ SIPO_NOHANDLES = (1 << 2),
+ /* don't show current frame number beside indicator line */
+ SIPO_NODRAWCFRANUM = (1 << 3),
+ /* show timing in seconds instead of frames */
+ SIPO_DRAWTIME = (1 << 4),
+ /* only show keyframes for selected F-Curves */
+ SIPO_SELCUVERTSONLY = (1 << 5),
+ /* draw names of F-Curves beside the respective curves */
+ /* NOTE: currently not used */
+ SIPO_DRAWNAMES = (1 << 6),
+ /* show sliders in channels list */
+ SIPO_SLIDERS = (1 << 7),
+ /* don't show the horizontal component of the cursor */
+ SIPO_NODRAWCURSOR = (1 << 8),
+ /* only show handles of selected keyframes */
+ SIPO_SELVHANDLESONLY = (1 << 9),
+ /* don't perform realtime updates */
+ SIPO_NOREALTIMEUPDATES = (1 << 11),
+ /* don't draw curves with AA ("beauty-draw") for performance */
+ SIPO_BEAUTYDRAW_OFF = (1 << 12),
+ /* draw grouped channels with colors set in group */
+ SIPO_NODRAWGCOLORS = (1 << 13),
+ /* normalize curves on display */
+ SIPO_NORMALIZE = (1 << 14),
+ SIPO_NORMALIZE_FREEZE = (1 << 15),
+ /* show vertical line for every marker */
+ SIPO_MARKER_LINES = (1 << 16),
} eGraphEdit_Flag;
/* SpaceGraph.mode (Graph Editor Mode) */
typedef enum eGraphEdit_Mode {
- /* all animation curves (from all over Blender) */
- SIPO_MODE_ANIMATION = 0,
- /* drivers only */
- SIPO_MODE_DRIVERS = 1,
+ /* all animation curves (from all over Blender) */
+ SIPO_MODE_ANIMATION = 0,
+ /* drivers only */
+ SIPO_MODE_DRIVERS = 1,
} eGraphEdit_Mode;
typedef enum eGraphEdit_Runtime_Flag {
- /** Temporary flag to force channel selections to be synced with main. */
- SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC = (1 << 0),
- /** Temporary flag to force fcurves to recalculate colors. */
- SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR = (1 << 1),
+ /** Temporary flag to force channel selections to be synced with main. */
+ SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC = (1 << 0),
+ /** Temporary flag to force fcurves to recalculate colors. */
+ SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR = (1 << 1),
} eGraphEdit_Runtime_Flag;
/** \} */
@@ -467,41 +458,41 @@ typedef enum eGraphEdit_Runtime_Flag {
/* NLA Editor */
typedef struct SpaceNla {
- struct SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** This uses the same settings as autosnap for Action Editor. */
- short autosnap;
- short flag;
- char _pad[4];
-
- struct bDopeSheet *ads;
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
+ struct SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** This uses the same settings as autosnap for Action Editor. */
+ short autosnap;
+ short flag;
+ char _pad[4];
+
+ struct bDopeSheet *ads;
+ /** Deprecated, copied to region. */
+ View2D v2d DNA_DEPRECATED;
} SpaceNla;
/* SpaceNla.flag */
typedef enum eSpaceNla_Flag {
- SNLA_FLAG_UNUSED_0 = (1 << 0),
- SNLA_FLAG_UNUSED_1 = (1 << 1),
- /* draw timing in seconds instead of frames */
- SNLA_DRAWTIME = (1 << 2),
- SNLA_FLAG_UNUSED_3 = (1 << 3),
- /* don't draw frame number beside frame indicator */
- SNLA_NODRAWCFRANUM = (1 << 4),
- /* don't draw influence curves on strips */
- SNLA_NOSTRIPCURVES = (1 << 5),
- /* don't perform realtime updates */
- SNLA_NOREALTIMEUPDATES = (1 << 6),
- /* don't show local strip marker indications */
- SNLA_NOLOCALMARKERS = (1 << 7),
- /* show vertical line for every marker */
- SNLA_SHOW_MARKER_LINES = (1 << 8),
+ SNLA_FLAG_UNUSED_0 = (1 << 0),
+ SNLA_FLAG_UNUSED_1 = (1 << 1),
+ /* draw timing in seconds instead of frames */
+ SNLA_DRAWTIME = (1 << 2),
+ SNLA_FLAG_UNUSED_3 = (1 << 3),
+ /* don't draw frame number beside frame indicator */
+ SNLA_NODRAWCFRANUM = (1 << 4),
+ /* don't draw influence curves on strips */
+ SNLA_NOSTRIPCURVES = (1 << 5),
+ /* don't perform realtime updates */
+ SNLA_NOREALTIMEUPDATES = (1 << 6),
+ /* don't show local strip marker indications */
+ SNLA_NOLOCALMARKERS = (1 << 7),
+ /* show vertical line for every marker */
+ SNLA_SHOW_MARKER_LINES = (1 << 8),
} eSpaceNla_Flag;
/** \} */
@@ -512,115 +503,113 @@ typedef enum eSpaceNla_Flag {
/* Sequencer */
typedef struct SpaceSeq {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
-
- /** Deprecated: offset for drawing the image preview. */
- float xof DNA_DEPRECATED, yof DNA_DEPRECATED;
- /** Weird name for the sequencer subtype (seq, image, luma... etc). */
- short mainb;
- /** ESpaceSeq_Proxy_RenderSize. */
- short render_size;
- short chanshown;
- short zebra;
- int flag;
- /** Deprecated, handled by View2D now. */
- float zoom DNA_DEPRECATED;
- /** See SEQ_VIEW_* below. */
- int view;
- int overlay_type;
- /** Overlay an image of the editing on below the strips. */
- int draw_flag;
- char _pad[4];
-
- /** Grease-pencil data. */
- struct bGPdata *gpd;
-
- /** Different scoped displayed in space. */
- struct SequencerScopes scopes;
-
- /** Multiview current eye - for internal use. */
- char multiview_eye;
- char _pad2[7];
-
- struct GPUFX *compositor;
- void *_pad3;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** Deprecated, copied to region. */
+ View2D v2d DNA_DEPRECATED;
+
+ /** Deprecated: offset for drawing the image preview. */
+ float xof DNA_DEPRECATED, yof DNA_DEPRECATED;
+ /** Weird name for the sequencer subtype (seq, image, luma... etc). */
+ short mainb;
+ /** ESpaceSeq_Proxy_RenderSize. */
+ short render_size;
+ short chanshown;
+ short zebra;
+ int flag;
+ /** Deprecated, handled by View2D now. */
+ float zoom DNA_DEPRECATED;
+ /** See SEQ_VIEW_* below. */
+ int view;
+ int overlay_type;
+ /** Overlay an image of the editing on below the strips. */
+ int draw_flag;
+ char _pad[4];
+
+ /** Grease-pencil data. */
+ struct bGPdata *gpd;
+
+ /** Different scoped displayed in space. */
+ struct SequencerScopes scopes;
+
+ /** Multiview current eye - for internal use. */
+ char multiview_eye;
+ char _pad2[7];
+
+ struct GPUFX *compositor;
+ void *_pad3;
} SpaceSeq;
-
/* SpaceSeq.mainb */
typedef enum eSpaceSeq_RegionType {
- SEQ_DRAW_SEQUENCE = 0,
- SEQ_DRAW_IMG_IMBUF = 1,
- SEQ_DRAW_IMG_WAVEFORM = 2,
- SEQ_DRAW_IMG_VECTORSCOPE = 3,
- SEQ_DRAW_IMG_HISTOGRAM = 4,
+ SEQ_DRAW_SEQUENCE = 0,
+ SEQ_DRAW_IMG_IMBUF = 1,
+ SEQ_DRAW_IMG_WAVEFORM = 2,
+ SEQ_DRAW_IMG_VECTORSCOPE = 3,
+ SEQ_DRAW_IMG_HISTOGRAM = 4,
} eSpaceSeq_RegionType;
/* SpaceSeq.draw_flag */
typedef enum eSpaceSeq_DrawFlag {
- SEQ_DRAW_BACKDROP = (1 << 0),
- SEQ_DRAW_OFFSET_EXT = (1 << 1),
+ SEQ_DRAW_BACKDROP = (1 << 0),
+ SEQ_DRAW_OFFSET_EXT = (1 << 1),
} eSpaceSeq_DrawFlag;
-
/* SpaceSeq.flag */
typedef enum eSpaceSeq_Flag {
- SEQ_DRAWFRAMES = (1 << 0),
- SEQ_MARKER_TRANS = (1 << 1),
- SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
- SEQ_SHOW_SAFE_MARGINS = (1 << 3),
- SEQ_SHOW_GPENCIL = (1 << 4),
- SEQ_NO_DRAW_CFRANUM = (1 << 5),
- SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
- SEQ_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
- SEQ_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
- SEQ_SHOW_SAFE_CENTER = (1 << 9),
- SEQ_SHOW_METADATA = (1 << 10),
- SEQ_SHOW_MARKER_LINES = (1 << 11),
+ SEQ_DRAWFRAMES = (1 << 0),
+ SEQ_MARKER_TRANS = (1 << 1),
+ SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
+ SEQ_SHOW_SAFE_MARGINS = (1 << 3),
+ SEQ_SHOW_GPENCIL = (1 << 4),
+ SEQ_NO_DRAW_CFRANUM = (1 << 5),
+ SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
+ SEQ_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
+ SEQ_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
+ SEQ_SHOW_SAFE_CENTER = (1 << 9),
+ SEQ_SHOW_METADATA = (1 << 10),
+ SEQ_SHOW_MARKER_LINES = (1 << 11),
} eSpaceSeq_Flag;
/* SpaceSeq.view */
typedef enum eSpaceSeq_Displays {
- SEQ_VIEW_SEQUENCE = 1,
- SEQ_VIEW_PREVIEW = 2,
- SEQ_VIEW_SEQUENCE_PREVIEW = 3,
+ SEQ_VIEW_SEQUENCE = 1,
+ SEQ_VIEW_PREVIEW = 2,
+ SEQ_VIEW_SEQUENCE_PREVIEW = 3,
} eSpaceSeq_Dispays;
/* SpaceSeq.render_size */
typedef enum eSpaceSeq_Proxy_RenderSize {
- SEQ_PROXY_RENDER_SIZE_NONE = -1,
- SEQ_PROXY_RENDER_SIZE_SCENE = 0,
- SEQ_PROXY_RENDER_SIZE_25 = 25,
- SEQ_PROXY_RENDER_SIZE_50 = 50,
- SEQ_PROXY_RENDER_SIZE_75 = 75,
- SEQ_PROXY_RENDER_SIZE_100 = 99,
- SEQ_PROXY_RENDER_SIZE_FULL = 100,
+ SEQ_PROXY_RENDER_SIZE_NONE = -1,
+ SEQ_PROXY_RENDER_SIZE_SCENE = 0,
+ SEQ_PROXY_RENDER_SIZE_25 = 25,
+ SEQ_PROXY_RENDER_SIZE_50 = 50,
+ SEQ_PROXY_RENDER_SIZE_75 = 75,
+ SEQ_PROXY_RENDER_SIZE_100 = 99,
+ SEQ_PROXY_RENDER_SIZE_FULL = 100,
} eSpaceSeq_Proxy_RenderSize;
typedef struct MaskSpaceInfo {
- /* **** mask editing **** */
- struct Mask *mask;
- /* draw options */
- char draw_flag;
- char draw_type;
- char overlay_mode;
- char _pad3[5];
+ /* **** mask editing **** */
+ struct Mask *mask;
+ /* draw options */
+ char draw_flag;
+ char draw_type;
+ char overlay_mode;
+ char _pad3[5];
} MaskSpaceInfo;
/* SpaceSeq.mainb */
typedef enum eSpaceSeq_OverlayType {
- SEQ_DRAW_OVERLAY_RECT = 0,
- SEQ_DRAW_OVERLAY_REFERENCE = 1,
- SEQ_DRAW_OVERLAY_CURRENT = 2,
+ SEQ_DRAW_OVERLAY_RECT = 0,
+ SEQ_DRAW_OVERLAY_REFERENCE = 1,
+ SEQ_DRAW_OVERLAY_CURRENT = 2,
} eSpaceSeq_OverlayType;
/** \} */
@@ -631,167 +620,167 @@ typedef enum eSpaceSeq_OverlayType {
/* Config and Input for File Selector */
typedef struct FileSelectParams {
- /** Title, also used for the text of the execute button. */
- char title[96];
- /**
- * Directory, FILE_MAX_LIBEXTRA, 1024 + 66, this is for extreme case when 1023 length path
- * needs to be linked in, where foo.blend/Armature need adding
- */
- char dir[1090];
- char file[256];
-
- char renamefile[256];
- short rename_flag;
-
- /** List of filetypes to filter (FILE_MAXFILE). */
- char filter_glob[256];
-
- /** Text items name must match to be shown. */
- char filter_search[64];
- /** Same as filter, but for ID types (aka library groups). */
- int filter_id;
-
- /** Active file used for keyboard navigation. */
- int active_file;
- /** File under cursor. */
- int highlight_file;
- int sel_first;
- int sel_last;
- unsigned short thumbnail_size;
- char _pad1[2];
-
- /* short */
- /** XXXXX for now store type here, should be moved to the operator. */
- short type;
- /** Settings for filter, hiding dots files. */
- short flag;
- /** Sort order. */
- short sort;
- /** Display mode flag. */
- short display;
- short display_previous;
- /** Filter when (flags & FILE_FILTER) is true. */
- char _pad2[2];
- int filter;
-
- /** Max number of levels in dirtree to show at once, 0 to disable recursion. */
- short recursion_level;
-
- /* XXX --- still unused -- */
- /** Show font preview. */
- short f_fp;
- /** String to use for font preview. */
- char fp_str[8];
-
- /* XXX --- end unused -- */
+ /** Title, also used for the text of the execute button. */
+ char title[96];
+ /**
+ * Directory, FILE_MAX_LIBEXTRA, 1024 + 66, this is for extreme case when 1023 length path
+ * needs to be linked in, where foo.blend/Armature need adding
+ */
+ char dir[1090];
+ char file[256];
+
+ char renamefile[256];
+ short rename_flag;
+
+ /** List of filetypes to filter (FILE_MAXFILE). */
+ char filter_glob[256];
+
+ /** Text items name must match to be shown. */
+ char filter_search[64];
+ /** Same as filter, but for ID types (aka library groups). */
+ int filter_id;
+
+ /** Active file used for keyboard navigation. */
+ int active_file;
+ /** File under cursor. */
+ int highlight_file;
+ int sel_first;
+ int sel_last;
+ unsigned short thumbnail_size;
+ char _pad1[2];
+
+ /* short */
+ /** XXXXX for now store type here, should be moved to the operator. */
+ short type;
+ /** Settings for filter, hiding dots files. */
+ short flag;
+ /** Sort order. */
+ short sort;
+ /** Display mode flag. */
+ short display;
+ short display_previous;
+ /** Filter when (flags & FILE_FILTER) is true. */
+ char _pad2[2];
+ int filter;
+
+ /** Max number of levels in dirtree to show at once, 0 to disable recursion. */
+ short recursion_level;
+
+ /* XXX --- still unused -- */
+ /** Show font preview. */
+ short f_fp;
+ /** String to use for font preview. */
+ char fp_str[8];
+
+ /* XXX --- end unused -- */
} FileSelectParams;
/* File Browser */
typedef struct SpaceFile {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- char _pad1[4];
- int scroll_offset;
-
- /** Config and input for file select. */
- struct FileSelectParams *params;
-
- /** Holds the list of files to show. */
- struct FileList *files;
-
- /** Holds the list of previous directories to show. */
- ListBase *folders_prev;
- /** Holds the list of next directories (pushed from previous) to show. */
- ListBase *folders_next;
-
- /* operator that is invoking fileselect
- * op->exec() will be called on the 'Load' button.
- * if operator provides op->cancel(), then this will be invoked
- * on the cancel button.
- */
- struct wmOperator *op;
-
- struct wmTimer *smoothscroll_timer;
- struct wmTimer *previews_timer;
-
- struct FileLayout *layout;
-
- short recentnr, bookmarknr;
- short systemnr, system_bookmarknr;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ char _pad1[4];
+ int scroll_offset;
+
+ /** Config and input for file select. */
+ struct FileSelectParams *params;
+
+ /** Holds the list of files to show. */
+ struct FileList *files;
+
+ /** Holds the list of previous directories to show. */
+ ListBase *folders_prev;
+ /** Holds the list of next directories (pushed from previous) to show. */
+ ListBase *folders_next;
+
+ /* operator that is invoking fileselect
+ * op->exec() will be called on the 'Load' button.
+ * if operator provides op->cancel(), then this will be invoked
+ * on the cancel button.
+ */
+ struct wmOperator *op;
+
+ struct wmTimer *smoothscroll_timer;
+ struct wmTimer *previews_timer;
+
+ struct FileLayout *layout;
+
+ short recentnr, bookmarknr;
+ short systemnr, system_bookmarknr;
} SpaceFile;
/* FileSelectParams.display */
enum eFileDisplayType {
- FILE_DEFAULTDISPLAY = 0,
- FILE_SHORTDISPLAY = 1,
- FILE_LONGDISPLAY = 2,
- FILE_IMGDISPLAY = 3,
+ FILE_DEFAULTDISPLAY = 0,
+ FILE_SHORTDISPLAY = 1,
+ FILE_LONGDISPLAY = 2,
+ FILE_IMGDISPLAY = 3,
};
/* FileSelectParams.sort */
enum eFileSortType {
- FILE_SORT_NONE = 0,
- FILE_SORT_ALPHA = 1,
- FILE_SORT_EXTENSION = 2,
- FILE_SORT_TIME = 3,
- FILE_SORT_SIZE = 4,
+ FILE_SORT_NONE = 0,
+ FILE_SORT_ALPHA = 1,
+ FILE_SORT_EXTENSION = 2,
+ FILE_SORT_TIME = 3,
+ FILE_SORT_SIZE = 4,
};
/* these values need to be hardcoded in structs, dna does not recognize defines */
/* also defined in BKE */
-#define FILE_MAXDIR 768
-#define FILE_MAXFILE 256
-#define FILE_MAX 1024
+#define FILE_MAXDIR 768
+#define FILE_MAXFILE 256
+#define FILE_MAX 1024
-#define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
+#define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
/* filesel types */
-#define FILE_UNIX 8
-#define FILE_BLENDER 8 /* don't display relative paths */
-#define FILE_SPECIAL 9
+#define FILE_UNIX 8
+#define FILE_BLENDER 8 /* don't display relative paths */
+#define FILE_SPECIAL 9
-#define FILE_LOADLIB 1
-#define FILE_MAIN 2
+#define FILE_LOADLIB 1
+#define FILE_MAIN 2
/* filesel op property -> action */
typedef enum eFileSel_Action {
- FILE_OPENFILE = 0,
- FILE_SAVE = 1,
+ FILE_OPENFILE = 0,
+ FILE_SAVE = 1,
} eFileSel_Action;
/* sfile->params->flag */
/* Note: short flag, also used as 16 lower bits of flags in link/append code
* (WM and BLO code area, see BLO_LibLinkFlags in BLO_readfile.h). */
typedef enum eFileSel_Params_Flag {
- FILE_PARAMS_FLAG_UNUSED_1 = (1 << 0), /* cleared */
- FILE_RELPATH = (1 << 1),
- FILE_LINK = (1 << 2),
- FILE_HIDE_DOT = (1 << 3),
- FILE_AUTOSELECT = (1 << 4),
- FILE_ACTIVE_COLLECTION = (1 << 5),
- FILE_PARAMS_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- FILE_DIRSEL_ONLY = (1 << 7),
- FILE_FILTER = (1 << 8),
- FILE_PARAMS_FLAG_UNUSED_9 = (1 << 9), /* cleared */
- FILE_GROUP_INSTANCE = (1 << 10),
+ FILE_PARAMS_FLAG_UNUSED_1 = (1 << 0), /* cleared */
+ FILE_RELPATH = (1 << 1),
+ FILE_LINK = (1 << 2),
+ FILE_HIDE_DOT = (1 << 3),
+ FILE_AUTOSELECT = (1 << 4),
+ FILE_ACTIVE_COLLECTION = (1 << 5),
+ FILE_PARAMS_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ FILE_DIRSEL_ONLY = (1 << 7),
+ FILE_FILTER = (1 << 8),
+ FILE_PARAMS_FLAG_UNUSED_9 = (1 << 9), /* cleared */
+ FILE_GROUP_INSTANCE = (1 << 10),
} eFileSel_Params_Flag;
/* sfile->params->rename_flag */
/* Note: short flag. Defined as bitflags, but currently only used as exclusive status markers... */
typedef enum eFileSel_Params_RenameFlag {
- /* Used when we only have the name of the entry we want to rename, but not yet access to its matching file entry. */
- FILE_PARAMS_RENAME_PENDING = 1 << 0,
- /* We are actually renaming an entry. */
- FILE_PARAMS_RENAME_ACTIVE = 1 << 1,
- /* Used to scroll to newly renamed entry. */
- FILE_PARAMS_RENAME_POSTSCROLL_PENDING = 1 << 2,
- FILE_PARAMS_RENAME_POSTSCROLL_ACTIVE = 1 << 3,
+ /* Used when we only have the name of the entry we want to rename, but not yet access to its matching file entry. */
+ FILE_PARAMS_RENAME_PENDING = 1 << 0,
+ /* We are actually renaming an entry. */
+ FILE_PARAMS_RENAME_ACTIVE = 1 << 1,
+ /* Used to scroll to newly renamed entry. */
+ FILE_PARAMS_RENAME_POSTSCROLL_PENDING = 1 << 2,
+ FILE_PARAMS_RENAME_POSTSCROLL_ACTIVE = 1 << 3,
} eFileSel_Params_RenameFlag;
/* files in filesel list: file types
@@ -799,35 +788,35 @@ typedef enum eFileSel_Params_RenameFlag {
* but since we do not lack of bytes currently...
*/
typedef enum eFileSel_File_Types {
- FILE_TYPE_BLENDER = (1 << 2),
- FILE_TYPE_BLENDER_BACKUP = (1 << 3),
- FILE_TYPE_IMAGE = (1 << 4),
- FILE_TYPE_MOVIE = (1 << 5),
- FILE_TYPE_PYSCRIPT = (1 << 6),
- FILE_TYPE_FTFONT = (1 << 7),
- FILE_TYPE_SOUND = (1 << 8),
- FILE_TYPE_TEXT = (1 << 9),
- /* 1 << 10 was FILE_TYPE_MOVIE_ICON, got rid of this so free slot for future type... */
- /** represents folders for filtering */
- FILE_TYPE_FOLDER = (1 << 11),
- FILE_TYPE_BTX = (1 << 12),
- FILE_TYPE_COLLADA = (1 << 13),
- /** from filter_glob operator property */
- FILE_TYPE_OPERATOR = (1 << 14),
- FILE_TYPE_APPLICATIONBUNDLE = (1 << 15),
- FILE_TYPE_ALEMBIC = (1 << 16),
-
- /** An FS directory (i.e. S_ISDIR on its path is true). */
- FILE_TYPE_DIR = (1 << 30),
- FILE_TYPE_BLENDERLIB = (1u << 31),
+ FILE_TYPE_BLENDER = (1 << 2),
+ FILE_TYPE_BLENDER_BACKUP = (1 << 3),
+ FILE_TYPE_IMAGE = (1 << 4),
+ FILE_TYPE_MOVIE = (1 << 5),
+ FILE_TYPE_PYSCRIPT = (1 << 6),
+ FILE_TYPE_FTFONT = (1 << 7),
+ FILE_TYPE_SOUND = (1 << 8),
+ FILE_TYPE_TEXT = (1 << 9),
+ /* 1 << 10 was FILE_TYPE_MOVIE_ICON, got rid of this so free slot for future type... */
+ /** represents folders for filtering */
+ FILE_TYPE_FOLDER = (1 << 11),
+ FILE_TYPE_BTX = (1 << 12),
+ FILE_TYPE_COLLADA = (1 << 13),
+ /** from filter_glob operator property */
+ FILE_TYPE_OPERATOR = (1 << 14),
+ FILE_TYPE_APPLICATIONBUNDLE = (1 << 15),
+ FILE_TYPE_ALEMBIC = (1 << 16),
+
+ /** An FS directory (i.e. S_ISDIR on its path is true). */
+ FILE_TYPE_DIR = (1 << 30),
+ FILE_TYPE_BLENDERLIB = (1u << 31),
} eFileSel_File_Types;
/* Selection Flags in filesel: struct direntry, unsigned char selflag */
typedef enum eDirEntry_SelectFlag {
-/* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */
- FILE_SEL_HIGHLIGHTED = (1 << 2),
- FILE_SEL_SELECTED = (1 << 3),
- FILE_SEL_EDITING = (1 << 4),
+ /* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */
+ FILE_SEL_HIGHLIGHTED = (1 << 2),
+ FILE_SEL_SELECTED = (1 << 3),
+ FILE_SEL_EDITING = (1 << 4),
} eDirEntry_SelectFlag;
/* ***** Related to file browser, but never saved in DNA, only here to help with RNA. ***** */
@@ -838,42 +827,42 @@ typedef enum eDirEntry_SelectFlag {
* asset/variant/version (concatenating the three into a single 48 bytes one).
* Assumed to be 128bits, handled as four integers due to lack of real bytes proptype in RNA :|.
*/
-#define ASSET_UUID_LENGTH 16
+#define ASSET_UUID_LENGTH 16
/* Used to communicate with asset engines outside of 'import' context. */
#
#
typedef struct AssetUUID {
- int uuid_asset[4];
- int uuid_variant[4];
- int uuid_revision[4];
+ int uuid_asset[4];
+ int uuid_variant[4];
+ int uuid_revision[4];
} AssetUUID;
#
#
typedef struct AssetUUIDList {
- AssetUUID *uuids;
- int nbr_uuids;
- char _pad[4];
+ AssetUUID *uuids;
+ int nbr_uuids;
+ char _pad[4];
} AssetUUIDList;
/* Container for a revision, only relevant in asset context. */
#
#
typedef struct FileDirEntryRevision {
- struct FileDirEntryRevision *next, *prev;
+ struct FileDirEntryRevision *next, *prev;
- char *comment;
- void *_pad;
+ char *comment;
+ void *_pad;
- int uuid[4];
+ int uuid[4];
- uint64_t size;
- int64_t time;
- /* Temp caching of UI-generated strings... */
- char size_str[16];
- char time_str[8];
- char date_str[16];
+ uint64_t size;
+ int64_t time;
+ /* Temp caching of UI-generated strings... */
+ char size_str[16];
+ char time_str[8];
+ char date_str[16];
} FileDirEntryRevision;
/* Container for a variant, only relevant in asset context.
@@ -881,52 +870,52 @@ typedef struct FileDirEntryRevision {
#
#
typedef struct FileDirEntryVariant {
- struct FileDirEntryVariant *next, *prev;
+ struct FileDirEntryVariant *next, *prev;
- int uuid[4];
- char *name;
- char *description;
+ int uuid[4];
+ char *name;
+ char *description;
- ListBase revisions;
- int nbr_revisions;
- int act_revision;
+ ListBase revisions;
+ int nbr_revisions;
+ int act_revision;
} FileDirEntryVariant;
/* Container for mere direntry, with additional asset-related data. */
#
#
typedef struct FileDirEntry {
- struct FileDirEntry *next, *prev;
+ struct FileDirEntry *next, *prev;
- int uuid[4];
- char *name;
- char *description;
+ int uuid[4];
+ char *name;
+ char *description;
- /* Either point to active variant/revision if available, or own entry
- * (in mere filebrowser case). */
- FileDirEntryRevision *entry;
+ /* Either point to active variant/revision if available, or own entry
+ * (in mere filebrowser case). */
+ FileDirEntryRevision *entry;
- /** #eFileSel_File_Types. */
- int typeflag;
- /** ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
- int blentype;
+ /** #eFileSel_File_Types. */
+ int typeflag;
+ /** ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
+ int blentype;
- char *relpath;
+ char *relpath;
- /** TODO: make this a real ID pointer? */
- void *poin;
- struct ImBuf *image;
+ /** TODO: make this a real ID pointer? */
+ void *poin;
+ struct ImBuf *image;
- /* Tags are for info only, most of filtering is done in asset engine. */
- char **tags;
- int nbr_tags;
+ /* Tags are for info only, most of filtering is done in asset engine. */
+ char **tags;
+ int nbr_tags;
- short status;
- short flags;
+ short status;
+ short flags;
- ListBase variants;
- int nbr_variants;
- int act_variant;
+ ListBase variants;
+ int nbr_variants;
+ int act_variant;
} FileDirEntry;
/* Array of direntries. */
@@ -939,24 +928,24 @@ typedef struct FileDirEntry {
#
#
typedef struct FileDirEntryArr {
- ListBase entries;
- int nbr_entries;
- int nbr_entries_filtered;
- int entry_idx_start, entry_idx_end;
+ ListBase entries;
+ int nbr_entries;
+ int nbr_entries_filtered;
+ int entry_idx_start, entry_idx_end;
- /** FILE_MAX. */
- char root[1024];
+ /** FILE_MAX. */
+ char root[1024];
} FileDirEntryArr;
/* FileDirEntry.status */
enum {
- ASSET_STATUS_LOCAL = 1 << 0, /* If active uuid is available locally/immediately. */
- ASSET_STATUS_LATEST = 1 << 1, /* If active uuid is latest available version. */
+ ASSET_STATUS_LOCAL = 1 << 0, /* If active uuid is available locally/immediately. */
+ ASSET_STATUS_LATEST = 1 << 1, /* If active uuid is latest available version. */
};
/* FileDirEntry.flags */
enum {
- FILE_ENTRY_INVALID_PREVIEW = 1 << 0, /* The preview for this entry could not be generated. */
+ FILE_ENTRY_INVALID_PREVIEW = 1 << 0, /* The preview for this entry could not be generated. */
};
/** \} */
@@ -967,151 +956,150 @@ enum {
/* Image/UV Editor */
typedef struct SpaceImage {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- struct Image *image;
- struct ImageUser iuser;
-
- /** Histogram waveform and vectorscope. */
- struct Scopes scopes;
- /** Sample line histogram. */
- struct Histogram sample_line_hist;
-
- /** Grease pencil data. */
- struct bGPdata *gpd;
-
- /** UV editor 2d cursor. */
- float cursor[2];
- /** User defined offset, image is centered. */
- float xof, yof;
- /** User defined zoom level. */
- float zoom;
- /** Storage for offset while render drawing. */
- float centx, centy;
-
- /** View/paint/mask. */
- char mode;
- /* Storage for sub-space types. */
- char mode_prev;
-
- char pin;
- char _pad1;
- /**
- * The currently active tile of the image when tile is enabled,
- * is kept in sync with the active faces tile.
- */
- short curtile;
- short lock;
- /** UV draw type. */
- char dt_uv;
- /** Sticky selection type. */
- char sticky;
- char dt_uvstretch;
- char around;
-
- int flag;
-
- char pixel_snap_mode;
- char _pad2[3];
-
- MaskSpaceInfo mask_info;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ struct Image *image;
+ struct ImageUser iuser;
+
+ /** Histogram waveform and vectorscope. */
+ struct Scopes scopes;
+ /** Sample line histogram. */
+ struct Histogram sample_line_hist;
+
+ /** Grease pencil data. */
+ struct bGPdata *gpd;
+
+ /** UV editor 2d cursor. */
+ float cursor[2];
+ /** User defined offset, image is centered. */
+ float xof, yof;
+ /** User defined zoom level. */
+ float zoom;
+ /** Storage for offset while render drawing. */
+ float centx, centy;
+
+ /** View/paint/mask. */
+ char mode;
+ /* Storage for sub-space types. */
+ char mode_prev;
+
+ char pin;
+ char _pad1;
+ /**
+ * The currently active tile of the image when tile is enabled,
+ * is kept in sync with the active faces tile.
+ */
+ short curtile;
+ short lock;
+ /** UV draw type. */
+ char dt_uv;
+ /** Sticky selection type. */
+ char sticky;
+ char dt_uvstretch;
+ char around;
+
+ int flag;
+
+ char pixel_snap_mode;
+ char _pad2[3];
+
+ MaskSpaceInfo mask_info;
} SpaceImage;
-
/* SpaceImage.dt_uv */
typedef enum eSpaceImage_UVDT {
- SI_UVDT_OUTLINE = 0,
- SI_UVDT_DASH = 1,
- SI_UVDT_BLACK = 2,
- SI_UVDT_WHITE = 3,
+ SI_UVDT_OUTLINE = 0,
+ SI_UVDT_DASH = 1,
+ SI_UVDT_BLACK = 2,
+ SI_UVDT_WHITE = 3,
} eSpaceImage_UVDT;
/* SpaceImage.dt_uvstretch */
typedef enum eSpaceImage_UVDT_Stretch {
- SI_UVDT_STRETCH_ANGLE = 0,
- SI_UVDT_STRETCH_AREA = 1,
+ SI_UVDT_STRETCH_ANGLE = 0,
+ SI_UVDT_STRETCH_AREA = 1,
} eSpaceImage_UVDT_Stretch;
/* SpaceImage.pixel_snap_mode */
typedef enum eSpaceImage_PixelSnapMode {
- SI_PIXEL_SNAP_DISABLED = 0,
- SI_PIXEL_SNAP_CENTER = 1,
- SI_PIXEL_SNAP_CORNER = 2,
+ SI_PIXEL_SNAP_DISABLED = 0,
+ SI_PIXEL_SNAP_CENTER = 1,
+ SI_PIXEL_SNAP_CORNER = 2,
} eSpaceImage_Snap_Mode;
/* SpaceImage.mode */
typedef enum eSpaceImage_Mode {
- SI_MODE_VIEW = 0,
- SI_MODE_PAINT = 1,
- SI_MODE_MASK = 2,
- SI_MODE_UV = 3,
+ SI_MODE_VIEW = 0,
+ SI_MODE_PAINT = 1,
+ SI_MODE_MASK = 2,
+ SI_MODE_UV = 3,
} eSpaceImage_Mode;
/* SpaceImage.sticky
* Note DISABLE should be 0, however would also need to re-arrange icon order,
* also, sticky loc is the default mode so this means we don't need to 'do_versions' */
typedef enum eSpaceImage_Sticky {
- SI_STICKY_LOC = 0,
- SI_STICKY_DISABLE = 1,
- SI_STICKY_VERTEX = 2,
+ SI_STICKY_LOC = 0,
+ SI_STICKY_DISABLE = 1,
+ SI_STICKY_VERTEX = 2,
} eSpaceImage_Sticky;
/* SpaceImage.flag */
typedef enum eSpaceImage_Flag {
- SI_FLAG_UNUSED_0 = (1 << 0), /* cleared */
- SI_FLAG_UNUSED_1 = (1 << 1), /* cleared */
- SI_CLIP_UV = (1 << 2),
- SI_FLAG_UNUSED_3 = (1 << 3), /* cleared */
- SI_NO_DRAWFACES = (1 << 4),
- SI_DRAWSHADOW = (1 << 5),
- SI_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- SI_FLAG_UNUSED_7 = (1 << 7), /* cleared */
- SI_FLAG_UNUSED_8 = (1 << 8), /* cleared */
- SI_COORDFLOATS = (1 << 9),
- SI_FLAG_UNUSED_10 = (1 << 10),
- SI_LIVE_UNWRAP = (1 << 11),
- SI_USE_ALPHA = (1 << 12),
- SI_SHOW_ALPHA = (1 << 13),
- SI_SHOW_ZBUF = (1 << 14),
-
- /* next two for render window display */
- SI_PREVSPACE = (1 << 15),
- SI_FULLWINDOW = (1 << 16),
-
- SI_FLAG_UNUSED_17 = (1 << 17), /* cleared */
- SI_FLAG_UNUSED_18 = (1 << 18), /* cleared */
-
- /* this means that the image is drawn until it reaches the view edge,
- * in the image view, it's unrelated to the 'tile' mode for texface
- */
- SI_DRAW_TILE = (1 << 19),
- SI_SMOOTH_UV = (1 << 20),
- SI_DRAW_STRETCH = (1 << 21),
- SI_SHOW_GPENCIL = (1 << 22),
- SI_FLAG_UNUSED_23 = (1 << 23), /* cleared */
-
- SI_FLAG_UNUSED_24 = (1 << 24),
-
- SI_NO_DRAW_TEXPAINT = (1 << 25),
- SI_DRAW_METADATA = (1 << 26),
-
- SI_SHOW_R = (1 << 27),
- SI_SHOW_G = (1 << 28),
- SI_SHOW_B = (1 << 29),
-
- SI_NO_DRAWEDGES = (1 << 30),
+ SI_FLAG_UNUSED_0 = (1 << 0), /* cleared */
+ SI_FLAG_UNUSED_1 = (1 << 1), /* cleared */
+ SI_CLIP_UV = (1 << 2),
+ SI_FLAG_UNUSED_3 = (1 << 3), /* cleared */
+ SI_NO_DRAWFACES = (1 << 4),
+ SI_DRAWSHADOW = (1 << 5),
+ SI_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ SI_FLAG_UNUSED_7 = (1 << 7), /* cleared */
+ SI_FLAG_UNUSED_8 = (1 << 8), /* cleared */
+ SI_COORDFLOATS = (1 << 9),
+ SI_FLAG_UNUSED_10 = (1 << 10),
+ SI_LIVE_UNWRAP = (1 << 11),
+ SI_USE_ALPHA = (1 << 12),
+ SI_SHOW_ALPHA = (1 << 13),
+ SI_SHOW_ZBUF = (1 << 14),
+
+ /* next two for render window display */
+ SI_PREVSPACE = (1 << 15),
+ SI_FULLWINDOW = (1 << 16),
+
+ SI_FLAG_UNUSED_17 = (1 << 17), /* cleared */
+ SI_FLAG_UNUSED_18 = (1 << 18), /* cleared */
+
+ /* this means that the image is drawn until it reaches the view edge,
+ * in the image view, it's unrelated to the 'tile' mode for texface
+ */
+ SI_DRAW_TILE = (1 << 19),
+ SI_SMOOTH_UV = (1 << 20),
+ SI_DRAW_STRETCH = (1 << 21),
+ SI_SHOW_GPENCIL = (1 << 22),
+ SI_FLAG_UNUSED_23 = (1 << 23), /* cleared */
+
+ SI_FLAG_UNUSED_24 = (1 << 24),
+
+ SI_NO_DRAW_TEXPAINT = (1 << 25),
+ SI_DRAW_METADATA = (1 << 26),
+
+ SI_SHOW_R = (1 << 27),
+ SI_SHOW_G = (1 << 28),
+ SI_SHOW_B = (1 << 29),
+
+ SI_NO_DRAWEDGES = (1 << 30),
} eSpaceImage_Flag;
/* SpaceImage.other_uv_filter */
typedef enum eSpaceImage_OtherUVFilter {
- SI_FILTER_SAME_IMAGE = 0,
- SI_FILTER_ALL = 1,
+ SI_FILTER_SAME_IMAGE = 0,
+ SI_FILTER_ALL = 1,
} eSpaceImage_OtherUVFilter;
/** \} */
@@ -1122,77 +1110,76 @@ typedef enum eSpaceImage_OtherUVFilter {
/* Text Editor */
typedef struct SpaceText {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- struct Text *text;
-
- int top, viewlines;
- short flags, menunr;
-
- /** User preference, is font_size! */
- short lheight;
- /**
- * Runtime computed, character width
- * and the number of chars to use when showing line numbers.
- */
- char cwidth, linenrs_tot;
- int left;
- int showlinenrs;
- int tabnumber;
-
- short showsyntax;
- short line_hlight;
- short overwrite;
- /** Run python while editing, evil. */
- short live_edit;
- float pix_per_line;
-
- struct rcti txtscroll, txtbar;
-
- int wordwrap, doplugins;
-
- /** ST_MAX_FIND_STR. */
- char findstr[256];
- /** ST_MAX_FIND_STR. */
- char replacestr[256];
-
- /** Column number to show right margin at. */
- short margin_column;
- /** Actual lineheight, dpi controlled. */
- short lheight_dpi;
- char _pad[4];
-
- /** Cache for faster drawing. */
- void *drawcache;
-
- /** Runtime, for scroll increments smaller than a line. */
- float scroll_accum[2];
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ struct Text *text;
+
+ int top, viewlines;
+ short flags, menunr;
+
+ /** User preference, is font_size! */
+ short lheight;
+ /**
+ * Runtime computed, character width
+ * and the number of chars to use when showing line numbers.
+ */
+ char cwidth, linenrs_tot;
+ int left;
+ int showlinenrs;
+ int tabnumber;
+
+ short showsyntax;
+ short line_hlight;
+ short overwrite;
+ /** Run python while editing, evil. */
+ short live_edit;
+ float pix_per_line;
+
+ struct rcti txtscroll, txtbar;
+
+ int wordwrap, doplugins;
+
+ /** ST_MAX_FIND_STR. */
+ char findstr[256];
+ /** ST_MAX_FIND_STR. */
+ char replacestr[256];
+
+ /** Column number to show right margin at. */
+ short margin_column;
+ /** Actual lineheight, dpi controlled. */
+ short lheight_dpi;
+ char _pad[4];
+
+ /** Cache for faster drawing. */
+ void *drawcache;
+
+ /** Runtime, for scroll increments smaller than a line. */
+ float scroll_accum[2];
} SpaceText;
-
/* SpaceText flags (moved from DNA_text_types.h) */
typedef enum eSpaceText_Flags {
- /* scrollable */
- ST_SCROLL_SELECT = (1 << 0),
- /* clear namespace after script execution (BPY_main.c) */
- ST_CLEAR_NAMESPACE = (1 << 4),
+ /* scrollable */
+ ST_SCROLL_SELECT = (1 << 0),
+ /* clear namespace after script execution (BPY_main.c) */
+ ST_CLEAR_NAMESPACE = (1 << 4),
- ST_FIND_WRAP = (1 << 5),
- ST_FIND_ALL = (1 << 6),
- ST_SHOW_MARGIN = (1 << 7),
- ST_MATCH_CASE = (1 << 8),
+ ST_FIND_WRAP = (1 << 5),
+ ST_FIND_ALL = (1 << 6),
+ ST_SHOW_MARGIN = (1 << 7),
+ ST_MATCH_CASE = (1 << 8),
- ST_FIND_ACTIVATE = (1 << 9),
+ ST_FIND_ACTIVATE = (1 << 9),
} eSpaceText_Flags;
/* SpaceText.findstr/replacestr */
-#define ST_MAX_FIND_STR 256
+#define ST_MAX_FIND_STR 256
/** \} */
@@ -1202,42 +1189,45 @@ typedef enum eSpaceText_Flags {
/* Script Runtime Data - Obsolete (pre 2.5) */
typedef struct Script {
- ID id;
-
- void *py_draw;
- void *py_event;
- void *py_button;
- void *py_browsercallback;
- void *py_globaldict;
-
- int flags, lastspace;
- /**
- * Store the script file here so we can re-run it on loading blender,
- * if "Enable Scripts" is on
- */
- /** 1024 = FILE_MAX. */
- char scriptname[1024];
- /** 1024 = FILE_MAX. */
- char scriptarg[256];
+ ID id;
+
+ void *py_draw;
+ void *py_event;
+ void *py_button;
+ void *py_browsercallback;
+ void *py_globaldict;
+
+ int flags, lastspace;
+ /**
+ * Store the script file here so we can re-run it on loading blender,
+ * if "Enable Scripts" is on
+ */
+ /** 1024 = FILE_MAX. */
+ char scriptname[1024];
+ /** 1024 = FILE_MAX. */
+ char scriptarg[256];
} Script;
-#define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
+#define SCRIPT_SET_NULL(_script) \
+ _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = \
+ _script->py_globaldict = NULL; \
+ _script->flags = 0
/* Script View - Obsolete (pre 2.5) */
typedef struct SpaceScript {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
- struct Script *script;
+ struct Script *script;
- short flags, menunr;
- char _pad1[4];
+ short flags, menunr;
+ char _pad1[4];
- void *but_refs;
+ void *but_refs;
} SpaceScript;
/** \} */
@@ -1247,120 +1237,120 @@ typedef struct SpaceScript {
* \{ */
typedef struct bNodeTreePath {
- struct bNodeTreePath *next, *prev;
+ struct bNodeTreePath *next, *prev;
- struct bNodeTree *nodetree;
- /** Base key for nodes in this tree instance. */
- bNodeInstanceKey parent_key;
- char _pad[4];
- /** V2d center point, so node trees can have different offsets in editors. */
- float view_center[2];
+ struct bNodeTree *nodetree;
+ /** Base key for nodes in this tree instance. */
+ bNodeInstanceKey parent_key;
+ char _pad[4];
+ /** V2d center point, so node trees can have different offsets in editors. */
+ float view_center[2];
- /** MAX_NAME. */
- char node_name[64];
+ /** MAX_NAME. */
+ char node_name[64];
} bNodeTreePath;
typedef struct SpaceNode {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
-
- /** Context, no need to save in file? well... pinning... */
- struct ID *id, *from;
- /** Menunr: browse id block in header. */
- short flag;
- char _pad1[2];
- /** Internal state variables. */
- float aspect;
- char _pad2[4];
-
- /** Offset for drawing the backdrop. */
- float xof, yof;
- /** Zoom for backdrop. */
- float zoom;
- /** Mouse pos for drawing socketless link and adding nodes. */
- float cursor[2];
-
- /* XXX nodetree pointer info is all in the path stack now,
- * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
- * from path stack, to avoid having to update all the functions and operators. Can be done when
- * design is accepted and everything is properly tested.
- */
- ListBase treepath;
-
- struct bNodeTree *nodetree, *edittree;
-
- /* tree type for the current node tree */
- char tree_idname[64];
- /** Treetype: as same nodetree->type. */
- int treetype DNA_DEPRECATED;
- char _pad3[4];
-
- /** Texfrom object, world or brush. */
- short texfrom;
- /** Shader from object or world. */
- short shaderfrom;
- /** Currently on 0/1, for auto compo. */
- short recalc;
-
- /** Direction for offsetting nodes on insertion. */
- char insert_ofs_dir;
- char _pad4;
-
- /** Temporary data for modal linking operator. */
- ListBase linkdrag;
- /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
- /** Temporary data for node insert offset (in UI called Auto-offset). */
- struct NodeInsertOfsData *iofsd;
-
- /** Grease-pencil data. */
- struct bGPdata *gpd;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /** Deprecated, copied to region. */
+ View2D v2d DNA_DEPRECATED;
+
+ /** Context, no need to save in file? well... pinning... */
+ struct ID *id, *from;
+ /** Menunr: browse id block in header. */
+ short flag;
+ char _pad1[2];
+ /** Internal state variables. */
+ float aspect;
+ char _pad2[4];
+
+ /** Offset for drawing the backdrop. */
+ float xof, yof;
+ /** Zoom for backdrop. */
+ float zoom;
+ /** Mouse pos for drawing socketless link and adding nodes. */
+ float cursor[2];
+
+ /* XXX nodetree pointer info is all in the path stack now,
+ * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
+ * from path stack, to avoid having to update all the functions and operators. Can be done when
+ * design is accepted and everything is properly tested.
+ */
+ ListBase treepath;
+
+ struct bNodeTree *nodetree, *edittree;
+
+ /* tree type for the current node tree */
+ char tree_idname[64];
+ /** Treetype: as same nodetree->type. */
+ int treetype DNA_DEPRECATED;
+ char _pad3[4];
+
+ /** Texfrom object, world or brush. */
+ short texfrom;
+ /** Shader from object or world. */
+ short shaderfrom;
+ /** Currently on 0/1, for auto compo. */
+ short recalc;
+
+ /** Direction for offsetting nodes on insertion. */
+ char insert_ofs_dir;
+ char _pad4;
+
+ /** Temporary data for modal linking operator. */
+ ListBase linkdrag;
+ /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
+ /** Temporary data for node insert offset (in UI called Auto-offset). */
+ struct NodeInsertOfsData *iofsd;
+
+ /** Grease-pencil data. */
+ struct bGPdata *gpd;
} SpaceNode;
/* SpaceNode.flag */
typedef enum eSpaceNode_Flag {
- SNODE_BACKDRAW = (1 << 1),
- SNODE_SHOW_GPENCIL = (1 << 2),
- SNODE_USE_ALPHA = (1 << 3),
- SNODE_SHOW_ALPHA = (1 << 4),
- SNODE_SHOW_R = (1 << 7),
- SNODE_SHOW_G = (1 << 8),
- SNODE_SHOW_B = (1 << 9),
- SNODE_AUTO_RENDER = (1 << 5),
- SNODE_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- SNODE_FLAG_UNUSED_10 = (1 << 10), /* cleared */
- SNODE_FLAG_UNUSED_11 = (1 << 11), /* cleared */
- SNODE_PIN = (1 << 12),
- /** automatically offset following nodes in a chain on insertion */
- SNODE_SKIP_INSOFFSET = (1 << 13),
+ SNODE_BACKDRAW = (1 << 1),
+ SNODE_SHOW_GPENCIL = (1 << 2),
+ SNODE_USE_ALPHA = (1 << 3),
+ SNODE_SHOW_ALPHA = (1 << 4),
+ SNODE_SHOW_R = (1 << 7),
+ SNODE_SHOW_G = (1 << 8),
+ SNODE_SHOW_B = (1 << 9),
+ SNODE_AUTO_RENDER = (1 << 5),
+ SNODE_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ SNODE_FLAG_UNUSED_10 = (1 << 10), /* cleared */
+ SNODE_FLAG_UNUSED_11 = (1 << 11), /* cleared */
+ SNODE_PIN = (1 << 12),
+ /** automatically offset following nodes in a chain on insertion */
+ SNODE_SKIP_INSOFFSET = (1 << 13),
} eSpaceNode_Flag;
/* SpaceNode.texfrom */
typedef enum eSpaceNode_TexFrom {
- /* SNODE_TEX_OBJECT = 0, */
- SNODE_TEX_WORLD = 1,
- SNODE_TEX_BRUSH = 2,
- SNODE_TEX_LINESTYLE = 3,
+ /* SNODE_TEX_OBJECT = 0, */
+ SNODE_TEX_WORLD = 1,
+ SNODE_TEX_BRUSH = 2,
+ SNODE_TEX_LINESTYLE = 3,
} eSpaceNode_TexFrom;
/* SpaceNode.shaderfrom */
typedef enum eSpaceNode_ShaderFrom {
- SNODE_SHADER_OBJECT = 0,
- SNODE_SHADER_WORLD = 1,
- SNODE_SHADER_LINESTYLE = 2,
+ SNODE_SHADER_OBJECT = 0,
+ SNODE_SHADER_WORLD = 1,
+ SNODE_SHADER_LINESTYLE = 2,
} eSpaceNode_ShaderFrom;
/* SpaceNode.insert_ofs_dir */
enum {
- SNODE_INSERTOFS_DIR_RIGHT = 0,
- SNODE_INSERTOFS_DIR_LEFT = 1,
+ SNODE_INSERTOFS_DIR_RIGHT = 0,
+ SNODE_INSERTOFS_DIR_LEFT = 1,
};
/** \} */
@@ -1371,53 +1361,52 @@ enum {
/* Console content */
typedef struct ConsoleLine {
- struct ConsoleLine *next, *prev;
-
- /* keep these 3 vars so as to share free, realloc funcs */
- /** Allocated length. */
- int len_alloc;
- /** Real len - strlen(). */
- int len;
- char *line;
-
- int cursor;
- /** Only for use when in the 'scrollback' listbase. */
- int type;
+ struct ConsoleLine *next, *prev;
+
+ /* keep these 3 vars so as to share free, realloc funcs */
+ /** Allocated length. */
+ int len_alloc;
+ /** Real len - strlen(). */
+ int len;
+ char *line;
+
+ int cursor;
+ /** Only for use when in the 'scrollback' listbase. */
+ int type;
} ConsoleLine;
/* ConsoleLine.type */
typedef enum eConsoleLine_Type {
- CONSOLE_LINE_OUTPUT = 0,
- CONSOLE_LINE_INPUT = 1,
- CONSOLE_LINE_INFO = 2, /* autocomp feedback */
- CONSOLE_LINE_ERROR = 3,
+ CONSOLE_LINE_OUTPUT = 0,
+ CONSOLE_LINE_INPUT = 1,
+ CONSOLE_LINE_INFO = 2, /* autocomp feedback */
+ CONSOLE_LINE_ERROR = 3,
} eConsoleLine_Type;
-
/* Console View */
typedef struct SpaceConsole {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- /* space vars */
- int lheight;
- char _pad[4];
-
- /** ConsoleLine; output. */
- ListBase scrollback;
- /** ConsoleLine; command history, current edited line is the first. */
- ListBase history;
- char prompt[256];
- /** Multiple consoles are possible, not just python. */
- char language[32];
-
- int sel_start;
- int sel_end;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ /* space vars */
+ int lheight;
+ char _pad[4];
+
+ /** ConsoleLine; output. */
+ ListBase scrollback;
+ /** ConsoleLine; command history, current edited line is the first. */
+ ListBase history;
+ char prompt[256];
+ /** Multiple consoles are possible, not just python. */
+ char language[32];
+
+ int sel_start;
+ int sel_end;
} SpaceConsole;
/** \} */
@@ -1427,18 +1416,18 @@ typedef struct SpaceConsole {
* \{ */
typedef struct SpaceUserPref {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- char _pad1[7];
- char filter_type;
- /** Search term for filtering in the UI. */
- char filter[64];
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ char _pad1[7];
+ char filter_type;
+ /** Search term for filtering in the UI. */
+ char filter[64];
} SpaceUserPref;
/** \} */
@@ -1449,116 +1438,115 @@ typedef struct SpaceUserPref {
/* Clip Editor */
typedef struct SpaceClip {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- char _pad1[4];
-
- /** User defined offset, image is centered. */
- float xof, yof;
- /** User defined offset from locked position. */
- float xlockof, ylockof;
- /** User defined zoom level. */
- float zoom;
-
- /** User of clip. */
- struct MovieClipUser user;
- /** Clip data. */
- struct MovieClip *clip;
- /** Different scoped displayed in space panels. */
- struct MovieClipScopes scopes;
-
- /** Flags. */
- int flag;
- /** Editor mode (editing context being displayed). */
- short mode;
- /** Type of the clip editor view. */
- short view;
-
- /** Length of displaying path, in frames. */
- int path_length;
-
- /* current stabilization data */
- /** Pre-composed stabilization data. */
- float loc[2], scale, angle;
- char _pad[4];
- /**
- * Current stabilization matrix and the same matrix in unified space,
- * defined when drawing and used for mouse position calculation.
- */
- float stabmat[4][4], unistabmat[4][4];
-
- /* movie postprocessing */
- int postproc_flag;
-
- /* grease pencil */
- short gpencil_src;
- char _pad2[2];
-
- /** Pivot point for transforms. */
- int around;
- char _pad4[4];
-
- /** Mask editor 2d cursor. */
- float cursor[2];
-
- MaskSpaceInfo mask_info;
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+
+ char _pad1[4];
+
+ /** User defined offset, image is centered. */
+ float xof, yof;
+ /** User defined offset from locked position. */
+ float xlockof, ylockof;
+ /** User defined zoom level. */
+ float zoom;
+
+ /** User of clip. */
+ struct MovieClipUser user;
+ /** Clip data. */
+ struct MovieClip *clip;
+ /** Different scoped displayed in space panels. */
+ struct MovieClipScopes scopes;
+
+ /** Flags. */
+ int flag;
+ /** Editor mode (editing context being displayed). */
+ short mode;
+ /** Type of the clip editor view. */
+ short view;
+
+ /** Length of displaying path, in frames. */
+ int path_length;
+
+ /* current stabilization data */
+ /** Pre-composed stabilization data. */
+ float loc[2], scale, angle;
+ char _pad[4];
+ /**
+ * Current stabilization matrix and the same matrix in unified space,
+ * defined when drawing and used for mouse position calculation.
+ */
+ float stabmat[4][4], unistabmat[4][4];
+
+ /* movie postprocessing */
+ int postproc_flag;
+
+ /* grease pencil */
+ short gpencil_src;
+ char _pad2[2];
+
+ /** Pivot point for transforms. */
+ int around;
+ char _pad4[4];
+
+ /** Mask editor 2d cursor. */
+ float cursor[2];
+
+ MaskSpaceInfo mask_info;
} SpaceClip;
/* SpaceClip.flag */
typedef enum eSpaceClip_Flag {
- SC_SHOW_MARKER_PATTERN = (1 << 0),
- SC_SHOW_MARKER_SEARCH = (1 << 1),
- SC_LOCK_SELECTION = (1 << 2),
- SC_SHOW_TINY_MARKER = (1 << 3),
- SC_SHOW_TRACK_PATH = (1 << 4),
- SC_SHOW_BUNDLES = (1 << 5),
- SC_MUTE_FOOTAGE = (1 << 6),
- SC_HIDE_DISABLED = (1 << 7),
- SC_SHOW_NAMES = (1 << 8),
- SC_SHOW_GRID = (1 << 9),
- SC_SHOW_STABLE = (1 << 10),
- SC_MANUAL_CALIBRATION = (1 << 11),
- SC_SHOW_ANNOTATION = (1 << 12),
- SC_SHOW_FILTERS = (1 << 13),
- SC_SHOW_GRAPH_FRAMES = (1 << 14),
- SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
-/* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
- SC_LOCK_TIMECURSOR = (1 << 17),
- SC_SHOW_SECONDS = (1 << 18),
- SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
- SC_SHOW_GRAPH_HIDDEN = (1 << 20),
- SC_SHOW_GRAPH_TRACKS_ERROR = (1 << 21),
- SC_SHOW_METADATA = (1 << 22),
+ SC_SHOW_MARKER_PATTERN = (1 << 0),
+ SC_SHOW_MARKER_SEARCH = (1 << 1),
+ SC_LOCK_SELECTION = (1 << 2),
+ SC_SHOW_TINY_MARKER = (1 << 3),
+ SC_SHOW_TRACK_PATH = (1 << 4),
+ SC_SHOW_BUNDLES = (1 << 5),
+ SC_MUTE_FOOTAGE = (1 << 6),
+ SC_HIDE_DISABLED = (1 << 7),
+ SC_SHOW_NAMES = (1 << 8),
+ SC_SHOW_GRID = (1 << 9),
+ SC_SHOW_STABLE = (1 << 10),
+ SC_MANUAL_CALIBRATION = (1 << 11),
+ SC_SHOW_ANNOTATION = (1 << 12),
+ SC_SHOW_FILTERS = (1 << 13),
+ SC_SHOW_GRAPH_FRAMES = (1 << 14),
+ SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
+ /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
+ SC_LOCK_TIMECURSOR = (1 << 17),
+ SC_SHOW_SECONDS = (1 << 18),
+ SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
+ SC_SHOW_GRAPH_HIDDEN = (1 << 20),
+ SC_SHOW_GRAPH_TRACKS_ERROR = (1 << 21),
+ SC_SHOW_METADATA = (1 << 22),
} eSpaceClip_Flag;
/* SpaceClip.mode */
typedef enum eSpaceClip_Mode {
- SC_MODE_TRACKING = 0,
- /*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
- /*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
- SC_MODE_MASKEDIT = 3,
+ SC_MODE_TRACKING = 0,
+ /*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
+ /*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
+ SC_MODE_MASKEDIT = 3,
} eSpaceClip_Mode;
/* SpaceClip.view */
typedef enum eSpaceClip_View {
- SC_VIEW_CLIP = 0,
- SC_VIEW_GRAPH = 1,
- SC_VIEW_DOPESHEET = 2,
+ SC_VIEW_CLIP = 0,
+ SC_VIEW_GRAPH = 1,
+ SC_VIEW_DOPESHEET = 2,
} eSpaceClip_View;
/* SpaceClip.gpencil_src */
typedef enum eSpaceClip_GPencil_Source {
- SC_GPENCIL_SRC_CLIP = 0,
- SC_GPENCIL_SRC_TRACK = 1,
+ SC_GPENCIL_SRC_CLIP = 0,
+ SC_GPENCIL_SRC_TRACK = 1,
} eSpaceClip_GPencil_Source;
-
/** \} */
/* -------------------------------------------------------------------- */
@@ -1570,13 +1558,13 @@ typedef enum eSpaceClip_GPencil_Source {
#
#
typedef struct SpaceTopBar {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
} SpaceTopBar;
/** \} */
@@ -1590,13 +1578,13 @@ typedef struct SpaceTopBar {
#
#
typedef struct SpaceStatusBar {
- SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
} SpaceStatusBar;
/** \} */
@@ -1608,34 +1596,34 @@ typedef struct SpaceStatusBar {
/* space types, moved from DNA_screen_types.h */
/* Do NOT change order, append on end. types are hardcoded needed */
typedef enum eSpace_Type {
- SPACE_EMPTY = 0,
- SPACE_VIEW3D = 1,
- SPACE_GRAPH = 2,
- SPACE_OUTLINER = 3,
- SPACE_PROPERTIES = 4,
- SPACE_FILE = 5,
- SPACE_IMAGE = 6,
- SPACE_INFO = 7,
- SPACE_SEQ = 8,
- SPACE_TEXT = 9,
+ SPACE_EMPTY = 0,
+ SPACE_VIEW3D = 1,
+ SPACE_GRAPH = 2,
+ SPACE_OUTLINER = 3,
+ SPACE_PROPERTIES = 4,
+ SPACE_FILE = 5,
+ SPACE_IMAGE = 6,
+ SPACE_INFO = 7,
+ SPACE_SEQ = 8,
+ SPACE_TEXT = 9,
#ifdef DNA_DEPRECATED
- SPACE_IMASEL = 10, /* deprecated */
- SPACE_SOUND = 11, /* Deprecated */
+ SPACE_IMASEL = 10, /* deprecated */
+ SPACE_SOUND = 11, /* Deprecated */
#endif
- SPACE_ACTION = 12,
- SPACE_NLA = 13,
- /* TODO: fully deprecate */
- SPACE_SCRIPT = 14, /* Deprecated */
- SPACE_TIME = 15, /* Deprecated */
- SPACE_NODE = 16,
- SPACE_LOGIC = 17, /* deprecated */
- SPACE_CONSOLE = 18,
- SPACE_USERPREF = 19,
- SPACE_CLIP = 20,
- SPACE_TOPBAR = 21,
- SPACE_STATUSBAR = 22,
-
- SPACE_TYPE_LAST = SPACE_STATUSBAR,
+ SPACE_ACTION = 12,
+ SPACE_NLA = 13,
+ /* TODO: fully deprecate */
+ SPACE_SCRIPT = 14, /* Deprecated */
+ SPACE_TIME = 15, /* Deprecated */
+ SPACE_NODE = 16,
+ SPACE_LOGIC = 17, /* deprecated */
+ SPACE_CONSOLE = 18,
+ SPACE_USERPREF = 19,
+ SPACE_CLIP = 20,
+ SPACE_TOPBAR = 21,
+ SPACE_STATUSBAR = 22,
+
+ SPACE_TYPE_LAST = SPACE_STATUSBAR,
} eSpace_Type;
/* use for function args */
@@ -1645,4 +1633,4 @@ typedef enum eSpace_Type {
/** \} */
-#endif /* __DNA_SPACE_TYPES_H__ */
+#endif /* __DNA_SPACE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_speaker_types.h b/source/blender/makesdna/DNA_speaker_types.h
index 786c549d074..9100b37d85e 100644
--- a/source/blender/makesdna/DNA_speaker_types.h
+++ b/source/blender/makesdna/DNA_speaker_types.h
@@ -27,36 +27,36 @@ struct AnimData;
struct bSound;
typedef struct Speaker {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
-
- struct bSound *sound;
-
- /* not animatable properties */
- float volume_max;
- float volume_min;
- float distance_max;
- float distance_reference;
- float attenuation;
- float cone_angle_outer;
- float cone_angle_inner;
- float cone_volume_outer;
-
- /* animatable properties */
- float volume;
- float pitch;
-
- /* flag */
- short flag;
- char _pad1[6];
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+
+ struct bSound *sound;
+
+ /* not animatable properties */
+ float volume_max;
+ float volume_min;
+ float distance_max;
+ float distance_reference;
+ float attenuation;
+ float cone_angle_outer;
+ float cone_angle_inner;
+ float cone_volume_outer;
+
+ /* animatable properties */
+ float volume;
+ float pitch;
+
+ /* flag */
+ short flag;
+ char _pad1[6];
} Speaker;
/* **************** SPEAKER ********************* */
/* flag */
-#define SPK_DS_EXPAND (1 << 0)
-#define SPK_MUTED (1 << 1)
+#define SPK_DS_EXPAND (1 << 0)
+#define SPK_MUTED (1 << 1)
// #define SPK_RELATIVE (1 << 2) /* UNUSED */
#endif /* __DNA_SPEAKER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h
index 856e17214a2..8dfaf95a10a 100644
--- a/source/blender/makesdna/DNA_text_types.h
+++ b/source/blender/makesdna/DNA_text_types.h
@@ -30,47 +30,47 @@
#include "DNA_ID.h"
typedef struct TextLine {
- struct TextLine *next, *prev;
+ struct TextLine *next, *prev;
- char *line;
- /** May be NULL if syntax is off or not yet formatted. */
- char *format;
- /** Blen unused. */
- int len, blen;
+ char *line;
+ /** May be NULL if syntax is off or not yet formatted. */
+ char *format;
+ /** Blen unused. */
+ int len, blen;
} TextLine;
typedef struct Text {
- ID id;
+ ID id;
- char *name;
- void *compiled;
+ char *name;
+ void *compiled;
- int flags, nlines;
+ int flags, nlines;
- ListBase lines;
- TextLine *curl, *sell;
- int curc, selc;
+ ListBase lines;
+ TextLine *curl, *sell;
+ int curc, selc;
- double mtime;
+ double mtime;
} Text;
-#define TXT_TABSIZE 4
+#define TXT_TABSIZE 4
#define TXT_INIT_UNDO 1024
-#define TXT_MAX_UNDO (TXT_INIT_UNDO*TXT_INIT_UNDO)
+#define TXT_MAX_UNDO (TXT_INIT_UNDO * TXT_INIT_UNDO)
/* text flags */
enum {
- TXT_ISDIRTY = 1 << 0,
- TXT_ISMEM = 1 << 2,
- TXT_ISEXT = 1 << 3,
- /** Used by space handler scriptlinks. */
- TXT_ISSCRIPT = 1 << 4,
+ TXT_ISDIRTY = 1 << 0,
+ TXT_ISMEM = 1 << 2,
+ TXT_ISEXT = 1 << 3,
+ /** Used by space handler scriptlinks. */
+ TXT_ISSCRIPT = 1 << 4,
- TXT_FLAG_UNUSED_8 = 1 << 8, /* cleared */
- TXT_FLAG_UNUSED_9 = 1 << 9, /* cleared */
+ TXT_FLAG_UNUSED_8 = 1 << 8, /* cleared */
+ TXT_FLAG_UNUSED_9 = 1 << 9, /* cleared */
- /** Use space instead of tabs. */
- TXT_TABSTOSPACES = 1 << 10,
+ /** Use space instead of tabs. */
+ TXT_TABSTOSPACES = 1 << 10,
};
-#endif /* __DNA_TEXT_TYPES_H__ */
+#endif /* __DNA_TEXT_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 96745b40382..3fad1c57427 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -44,49 +44,49 @@ struct Tex;
typedef struct MTex {
- short texco, mapto, maptoneg, blendtype;
- struct Object *object;
- struct Tex *tex;
- /** MAX_CUSTOMDATA_LAYER_NAME. */
- char uvname[64];
-
- char projx, projy, projz, mapping;
- char brush_map_mode, brush_angle_mode;
- char _pad[2];
- float ofs[3], size[3], rot, random_angle;
-
- char _pad0[2];
- short colormodel, pmapto, pmaptoneg;
- short normapspace, which_output;
- float r, g, b, k;
- float def_var, rt;
-
- /* common */
- float colfac, varfac;
-
- /* material */
- float norfac, dispfac, warpfac;
- float colspecfac, mirrfac, alphafac;
- float difffac, specfac, emitfac, hardfac;
- float raymirrfac, translfac, ambfac;
- float colemitfac, colreflfac, coltransfac;
- float densfac, scatterfac, reflfac;
-
- /* particles */
- float timefac, lengthfac, clumpfac, dampfac;
- float kinkfac, kinkampfac, roughfac, padensfac, gravityfac;
- float lifefac, sizefac, ivelfac, fieldfac;
- float twistfac;
-
- /* light */
- float shadowfac;
-
- /* world */
- float zenupfac, zendownfac, blendfac;
+ short texco, mapto, maptoneg, blendtype;
+ struct Object *object;
+ struct Tex *tex;
+ /** MAX_CUSTOMDATA_LAYER_NAME. */
+ char uvname[64];
+
+ char projx, projy, projz, mapping;
+ char brush_map_mode, brush_angle_mode;
+ char _pad[2];
+ float ofs[3], size[3], rot, random_angle;
+
+ char _pad0[2];
+ short colormodel, pmapto, pmaptoneg;
+ short normapspace, which_output;
+ float r, g, b, k;
+ float def_var, rt;
+
+ /* common */
+ float colfac, varfac;
+
+ /* material */
+ float norfac, dispfac, warpfac;
+ float colspecfac, mirrfac, alphafac;
+ float difffac, specfac, emitfac, hardfac;
+ float raymirrfac, translfac, ambfac;
+ float colemitfac, colreflfac, coltransfac;
+ float densfac, scatterfac, reflfac;
+
+ /* particles */
+ float timefac, lengthfac, clumpfac, dampfac;
+ float kinkfac, kinkampfac, roughfac, padensfac, gravityfac;
+ float lifefac, sizefac, ivelfac, fieldfac;
+ float twistfac;
+
+ /* light */
+ float shadowfac;
+
+ /* world */
+ float zenupfac, zendownfac, blendfac;
} MTex;
#ifndef DNA_USHORT_FIX
-#define 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
@@ -96,166 +96,166 @@ typedef unsigned short dna_ushort_fix;
#endif
typedef struct CBData {
- float r, g, b, a, pos;
- int cur;
+ float r, g, b, a, pos;
+ int cur;
} CBData;
/* 32 = MAXCOLORBAND */
/* note that this has to remain a single struct, for UserDef */
typedef struct ColorBand {
- short tot, cur;
- char ipotype, ipotype_hue;
- char color_mode;
- char _pad[1];
+ short tot, cur;
+ char ipotype, ipotype_hue;
+ char color_mode;
+ char _pad[1];
- CBData data[32];
+ CBData data[32];
} ColorBand;
typedef struct PointDensity {
- short flag;
-
- short falloff_type;
- float falloff_softness;
- float radius;
- short source;
- char _pad0[2];
-
- /** psys_color_source */
- short color_source;
- short ob_color_source;
-
- int totpoints;
-
- /** for 'Object' or 'Particle system' type - source object */
- struct Object *object;
- /** `index + 1` in ob.particlesystem, non-ID pointer not allowed */
- int psys;
- /** cache points in worldspace, object space, ... ? */
- short psys_cache_space;
- /** cache points in worldspace, object space, ... ? */
- short ob_cache_space;
- /** vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME */
- char vertex_attribute_name[64];
-
- /** The acceleration tree containing points. */
- void *point_tree;
- /** Dynamically allocated extra for extra information, like particle age. */
- float *point_data;
-
- float noise_size;
- short noise_depth;
- short noise_influence;
- short noise_basis;
- char _pad1[6];
- float noise_fac;
-
- float speed_scale, falloff_speed_scale;
- char _pad2[4];
- /** For time -> color */
- struct ColorBand *coba;
-
- /** Falloff density curve. */
- struct CurveMapping *falloff_curve;
+ short flag;
+
+ short falloff_type;
+ float falloff_softness;
+ float radius;
+ short source;
+ char _pad0[2];
+
+ /** psys_color_source */
+ short color_source;
+ short ob_color_source;
+
+ int totpoints;
+
+ /** for 'Object' or 'Particle system' type - source object */
+ struct Object *object;
+ /** `index + 1` in ob.particlesystem, non-ID pointer not allowed */
+ int psys;
+ /** cache points in worldspace, object space, ... ? */
+ short psys_cache_space;
+ /** cache points in worldspace, object space, ... ? */
+ short ob_cache_space;
+ /** vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME */
+ char vertex_attribute_name[64];
+
+ /** The acceleration tree containing points. */
+ void *point_tree;
+ /** Dynamically allocated extra for extra information, like particle age. */
+ float *point_data;
+
+ float noise_size;
+ short noise_depth;
+ short noise_influence;
+ short noise_basis;
+ char _pad1[6];
+ float noise_fac;
+
+ float speed_scale, falloff_speed_scale;
+ char _pad2[4];
+ /** For time -> color */
+ struct ColorBand *coba;
+
+ /** Falloff density curve. */
+ struct CurveMapping *falloff_curve;
} PointDensity;
typedef struct Tex {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
- float noisesize, turbul;
- float bright, contrast, saturation, rfac, gfac, bfac;
- float filtersize;
- char _pad2[4];
+ float noisesize, turbul;
+ float bright, contrast, saturation, rfac, gfac, bfac;
+ float filtersize;
+ char _pad2[4];
- /* newnoise: musgrave parameters */
- float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;
+ /* newnoise: musgrave parameters */
+ float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;
- /* newnoise: distorted noise amount, musgrave & voronoi output scale */
- float dist_amount, ns_outscale;
+ /* newnoise: distorted noise amount, musgrave & voronoi output scale */
+ float dist_amount, ns_outscale;
- /* newnoise: voronoi nearest neighbor weights, minkovsky exponent,
- * distance metric & color type */
- float vn_w1;
- float vn_w2;
- float vn_w3;
- float vn_w4;
- float vn_mexp;
- short vn_distm, vn_coltype;
+ /* newnoise: voronoi nearest neighbor weights, minkovsky exponent,
+ * distance metric & color type */
+ float vn_w1;
+ float vn_w2;
+ float vn_w3;
+ float vn_w4;
+ float vn_mexp;
+ short vn_distm, vn_coltype;
- /* noisedepth MUST be <= 30 else we get floating point exceptions */
- short noisedepth, noisetype;
+ /* noisedepth MUST be <= 30 else we get floating point exceptions */
+ short noisedepth, noisetype;
- /* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
- short noisebasis, noisebasis2;
+ /* newnoise: noisebasis type for clouds/marble/etc, noisebasis2 only used for distorted noise */
+ short noisebasis, noisebasis2;
- short imaflag, flag;
- short type, stype;
+ short imaflag, flag;
+ short type, stype;
- float cropxmin, cropymin, cropxmax, cropymax;
- int texfilter;
- int afmax; // anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes
- short xrepeat, yrepeat;
- short extend;
+ float cropxmin, cropymin, cropxmax, cropymax;
+ int texfilter;
+ int afmax; // anisotropic filter maximum value, ewa -> max eccentricity, feline -> max probes
+ short xrepeat, yrepeat;
+ short extend;
- /* variables disabled, moved to struct iuser */
- short _pad0;
- int len;
- int frames, offset, sfra;
+ /* variables disabled, moved to struct iuser */
+ short _pad0;
+ int len;
+ int frames, offset, sfra;
- float checkerdist, nabla;
- char _pad1[4];
+ float checkerdist, nabla;
+ char _pad1[4];
- struct ImageUser iuser;
+ struct ImageUser iuser;
- struct bNodeTree *nodetree;
- /* old animation system, deprecated for 2.5 */
- struct Ipo *ipo DNA_DEPRECATED;
- struct Image *ima;
- struct ColorBand *coba;
- struct PreviewImage *preview;
+ struct bNodeTree *nodetree;
+ /* old animation system, deprecated for 2.5 */
+ struct Ipo *ipo DNA_DEPRECATED;
+ struct Image *ima;
+ struct ColorBand *coba;
+ struct PreviewImage *preview;
- char use_nodes;
- char _pad[7];
+ char use_nodes;
+ char _pad[7];
} Tex;
/* used for mapping and texture nodes. note: rot is now in radians */
typedef struct TexMapping {
- float loc[3], rot[3], size[3];
- int flag;
- char projx, projy, projz, mapping;
- int type;
+ float loc[3], rot[3], size[3];
+ int flag;
+ char projx, projy, projz, mapping;
+ int type;
- float mat[4][4];
- float min[3], max[3];
- struct Object *ob;
+ float mat[4][4];
+ float min[3], max[3];
+ struct Object *ob;
} TexMapping;
typedef struct ColorMapping {
- struct ColorBand coba;
+ struct ColorBand coba;
- float bright, contrast, saturation;
- int flag;
+ float bright, contrast, saturation;
+ int flag;
- float blend_color[3];
- float blend_factor;
- int blend_type;
- char _pad[4];
+ float blend_color[3];
+ float blend_factor;
+ int blend_type;
+ char _pad[4];
} ColorMapping;
/* texmap->flag */
-#define TEXMAP_CLIP_MIN 1
-#define TEXMAP_CLIP_MAX 2
-#define TEXMAP_UNIT_MATRIX 4
+#define TEXMAP_CLIP_MIN 1
+#define TEXMAP_CLIP_MAX 2
+#define TEXMAP_UNIT_MATRIX 4
/* texmap->type */
-#define TEXMAP_TYPE_POINT 0
-#define TEXMAP_TYPE_TEXTURE 1
-#define TEXMAP_TYPE_VECTOR 2
-#define TEXMAP_TYPE_NORMAL 3
+#define TEXMAP_TYPE_POINT 0
+#define TEXMAP_TYPE_TEXTURE 1
+#define TEXMAP_TYPE_VECTOR 2
+#define TEXMAP_TYPE_NORMAL 3
/* colormap->flag */
#define COLORMAP_USE_RAMP 1
@@ -263,267 +263,269 @@ typedef struct ColorMapping {
/* **************** TEX ********************* */
/* type */
-#define TEX_CLOUDS 1
-#define TEX_WOOD 2
-#define TEX_MARBLE 3
-#define TEX_MAGIC 4
-#define TEX_BLEND 5
-#define TEX_STUCCI 6
-#define TEX_NOISE 7
-#define TEX_IMAGE 8
-//#define TEX_PLUGIN 9 /* Deprecated */
-//#define TEX_ENVMAP 10 /* Deprecated */
-#define TEX_MUSGRAVE 11
-#define TEX_VORONOI 12
-#define TEX_DISTNOISE 13
-//#define TEX_POINTDENSITY 14 /* Deprecated */
-//#define TEX_VOXELDATA 15 /* Deprecated */
-//#define TEX_OCEAN 16 /* Deprecated */
+#define TEX_CLOUDS 1
+#define TEX_WOOD 2
+#define TEX_MARBLE 3
+#define TEX_MAGIC 4
+#define TEX_BLEND 5
+#define TEX_STUCCI 6
+#define TEX_NOISE 7
+#define TEX_IMAGE 8
+//#define TEX_PLUGIN 9 /* Deprecated */
+//#define TEX_ENVMAP 10 /* Deprecated */
+#define TEX_MUSGRAVE 11
+#define TEX_VORONOI 12
+#define TEX_DISTNOISE 13
+//#define TEX_POINTDENSITY 14 /* Deprecated */
+//#define TEX_VOXELDATA 15 /* Deprecated */
+//#define TEX_OCEAN 16 /* Deprecated */
/* musgrave stype */
-#define TEX_MFRACTAL 0
-#define TEX_RIDGEDMF 1
-#define TEX_HYBRIDMF 2
-#define TEX_FBM 3
-#define TEX_HTERRAIN 4
+#define TEX_MFRACTAL 0
+#define TEX_RIDGEDMF 1
+#define TEX_HYBRIDMF 2
+#define TEX_FBM 3
+#define TEX_HTERRAIN 4
/* newnoise: noisebasis 1 & 2 */
-#define TEX_BLENDER 0
-#define TEX_STDPERLIN 1
-#define TEX_NEWPERLIN 2
-#define TEX_VORONOI_F1 3
-#define TEX_VORONOI_F2 4
-#define TEX_VORONOI_F3 5
-#define TEX_VORONOI_F4 6
-#define TEX_VORONOI_F2F1 7
-#define TEX_VORONOI_CRACKLE 8
-#define TEX_CELLNOISE 14
+#define TEX_BLENDER 0
+#define TEX_STDPERLIN 1
+#define TEX_NEWPERLIN 2
+#define TEX_VORONOI_F1 3
+#define TEX_VORONOI_F2 4
+#define TEX_VORONOI_F3 5
+#define TEX_VORONOI_F4 6
+#define TEX_VORONOI_F2F1 7
+#define TEX_VORONOI_CRACKLE 8
+#define TEX_CELLNOISE 14
/* newnoise: Voronoi distance metrics, vn_distm */
-#define TEX_DISTANCE 0
-#define TEX_DISTANCE_SQUARED 1
-#define TEX_MANHATTAN 2
-#define TEX_CHEBYCHEV 3
-#define TEX_MINKOVSKY_HALF 4
-#define TEX_MINKOVSKY_FOUR 5
-#define TEX_MINKOVSKY 6
+#define TEX_DISTANCE 0
+#define TEX_DISTANCE_SQUARED 1
+#define TEX_MANHATTAN 2
+#define TEX_CHEBYCHEV 3
+#define TEX_MINKOVSKY_HALF 4
+#define TEX_MINKOVSKY_FOUR 5
+#define TEX_MINKOVSKY 6
/* imaflag */
-#define TEX_INTERPOL (1 << 0)
-#define TEX_USEALPHA (1 << 1)
-#define TEX_MIPMAP (1 << 2)
-#define TEX_IMAROT (1 << 4)
-#define TEX_CALCALPHA (1 << 5)
-#define TEX_NORMALMAP (1 << 11)
-#define TEX_GAUSS_MIP (1 << 12)
-#define TEX_FILTER_MIN (1 << 13)
-#define TEX_DERIVATIVEMAP (1 << 14)
+#define TEX_INTERPOL (1 << 0)
+#define TEX_USEALPHA (1 << 1)
+#define TEX_MIPMAP (1 << 2)
+#define TEX_IMAROT (1 << 4)
+#define TEX_CALCALPHA (1 << 5)
+#define TEX_NORMALMAP (1 << 11)
+#define TEX_GAUSS_MIP (1 << 12)
+#define TEX_FILTER_MIN (1 << 13)
+#define TEX_DERIVATIVEMAP (1 << 14)
/* texfilter */
// TXF_BOX -> blender's old texture filtering method
-#define TXF_BOX 0
-#define TXF_EWA 1
-#define TXF_FELINE 2
-#define TXF_AREA 3
+#define TXF_BOX 0
+#define TXF_EWA 1
+#define TXF_FELINE 2
+#define TXF_AREA 3
/* flag */
-#define TEX_COLORBAND (1 << 0)
-#define TEX_FLIPBLEND (1 << 1)
-#define TEX_NEGALPHA (1 << 2)
-#define TEX_CHECKER_ODD (1 << 3)
-#define TEX_CHECKER_EVEN (1 << 4)
-#define TEX_PRV_ALPHA (1 << 5)
-#define TEX_PRV_NOR (1 << 6)
-#define TEX_REPEAT_XMIR (1 << 7)
-#define TEX_REPEAT_YMIR (1 << 8)
-#define TEX_FLAG_MASK (TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR)
-#define TEX_DS_EXPAND (1 << 9)
-#define TEX_NO_CLAMP (1 << 10)
+#define TEX_COLORBAND (1 << 0)
+#define TEX_FLIPBLEND (1 << 1)
+#define TEX_NEGALPHA (1 << 2)
+#define TEX_CHECKER_ODD (1 << 3)
+#define TEX_CHECKER_EVEN (1 << 4)
+#define TEX_PRV_ALPHA (1 << 5)
+#define TEX_PRV_NOR (1 << 6)
+#define TEX_REPEAT_XMIR (1 << 7)
+#define TEX_REPEAT_YMIR (1 << 8)
+#define TEX_FLAG_MASK \
+ (TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | \
+ TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR)
+#define TEX_DS_EXPAND (1 << 9)
+#define TEX_NO_CLAMP (1 << 10)
/* extend (starts with 1 because of backward comp.) */
-#define TEX_EXTEND 1
-#define TEX_CLIP 2
-#define TEX_REPEAT 3
-#define TEX_CLIPCUBE 4
-#define TEX_CHECKER 5
+#define TEX_EXTEND 1
+#define TEX_CLIP 2
+#define TEX_REPEAT 3
+#define TEX_CLIPCUBE 4
+#define TEX_CHECKER 5
/* noisetype */
-#define TEX_NOISESOFT 0
-#define TEX_NOISEPERL 1
+#define TEX_NOISESOFT 0
+#define TEX_NOISEPERL 1
/* tex->noisebasis2 in texture.c - wood waveforms */
-#define TEX_SIN 0
-#define TEX_SAW 1
-#define TEX_TRI 2
+#define TEX_SIN 0
+#define TEX_SAW 1
+#define TEX_TRI 2
/* tex->stype in texture.c - wood types */
-#define TEX_BAND 0
-#define TEX_RING 1
-#define TEX_BANDNOISE 2
-#define TEX_RINGNOISE 3
+#define TEX_BAND 0
+#define TEX_RING 1
+#define TEX_BANDNOISE 2
+#define TEX_RINGNOISE 3
/* tex->stype in texture.c - cloud types */
-#define TEX_DEFAULT 0
-#define TEX_COLOR 1
+#define TEX_DEFAULT 0
+#define TEX_COLOR 1
/* tex->stype in texture.c - marble types */
-#define TEX_SOFT 0
-#define TEX_SHARP 1
-#define TEX_SHARPER 2
+#define TEX_SOFT 0
+#define TEX_SHARP 1
+#define TEX_SHARPER 2
/* tex->stype in texture.c - blend types */
-#define TEX_LIN 0
-#define TEX_QUAD 1
-#define TEX_EASE 2
-#define TEX_DIAG 3
-#define TEX_SPHERE 4
-#define TEX_HALO 5
-#define TEX_RAD 6
+#define TEX_LIN 0
+#define TEX_QUAD 1
+#define TEX_EASE 2
+#define TEX_DIAG 3
+#define TEX_SPHERE 4
+#define TEX_HALO 5
+#define TEX_RAD 6
/* tex->stype in texture.c - stucci types */
-#define TEX_PLASTIC 0
-#define TEX_WALLIN 1
-#define TEX_WALLOUT 2
+#define TEX_PLASTIC 0
+#define TEX_WALLIN 1
+#define TEX_WALLOUT 2
/* tex->stype in texture.c - voronoi types */
-#define TEX_INTENSITY 0
-#define TEX_COL1 1
-#define TEX_COL2 2
-#define TEX_COL3 3
+#define TEX_INTENSITY 0
+#define TEX_COL1 1
+#define TEX_COL2 2
+#define TEX_COL3 3
/* mtex->normapspace */
-#define MTEX_NSPACE_CAMERA 0
-#define MTEX_NSPACE_WORLD 1
-#define MTEX_NSPACE_OBJECT 2
-#define MTEX_NSPACE_TANGENT 3
+#define MTEX_NSPACE_CAMERA 0
+#define MTEX_NSPACE_WORLD 1
+#define MTEX_NSPACE_OBJECT 2
+#define MTEX_NSPACE_TANGENT 3
/* wrap */
-#define MTEX_FLAT 0
-#define MTEX_CUBE 1
-#define MTEX_TUBE 2
-#define MTEX_SPHERE 3
+#define MTEX_FLAT 0
+#define MTEX_CUBE 1
+#define MTEX_TUBE 2
+#define MTEX_SPHERE 3
/* return value */
-#define TEX_INT 0
-#define TEX_RGB 1
-#define TEX_NOR 2
+#define TEX_INT 0
+#define TEX_RGB 1
+#define TEX_NOR 2
/* pr_texture in material, world, light. */
-#define TEX_PR_TEXTURE 0
-#define TEX_PR_OTHER 1
-#define TEX_PR_BOTH 2
+#define TEX_PR_TEXTURE 0
+#define TEX_PR_OTHER 1
+#define TEX_PR_BOTH 2
/* **************** MTEX ********************* */
/* proj */
-#define PROJ_N 0
-#define PROJ_X 1
-#define PROJ_Y 2
-#define PROJ_Z 3
+#define PROJ_N 0
+#define PROJ_X 1
+#define PROJ_Y 2
+#define PROJ_Z 3
/* blendtype */
-#define MTEX_BLEND 0
-#define MTEX_MUL 1
-#define MTEX_ADD 2
-#define MTEX_SUB 3
-#define MTEX_DIV 4
-#define MTEX_DARK 5
-#define MTEX_DIFF 6
-#define MTEX_LIGHT 7
-#define MTEX_SCREEN 8
-#define MTEX_OVERLAY 9
-#define MTEX_BLEND_HUE 10
-#define MTEX_BLEND_SAT 11
-#define MTEX_BLEND_VAL 12
-#define MTEX_BLEND_COLOR 13
-#define MTEX_SOFT_LIGHT 15
-#define MTEX_LIN_LIGHT 16
+#define MTEX_BLEND 0
+#define MTEX_MUL 1
+#define MTEX_ADD 2
+#define MTEX_SUB 3
+#define MTEX_DIV 4
+#define MTEX_DARK 5
+#define MTEX_DIFF 6
+#define MTEX_LIGHT 7
+#define MTEX_SCREEN 8
+#define MTEX_OVERLAY 9
+#define MTEX_BLEND_HUE 10
+#define MTEX_BLEND_SAT 11
+#define MTEX_BLEND_VAL 12
+#define MTEX_BLEND_COLOR 13
+#define MTEX_SOFT_LIGHT 15
+#define MTEX_LIN_LIGHT 16
/* brush_map_mode */
-#define MTEX_MAP_MODE_VIEW 0
-#define MTEX_MAP_MODE_TILED 1
-#define MTEX_MAP_MODE_3D 2
-#define MTEX_MAP_MODE_AREA 3
-#define MTEX_MAP_MODE_RANDOM 4
-#define MTEX_MAP_MODE_STENCIL 5
+#define MTEX_MAP_MODE_VIEW 0
+#define MTEX_MAP_MODE_TILED 1
+#define MTEX_MAP_MODE_3D 2
+#define MTEX_MAP_MODE_AREA 3
+#define MTEX_MAP_MODE_RANDOM 4
+#define MTEX_MAP_MODE_STENCIL 5
/* brush_angle_mode */
-#define MTEX_ANGLE_RANDOM 1
-#define MTEX_ANGLE_RAKE 2
+#define MTEX_ANGLE_RANDOM 1
+#define MTEX_ANGLE_RAKE 2
/* **************** ColorBand ********************* */
/* colormode */
enum {
- COLBAND_BLEND_RGB = 0,
- COLBAND_BLEND_HSV = 1,
- COLBAND_BLEND_HSL = 2,
+ COLBAND_BLEND_RGB = 0,
+ COLBAND_BLEND_HSV = 1,
+ COLBAND_BLEND_HSL = 2,
};
/* interpolation */
enum {
- COLBAND_INTERP_LINEAR = 0,
- COLBAND_INTERP_EASE = 1,
- COLBAND_INTERP_B_SPLINE = 2,
- COLBAND_INTERP_CARDINAL = 3,
- COLBAND_INTERP_CONSTANT = 4,
+ COLBAND_INTERP_LINEAR = 0,
+ COLBAND_INTERP_EASE = 1,
+ COLBAND_INTERP_B_SPLINE = 2,
+ COLBAND_INTERP_CARDINAL = 3,
+ COLBAND_INTERP_CONSTANT = 4,
};
/* color interpolation */
enum {
- COLBAND_HUE_NEAR = 0,
- COLBAND_HUE_FAR = 1,
- COLBAND_HUE_CW = 2,
- COLBAND_HUE_CCW = 3,
+ COLBAND_HUE_NEAR = 0,
+ COLBAND_HUE_FAR = 1,
+ COLBAND_HUE_CW = 2,
+ COLBAND_HUE_CCW = 3,
};
/* **************** PointDensity ********************* */
/* source */
-#define TEX_PD_PSYS 0
-#define TEX_PD_OBJECT 1
-#define TEX_PD_FILE 2
+#define TEX_PD_PSYS 0
+#define TEX_PD_OBJECT 1
+#define TEX_PD_FILE 2
/* falloff_type */
-#define TEX_PD_FALLOFF_STD 0
-#define TEX_PD_FALLOFF_SMOOTH 1
-#define TEX_PD_FALLOFF_SOFT 2
-#define TEX_PD_FALLOFF_CONSTANT 3
-#define TEX_PD_FALLOFF_ROOT 4
+#define TEX_PD_FALLOFF_STD 0
+#define TEX_PD_FALLOFF_SMOOTH 1
+#define TEX_PD_FALLOFF_SOFT 2
+#define TEX_PD_FALLOFF_CONSTANT 3
+#define TEX_PD_FALLOFF_ROOT 4
#define TEX_PD_FALLOFF_PARTICLE_AGE 5
#define TEX_PD_FALLOFF_PARTICLE_VEL 6
/* psys_cache_space */
-#define TEX_PD_OBJECTLOC 0
-#define TEX_PD_OBJECTSPACE 1
-#define TEX_PD_WORLDSPACE 2
+#define TEX_PD_OBJECTLOC 0
+#define TEX_PD_OBJECTSPACE 1
+#define TEX_PD_WORLDSPACE 2
/* flag */
-#define TEX_PD_TURBULENCE 1
-#define TEX_PD_FALLOFF_CURVE 2
+#define TEX_PD_TURBULENCE 1
+#define TEX_PD_FALLOFF_CURVE 2
/* noise_influence */
-#define TEX_PD_NOISE_STATIC 0
-/* #define TEX_PD_NOISE_VEL 1 */ /* Deprecated */
-/* #define TEX_PD_NOISE_AGE 2 */ /* Deprecated */
-/* #define TEX_PD_NOISE_TIME 3 */ /* Deprecated */
+#define TEX_PD_NOISE_STATIC 0
+/* #define TEX_PD_NOISE_VEL 1 */ /* Deprecated */
+/* #define TEX_PD_NOISE_AGE 2 */ /* Deprecated */
+/* #define TEX_PD_NOISE_TIME 3 */ /* Deprecated */
/* color_source */
enum {
- TEX_PD_COLOR_CONSTANT = 0,
- /* color_source: particles */
- TEX_PD_COLOR_PARTAGE = 1,
- TEX_PD_COLOR_PARTSPEED = 2,
- TEX_PD_COLOR_PARTVEL = 3,
- /* color_source: vertices */
- TEX_PD_COLOR_VERTCOL = 1,
- TEX_PD_COLOR_VERTWEIGHT = 2,
- TEX_PD_COLOR_VERTNOR = 3,
+ TEX_PD_COLOR_CONSTANT = 0,
+ /* color_source: particles */
+ TEX_PD_COLOR_PARTAGE = 1,
+ TEX_PD_COLOR_PARTSPEED = 2,
+ TEX_PD_COLOR_PARTVEL = 3,
+ /* color_source: vertices */
+ TEX_PD_COLOR_VERTCOL = 1,
+ TEX_PD_COLOR_VERTWEIGHT = 2,
+ TEX_PD_COLOR_VERTNOR = 3,
};
-#define POINT_DATA_VEL 1
-#define POINT_DATA_LIFE 2
-#define POINT_DATA_COLOR 4
+#define POINT_DATA_VEL 1
+#define POINT_DATA_LIFE 2
+#define POINT_DATA_COLOR 4
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index c7da64b14f8..c1d7a549e4c 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -40,578 +40,578 @@ struct MovieTrackingTrack;
struct bGPdata;
typedef struct MovieReconstructedCamera {
- int framenr;
- float error;
- float mat[4][4];
+ int framenr;
+ float error;
+ float mat[4][4];
} MovieReconstructedCamera;
typedef struct MovieTrackingCamera {
- /** Intrinsics handle. */
- void *intrinsics;
-
- short distortion_model;
- char _pad[2];
-
- /** Width of CCD sensor. */
- float sensor_width;
- /** Pixel aspect ratio. */
- float pixel_aspect;
- /** Focal length. */
- float focal;
- /** Units of focal length user is working with. */
- short units;
- char _pad1[2];
- /** Principal point. */
- float principal[2];
-
- /* Polynomial distortion */
- /** Polynomial radial distortion. */
- float k1, k2, k3;
-
- /* Division distortion model coefficients */
- float division_k1, division_k2;
+ /** Intrinsics handle. */
+ void *intrinsics;
+
+ short distortion_model;
+ char _pad[2];
+
+ /** Width of CCD sensor. */
+ float sensor_width;
+ /** Pixel aspect ratio. */
+ float pixel_aspect;
+ /** Focal length. */
+ float focal;
+ /** Units of focal length user is working with. */
+ short units;
+ char _pad1[2];
+ /** Principal point. */
+ float principal[2];
+
+ /* Polynomial distortion */
+ /** Polynomial radial distortion. */
+ float k1, k2, k3;
+
+ /* Division distortion model coefficients */
+ float division_k1, division_k2;
} MovieTrackingCamera;
typedef struct MovieTrackingMarker {
- /** 2d position of marker on frame (in unified 0..1 space). */
- float pos[2];
-
- /* 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;
- /** Marker's flag (alive, ...). */
- int flag;
+ /** 2d position of marker on frame (in unified 0..1 space). */
+ float pos[2];
+
+ /* 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;
+ /** Marker's flag (alive, ...). */
+ int flag;
} MovieTrackingMarker;
typedef struct MovieTrackingTrack {
- struct MovieTrackingTrack *next, *prev;
-
- /** MAX_NAME. */
- char 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[2] DNA_DEPRECATED, pat_max[2] DNA_DEPRECATED;
-
- /* 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[2] DNA_DEPRECATED, search_max[2] DNA_DEPRECATED;
-
- /** Offset to "parenting" point. */
- float offset[2];
-
- /* ** track ** */
- /** Count of markers in track. */
- int markersnr;
- /** Most recently used marker. */
- int last_marker;
- /** Markers in track. */
- MovieTrackingMarker *markers;
-
- /* ** reconstruction data ** */
- /** Reconstructed position. */
- float bundle_pos[3];
- /** Average track reprojection error. */
- float error;
-
- /* ** UI editing ** */
- /** Flags (selection, ...). */
- int flag, pat_flag, search_flag;
- /** Custom color for track. */
- float color[3];
-
- /* ** control how tracking happens */
- /**
- * Number of frames to be tarcked during single tracking session
- * (if TRACKING_FRAMES_LIMIT is set).
- */
- short frames_limit;
- /** Margin from frame boundaries. */
- short margin;
- /** Re-adjust every N frames. */
- short pattern_match;
-
- /* tracking parameters */
- /** Model of the motion for this track. */
- short motion_model;
- /** Flags for the tracking algorithm (use brute, use esm, use pyramid, etc. */
- int algorithm_flag;
- /** Minimal correlation which is still treated as successful tracking. */
- float minimum_correlation;
-
- /** Grease-pencil data. */
- struct bGPdata *gpd;
-
- /* 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 it's
- * weight is zero and then it gets faded up.
- *
- * Used to prevent jumps of the camera when tracks are appearing or
- * disappearing.
- */
- float weight;
-
- /* track weight especially for 2D stabilization */
- float weight_stab;
+ struct MovieTrackingTrack *next, *prev;
+
+ /** MAX_NAME. */
+ char 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[2] DNA_DEPRECATED, pat_max[2] DNA_DEPRECATED;
+
+ /* 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[2] DNA_DEPRECATED, search_max[2] DNA_DEPRECATED;
+
+ /** Offset to "parenting" point. */
+ float offset[2];
+
+ /* ** track ** */
+ /** Count of markers in track. */
+ int markersnr;
+ /** Most recently used marker. */
+ int last_marker;
+ /** Markers in track. */
+ MovieTrackingMarker *markers;
+
+ /* ** reconstruction data ** */
+ /** Reconstructed position. */
+ float bundle_pos[3];
+ /** Average track reprojection error. */
+ float error;
+
+ /* ** UI editing ** */
+ /** Flags (selection, ...). */
+ int flag, pat_flag, search_flag;
+ /** Custom color for track. */
+ float color[3];
+
+ /* ** control how tracking happens */
+ /**
+ * Number of frames to be tarcked during single tracking session
+ * (if TRACKING_FRAMES_LIMIT is set).
+ */
+ short frames_limit;
+ /** Margin from frame boundaries. */
+ short margin;
+ /** Re-adjust every N frames. */
+ short pattern_match;
+
+ /* tracking parameters */
+ /** Model of the motion for this track. */
+ short motion_model;
+ /** Flags for the tracking algorithm (use brute, use esm, use pyramid, etc. */
+ int algorithm_flag;
+ /** Minimal correlation which is still treated as successful tracking. */
+ float minimum_correlation;
+
+ /** Grease-pencil data. */
+ struct bGPdata *gpd;
+
+ /* 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 it's
+ * weight is zero and then it gets faded up.
+ *
+ * Used to prevent jumps of the camera when tracks are appearing or
+ * disappearing.
+ */
+ float weight;
+
+ /* track weight especially for 2D stabilization */
+ float weight_stab;
} MovieTrackingTrack;
typedef 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;
- /** Marker's flag (alive, ...). */
- int flag;
+ /* 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;
+ /** Marker's flag (alive, ...). */
+ int flag;
} MovieTrackingPlaneMarker;
typedef struct MovieTrackingPlaneTrack {
- struct MovieTrackingPlaneTrack *next, *prev;
-
- /** MAX_NAME. */
- char name[64];
-
- /**
- * Array of point tracks used to define this pla.ne.
- * Each element is a pointer to MovieTrackingTrack.
- */
- MovieTrackingTrack **point_tracks;
- /** Number of tracks in point_tracks array. */
- int point_tracksnr;
- char _pad[4];
-
- /** Markers in the plane track. */
- MovieTrackingPlaneMarker *markers;
- /** Count of markers in track (size of markers array). */
- int markersnr;
-
- /** Flags (selection, ...). */
- int flag;
-
- /** Image displaying during editing. */
- struct Image *image;
- /** Opacity of the image. */
- float image_opacity;
-
- /* Runtime data */
- /** Most recently used marker. */
- int last_marker;
+ struct MovieTrackingPlaneTrack *next, *prev;
+
+ /** MAX_NAME. */
+ char name[64];
+
+ /**
+ * Array of point tracks used to define this pla.ne.
+ * Each element is a pointer to MovieTrackingTrack.
+ */
+ MovieTrackingTrack **point_tracks;
+ /** Number of tracks in point_tracks array. */
+ int point_tracksnr;
+ char _pad[4];
+
+ /** Markers in the plane track. */
+ MovieTrackingPlaneMarker *markers;
+ /** Count of markers in track (size of markers array). */
+ int markersnr;
+
+ /** Flags (selection, ...). */
+ int flag;
+
+ /** Image displaying during editing. */
+ struct Image *image;
+ /** Opacity of the image. */
+ float image_opacity;
+
+ /* Runtime data */
+ /** Most recently used marker. */
+ int last_marker;
} MovieTrackingPlaneTrack;
typedef struct MovieTrackingSettings {
- int flag;
-
- /* ** default tracker settings */
- /** Model of the motion for this track. */
- short default_motion_model;
- /** Flags for the tracking algorithm (use brute, use esm, use pyramid, etc. */
- short default_algorithm_flag;
- /** Minimal correlation which is still treated as successful tracking. */
- float default_minimum_correlation;
- /** Size of pattern area for new tracks. */
- short default_pattern_size;
- /** Size of search area for new tracks. */
- short default_search_size;
- /** Number of frames to be tarcked during single tracking session
- * (if TRACKING_FRAMES_LIMIT is set). */
- short default_frames_limit;
- /** Margin from frame boundaries. */
- short default_margin;
- /** Re-adjust every N frames. */
- short default_pattern_match;
- /** Default flags like color channels used by default. */
- short default_flag;
- /** Default weight of the track. */
- float default_weight;
-
- /** Flags describes motion type. */
- short motion_flag;
-
- /* ** common tracker settings ** */
- /** Speed of tracking. */
- short speed;
-
- /* ** reconstruction settings ** */
- /* two keyframes for reconstruction initialization
- * were moved to per-tracking object settings
- */
- int keyframe1 DNA_DEPRECATED;
- int keyframe2 DNA_DEPRECATED;
-
- int reconstruction_flag;
-
- /* which camera intrinsics to refine. uses on the REFINE_* flags */
- short refine_camera_intrinsics;
- char _pad2[2];
-
- /* ** tool settings ** */
-
- /* set scale */
- /** Distance between two bundles used for scene scaling. */
- float dist;
-
- /* cleanup */
- int clean_frames, clean_action;
- float clean_error;
-
- /* set object scale */
- /** Distance between two bundles used for object scaling. */
- float object_distance;
-
- char _pad3[4];
+ int flag;
+
+ /* ** default tracker settings */
+ /** Model of the motion for this track. */
+ short default_motion_model;
+ /** Flags for the tracking algorithm (use brute, use esm, use pyramid, etc. */
+ short default_algorithm_flag;
+ /** Minimal correlation which is still treated as successful tracking. */
+ float default_minimum_correlation;
+ /** Size of pattern area for new tracks. */
+ short default_pattern_size;
+ /** Size of search area for new tracks. */
+ short default_search_size;
+ /** Number of frames to be tarcked during single tracking session
+ * (if TRACKING_FRAMES_LIMIT is set). */
+ short default_frames_limit;
+ /** Margin from frame boundaries. */
+ short default_margin;
+ /** Re-adjust every N frames. */
+ short default_pattern_match;
+ /** Default flags like color channels used by default. */
+ short default_flag;
+ /** Default weight of the track. */
+ float default_weight;
+
+ /** Flags describes motion type. */
+ short motion_flag;
+
+ /* ** common tracker settings ** */
+ /** Speed of tracking. */
+ short speed;
+
+ /* ** reconstruction settings ** */
+ /* two keyframes for reconstruction initialization
+ * were moved to per-tracking object settings
+ */
+ int keyframe1 DNA_DEPRECATED;
+ int keyframe2 DNA_DEPRECATED;
+
+ int reconstruction_flag;
+
+ /* which camera intrinsics to refine. uses on the REFINE_* flags */
+ short refine_camera_intrinsics;
+ char _pad2[2];
+
+ /* ** tool settings ** */
+
+ /* set scale */
+ /** Distance between two bundles used for scene scaling. */
+ float dist;
+
+ /* cleanup */
+ int clean_frames, clean_action;
+ float clean_error;
+
+ /* set object scale */
+ /** Distance between two bundles used for object scaling. */
+ float object_distance;
+
+ char _pad3[4];
} MovieTrackingSettings;
typedef struct MovieTrackingStabilization {
- int flag;
- /** Total number of translation tracks and index of active track in list. */
- int tot_track, act_track;
- /** Total number of rotation tracks and index of active track in list. */
- int tot_rot_track, act_rot_track;
-
- /* 2d stabilization */
- /** Max auto-scale factor. */
- float maxscale;
- /** Use TRACK_USE_2D_STAB_ROT on individual tracks instead. */
- MovieTrackingTrack *rot_track DNA_DEPRECATED;
-
- /** Reference point to anchor stabilization offset. */
- int anchor_frame;
- /** 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;
- /** Zoom factor known to be present on original footage. Also used for autoscale. */
- float scale;
-
- /** Influence on location, scale and rotation. */
- float locinf, scaleinf, rotinf;
-
- /** Filter used for pixel interpolation. */
- int filter;
-
- /* initialization and run-time data */
- /** Without effect now, we initialize on every frame.
- * Formerly used for caching of init values. */
- int ok DNA_DEPRECATED;
+ int flag;
+ /** Total number of translation tracks and index of active track in list. */
+ int tot_track, act_track;
+ /** Total number of rotation tracks and index of active track in list. */
+ int tot_rot_track, act_rot_track;
+
+ /* 2d stabilization */
+ /** Max auto-scale factor. */
+ float maxscale;
+ /** Use TRACK_USE_2D_STAB_ROT on individual tracks instead. */
+ MovieTrackingTrack *rot_track DNA_DEPRECATED;
+
+ /** Reference point to anchor stabilization offset. */
+ int anchor_frame;
+ /** 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;
+ /** Zoom factor known to be present on original footage. Also used for autoscale. */
+ float scale;
+
+ /** Influence on location, scale and rotation. */
+ float locinf, scaleinf, rotinf;
+
+ /** Filter used for pixel interpolation. */
+ int filter;
+
+ /* initialization and run-time data */
+ /** Without effect now, we initialize on every frame.
+ * Formerly used for caching of init values. */
+ int ok DNA_DEPRECATED;
} MovieTrackingStabilization;
typedef struct MovieTrackingReconstruction {
- int flag;
+ int flag;
- /** Average error of reconstruction. */
- float error;
+ /** Average error of reconstruction. */
+ float error;
- /** Most recently used camera. */
- int last_camera;
- /** Number of reconstructed cameras. */
- int camnr;
- /** Reconstructed cameras. */
- struct MovieReconstructedCamera *cameras;
+ /** Most recently used camera. */
+ int last_camera;
+ /** Number of reconstructed cameras. */
+ int camnr;
+ /** Reconstructed cameras. */
+ struct MovieReconstructedCamera *cameras;
} MovieTrackingReconstruction;
typedef struct MovieTrackingObject {
- struct MovieTrackingObject *next, *prev;
-
- /** Name of tracking object, MAX_NAME. */
- char name[64];
- int flag;
- /** Scale of object solution in amera space. */
- float scale;
-
- /** List of tracks use to tracking this object. */
- ListBase tracks;
- /** List of plane tracks used by this object. */
- ListBase plane_tracks;
- /** Reconstruction data for this object. */
- MovieTrackingReconstruction reconstruction;
-
- /* reconstruction options */
- /** Two keyframes for reconstruction initialization. */
- int keyframe1, keyframe2;
+ struct MovieTrackingObject *next, *prev;
+
+ /** Name of tracking object, MAX_NAME. */
+ char name[64];
+ int flag;
+ /** Scale of object solution in amera space. */
+ float scale;
+
+ /** List of tracks use to tracking this object. */
+ ListBase tracks;
+ /** List of plane tracks used by this object. */
+ ListBase plane_tracks;
+ /** Reconstruction data for this object. */
+ MovieTrackingReconstruction reconstruction;
+
+ /* reconstruction options */
+ /** Two keyframes for reconstruction initialization. */
+ int keyframe1, keyframe2;
} MovieTrackingObject;
typedef struct MovieTrackingStats {
- char message[256];
+ char message[256];
} MovieTrackingStats;
typedef struct MovieTrackingDopesheetChannel {
- struct MovieTrackingDopesheetChannel *next, *prev;
+ struct MovieTrackingDopesheetChannel *next, *prev;
- /** Motion track for which channel is created. */
- MovieTrackingTrack *track;
- char _pad[4];
+ /** Motion track for which channel is created. */
+ MovieTrackingTrack *track;
+ char _pad[4];
- /** Name of channel. */
- char name[64];
+ /** Name of channel. */
+ char name[64];
- /** Total number of segments. */
- int tot_segment;
- /** Tracked segments. */
- int *segments;
- /** Longest segment length and total number of tracked frames. */
- int max_segment, total_frames;
+ /** Total number of segments. */
+ int tot_segment;
+ /** Tracked segments. */
+ int *segments;
+ /** Longest segment length and total number of tracked frames. */
+ int max_segment, total_frames;
} MovieTrackingDopesheetChannel;
typedef struct MovieTrackingDopesheetCoverageSegment {
- struct MovieTrackingDopesheetCoverageSegment *next, *prev;
+ struct MovieTrackingDopesheetCoverageSegment *next, *prev;
- int coverage;
- int start_frame;
- int end_frame;
+ int coverage;
+ int start_frame;
+ int end_frame;
- char _pad[4];
+ char _pad[4];
} MovieTrackingDopesheetCoverageSegment;
typedef struct MovieTrackingDopesheet {
- /** Flag if dopesheet information is still relevant. */
- int ok;
+ /** Flag if dopesheet information is still relevant. */
+ int ok;
- /** Method to be used to sort tracks. */
- short sort_method;
- /** Dopesheet building flag such as inverted order of sort. */
- short flag;
+ /** Method to be used to sort tracks. */
+ short sort_method;
+ /** Dopesheet building flag such as inverted order of sort. */
+ short flag;
- /* ** runtime stuff ** */
+ /* ** runtime stuff ** */
- /* summary */
- ListBase coverage_segments;
+ /* summary */
+ ListBase coverage_segments;
- /* detailed */
- ListBase channels;
- int tot_channel;
+ /* detailed */
+ ListBase channels;
+ int tot_channel;
- char _pad[4];
+ char _pad[4];
} MovieTrackingDopesheet;
typedef struct MovieTracking {
- /** Different tracking-related settings. */
- MovieTrackingSettings settings;
- /** Camera intrinsics. */
- MovieTrackingCamera camera;
- /** List of tracks used for camera object. */
- ListBase tracks;
- /** List of plane tracks used by camera object. */
- ListBase plane_tracks;
- /** Reconstruction data for camera object. */
- MovieTrackingReconstruction reconstruction;
- /** Stabilization data. */
- MovieTrackingStabilization stabilization;
- /** Active track. */
- MovieTrackingTrack *act_track;
- /** Active plane track. */
- MovieTrackingPlaneTrack *act_plane_track;
-
- ListBase objects;
- /** Index of active object and total number of objects. */
- int objectnr, tot_object;
-
- /** Statistics displaying in clip editor. */
- MovieTrackingStats *stats;
-
- /** Dopesheet data. */
- MovieTrackingDopesheet dopesheet;
+ /** Different tracking-related settings. */
+ MovieTrackingSettings settings;
+ /** Camera intrinsics. */
+ MovieTrackingCamera camera;
+ /** List of tracks used for camera object. */
+ ListBase tracks;
+ /** List of plane tracks used by camera object. */
+ ListBase plane_tracks;
+ /** Reconstruction data for camera object. */
+ MovieTrackingReconstruction reconstruction;
+ /** Stabilization data. */
+ MovieTrackingStabilization stabilization;
+ /** Active track. */
+ MovieTrackingTrack *act_track;
+ /** Active plane track. */
+ MovieTrackingPlaneTrack *act_plane_track;
+
+ ListBase objects;
+ /** Index of active object and total number of objects. */
+ int objectnr, tot_object;
+
+ /** Statistics displaying in clip editor. */
+ MovieTrackingStats *stats;
+
+ /** Dopesheet data. */
+ MovieTrackingDopesheet dopesheet;
} MovieTracking;
/* MovieTrackingCamera->distortion_model */
enum {
- TRACKING_DISTORTION_MODEL_POLYNOMIAL = 0,
- TRACKING_DISTORTION_MODEL_DIVISION = 1,
+ TRACKING_DISTORTION_MODEL_POLYNOMIAL = 0,
+ TRACKING_DISTORTION_MODEL_DIVISION = 1,
};
/* MovieTrackingCamera->units */
enum {
- CAMERA_UNITS_PX = 0,
- CAMERA_UNITS_MM = 1,
+ CAMERA_UNITS_PX = 0,
+ CAMERA_UNITS_MM = 1,
};
/* MovieTrackingMarker->flag */
enum {
- 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),
+ 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),
};
/* MovieTrackingTrack->flag */
enum {
- 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),
+ 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),
};
/* MovieTrackingTrack->motion_model */
enum {
- 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,
+ 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,
};
/* MovieTrackingTrack->algorithm_flag */
enum {
- TRACK_ALGORITHM_FLAG_USE_BRUTE = (1 << 0),
- TRACK_ALGORITHM_FLAG_USE_NORMALIZATION = (1 << 2),
- TRACK_ALGORITHM_FLAG_USE_MASK = (1 << 3),
+ TRACK_ALGORITHM_FLAG_USE_BRUTE = (1 << 0),
+ TRACK_ALGORITHM_FLAG_USE_NORMALIZATION = (1 << 2),
+ TRACK_ALGORITHM_FLAG_USE_MASK = (1 << 3),
};
/* MovieTrackingTrack->adjframes */
enum {
- TRACK_MATCH_KEYFRAME = 0,
- TRACK_MATCH_PREVFRAME = 1,
+ TRACK_MATCH_KEYFRAME = 0,
+ TRACK_MATCH_PREVFRAME = 1,
};
/* MovieTrackingSettings->flag */
enum {
- TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED = (1 << 0),
- TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED = (1 << 1),
+ TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED = (1 << 0),
+ TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED = (1 << 1),
};
/* MovieTrackingSettings->motion_flag */
enum {
- TRACKING_MOTION_TRIPOD = (1 << 0),
+ TRACKING_MOTION_TRIPOD = (1 << 0),
- TRACKING_MOTION_MODAL = (TRACKING_MOTION_TRIPOD),
+ TRACKING_MOTION_MODAL = (TRACKING_MOTION_TRIPOD),
};
/* MovieTrackingSettings->speed */
enum {
- TRACKING_SPEED_FASTEST = 0,
- TRACKING_SPEED_REALTIME = 1,
- TRACKING_SPEED_HALF = 2,
- TRACKING_SPEED_QUARTER = 4,
- TRACKING_SPEED_DOUBLE = 5,
+ TRACKING_SPEED_FASTEST = 0,
+ TRACKING_SPEED_REALTIME = 1,
+ TRACKING_SPEED_HALF = 2,
+ TRACKING_SPEED_QUARTER = 4,
+ TRACKING_SPEED_DOUBLE = 5,
};
/* MovieTrackingSettings->reconstruction_flag */
enum {
- /* TRACKING_USE_FALLBACK_RECONSTRUCTION = (1 << 0), */ /* DEPRECATED */
- TRACKING_USE_KEYFRAME_SELECTION = (1 << 1),
+ /* TRACKING_USE_FALLBACK_RECONSTRUCTION = (1 << 0), */ /* DEPRECATED */
+ TRACKING_USE_KEYFRAME_SELECTION = (1 << 1),
};
/* MovieTrackingSettings->refine_camera_intrinsics */
enum {
- REFINE_FOCAL_LENGTH = (1 << 0),
- REFINE_PRINCIPAL_POINT = (1 << 1),
- REFINE_RADIAL_DISTORTION_K1 = (1 << 2),
- REFINE_RADIAL_DISTORTION_K2 = (1 << 4),
+ REFINE_FOCAL_LENGTH = (1 << 0),
+ REFINE_PRINCIPAL_POINT = (1 << 1),
+ REFINE_RADIAL_DISTORTION_K1 = (1 << 2),
+ REFINE_RADIAL_DISTORTION_K2 = (1 << 4),
};
/* MovieTrackingStrabilization->flag */
enum {
- 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),
+ 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),
};
/* MovieTrackingStrabilization->filter */
enum {
- TRACKING_FILTER_NEAREST = 0,
- TRACKING_FILTER_BILINEAR = 1,
- TRACKING_FILTER_BICUBIC = 2,
+ TRACKING_FILTER_NEAREST = 0,
+ TRACKING_FILTER_BILINEAR = 1,
+ TRACKING_FILTER_BICUBIC = 2,
};
/* MovieTrackingReconstruction->flag */
enum {
- TRACKING_RECONSTRUCTED = (1 << 0),
+ TRACKING_RECONSTRUCTED = (1 << 0),
};
/* MovieTrackingObject->flag */
enum {
- TRACKING_OBJECT_CAMERA = (1 << 0),
+ TRACKING_OBJECT_CAMERA = (1 << 0),
};
enum {
- TRACKING_CLEAN_SELECT = 0,
- TRACKING_CLEAN_DELETE_TRACK = 1,
- TRACKING_CLEAN_DELETE_SEGMENT = 2,
+ TRACKING_CLEAN_SELECT = 0,
+ TRACKING_CLEAN_DELETE_TRACK = 1,
+ TRACKING_CLEAN_DELETE_SEGMENT = 2,
};
/* MovieTrackingDopesheet->sort_method */
enum {
- TRACKING_DOPE_SORT_NAME = 0,
- TRACKING_DOPE_SORT_LONGEST = 1,
- TRACKING_DOPE_SORT_TOTAL = 2,
- TRACKING_DOPE_SORT_AVERAGE_ERROR = 3,
+ TRACKING_DOPE_SORT_NAME = 0,
+ TRACKING_DOPE_SORT_LONGEST = 1,
+ TRACKING_DOPE_SORT_TOTAL = 2,
+ TRACKING_DOPE_SORT_AVERAGE_ERROR = 3,
};
/* MovieTrackingDopesheet->flag */
enum {
- TRACKING_DOPE_SORT_INVERSE = (1 << 0),
- TRACKING_DOPE_SELECTED_ONLY = (1 << 1),
- TRACKING_DOPE_SHOW_HIDDEN = (1 << 2),
+ TRACKING_DOPE_SORT_INVERSE = (1 << 0),
+ TRACKING_DOPE_SELECTED_ONLY = (1 << 1),
+ TRACKING_DOPE_SHOW_HIDDEN = (1 << 2),
};
/* MovieTrackingDopesheetCoverageSegment->trackness */
enum {
- TRACKING_COVERAGE_BAD = 0,
- TRACKING_COVERAGE_ACCEPTABLE = 1,
- TRACKING_COVERAGE_OK = 2,
+ TRACKING_COVERAGE_BAD = 0,
+ TRACKING_COVERAGE_ACCEPTABLE = 1,
+ TRACKING_COVERAGE_OK = 2,
};
/* MovieTrackingPlaneMarker->flag */
enum {
- PLANE_MARKER_DISABLED = (1 << 0),
- PLANE_MARKER_TRACKED = (1 << 1),
+ PLANE_MARKER_DISABLED = (1 << 0),
+ PLANE_MARKER_TRACKED = (1 << 1),
};
/* MovieTrackingPlaneTrack->flag */
enum {
- PLANE_TRACK_HIDDEN = (1 << 1),
- PLANE_TRACK_LOCKED = (1 << 2),
- PLANE_TRACK_AUTOKEY = (1 << 3),
+ PLANE_TRACK_HIDDEN = (1 << 1),
+ PLANE_TRACK_LOCKED = (1 << 2),
+ PLANE_TRACK_AUTOKEY = (1 << 3),
};
-#endif /* __DNA_TRACKING_TYPES_H__ */
+#endif /* __DNA_TRACKING_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index d44b149d3fd..57d685b527c 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -36,7 +36,7 @@ struct ColorBand;
/* ************************ style definitions ******************** */
-#define MAX_STYLE_NAME 64
+#define MAX_STYLE_NAME 64
#define GPU_VIEWPORT_QUALITY_FXAA 0.10f
#define GPU_VIEWPORT_QUALITY_TAA8 0.25f
@@ -46,721 +46,723 @@ struct ColorBand;
/** default offered by Blender.
* #uiFont.uifont_id */
typedef enum eUIFont_ID {
- UIFONT_DEFAULT = 0,
-/* UIFONT_BITMAP = 1 */ /* UNUSED */
+ UIFONT_DEFAULT = 0,
+ /* UIFONT_BITMAP = 1 */ /* UNUSED */
- /* free slots */
- UIFONT_CUSTOM1 = 2,
- UIFONT_CUSTOM2 = 3,
+ /* free slots */
+ UIFONT_CUSTOM1 = 2,
+ UIFONT_CUSTOM2 = 3,
} eUIFont_ID;
/* default fonts to load/initialize */
/* first font is the default (index 0), others optional */
typedef struct uiFont {
- struct uiFont *next, *prev;
- /** 1024 = FILE_MAX. */
- char filename[1024];
- /** From blfont lib. */
- short blf_id;
- /** Own id (eUIFont_ID). */
- short uifont_id;
- /** Fonts that read from left to right. */
- short r_to_l;
- char _pad0[2];
+ struct uiFont *next, *prev;
+ /** 1024 = FILE_MAX. */
+ char filename[1024];
+ /** From blfont lib. */
+ short blf_id;
+ /** Own id (eUIFont_ID). */
+ short uifont_id;
+ /** Fonts that read from left to right. */
+ short r_to_l;
+ char _pad0[2];
} uiFont;
/* this state defines appearance of text */
typedef struct uiFontStyle {
- /** Saved in file, 0 is default. */
- short uifont_id;
- /** Actual size depends on 'global' dpi. */
- short points;
- /** Unfitted or default kerning value. */
- short kerning;
- /** Style hint. */
- short italic, bold;
- /** Value is amount of pixels blur. */
- short shadow;
- /** Shadow offset in pixels. */
- short shadx, shady;
- /** Total alpha. */
- float shadowalpha;
- /** 1 value, typically white or black anyway. */
- float shadowcolor;
+ /** Saved in file, 0 is default. */
+ short uifont_id;
+ /** Actual size depends on 'global' dpi. */
+ short points;
+ /** Unfitted or default kerning value. */
+ short kerning;
+ /** Style hint. */
+ short italic, bold;
+ /** Value is amount of pixels blur. */
+ short shadow;
+ /** Shadow offset in pixels. */
+ short shadx, shady;
+ /** Total alpha. */
+ float shadowalpha;
+ /** 1 value, typically white or black anyway. */
+ float shadowcolor;
} uiFontStyle;
/* this is fed to the layout engine and widget code */
typedef struct uiStyle {
- struct uiStyle *next, *prev;
+ struct uiStyle *next, *prev;
- /** MAX_STYLE_NAME. */
- char name[64];
+ /** MAX_STYLE_NAME. */
+ char name[64];
- uiFontStyle paneltitle;
- uiFontStyle grouplabel;
- uiFontStyle widgetlabel;
- uiFontStyle widget;
+ uiFontStyle paneltitle;
+ uiFontStyle grouplabel;
+ uiFontStyle widgetlabel;
+ uiFontStyle widget;
- float panelzoom;
+ float panelzoom;
- /** In characters. */
- short minlabelchars;
- /** In characters. */
- short minwidgetchars;
+ /** In characters. */
+ short minlabelchars;
+ /** In characters. */
+ short minwidgetchars;
- short columnspace;
- short templatespace;
- short boxspace;
- short buttonspacex;
- short buttonspacey;
- short panelspace;
- short panelouter;
+ short columnspace;
+ short templatespace;
+ short boxspace;
+ short buttonspacex;
+ short buttonspacey;
+ short panelspace;
+ short panelouter;
- char _pad0[2];
+ char _pad0[2];
} uiStyle;
typedef struct uiWidgetColors {
- char outline[4];
- char inner[4];
- char inner_sel[4];
- char item[4];
- char text[4];
- char text_sel[4];
- char shaded;
- char _pad0[7];
- short shadetop, shadedown;
- float roundness;
+ char outline[4];
+ char inner[4];
+ char inner_sel[4];
+ char item[4];
+ char text[4];
+ char text_sel[4];
+ char shaded;
+ char _pad0[7];
+ short shadetop, shadedown;
+ float roundness;
} uiWidgetColors;
typedef struct uiWidgetStateColors {
- char inner_anim[4];
- char inner_anim_sel[4];
- char inner_key[4];
- char inner_key_sel[4];
- char inner_driven[4];
- char inner_driven_sel[4];
- char inner_overridden[4];
- char inner_overridden_sel[4];
- char inner_changed[4];
- char inner_changed_sel[4];
- float blend;
- char _pad0[4];
+ char inner_anim[4];
+ char inner_anim_sel[4];
+ char inner_key[4];
+ char inner_key_sel[4];
+ char inner_driven[4];
+ char inner_driven_sel[4];
+ char inner_overridden[4];
+ char inner_overridden_sel[4];
+ char inner_changed[4];
+ char inner_changed_sel[4];
+ float blend;
+ char _pad0[4];
} uiWidgetStateColors;
typedef struct uiPanelColors {
- char header[4];
- char back[4];
- char sub_back[4];
- char _pad0[4];
+ char header[4];
+ char back[4];
+ char sub_back[4];
+ char _pad0[4];
} uiPanelColors;
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;
- 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;
-
- char widget_emboss[4];
-
- /* fac: 0 - 1 for blend factor, width in pixels */
- float menu_shadow_fac;
- short menu_shadow_width;
-
- char editor_outline[4];
- char _pad0[2];
-
- float icon_alpha;
- float icon_saturation;
- char _pad[4];
-
- /* Axis Colors */
- char xaxis[4], yaxis[4], zaxis[4];
-
- /* Gizmo Colors. */
- char gizmo_hi[4];
- char gizmo_primary[4];
- char gizmo_secondary[4];
- char gizmo_a[4];
- char gizmo_b[4];
-
- /* Icon Colors. */
- /** Collection items. */
- char icon_collection[4];
- /** Object items. */
- char icon_object[4];
- /** Object data items. */
- char icon_object_data[4];
- /** Modifier and constraint items. */
- char icon_modifier[4];
- /** Shading related items. */
- char icon_shading[4];
+ /* 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;
+ 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;
+
+ char widget_emboss[4];
+
+ /* fac: 0 - 1 for blend factor, width in pixels */
+ float menu_shadow_fac;
+ short menu_shadow_width;
+
+ char editor_outline[4];
+ char _pad0[2];
+
+ float icon_alpha;
+ float icon_saturation;
+ char _pad[4];
+
+ /* Axis Colors */
+ char xaxis[4], yaxis[4], zaxis[4];
+
+ /* Gizmo Colors. */
+ char gizmo_hi[4];
+ char gizmo_primary[4];
+ char gizmo_secondary[4];
+ char gizmo_a[4];
+ char gizmo_b[4];
+
+ /* Icon Colors. */
+ /** Collection items. */
+ char icon_collection[4];
+ /** Object items. */
+ char icon_object[4];
+ /** Object data items. */
+ char icon_object_data[4];
+ /** Modifier and constraint items. */
+ char icon_modifier[4];
+ /** Shading related items. */
+ char icon_shading[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 */
- char back[4];
- char back_grad[4];
-
- char show_back_grad;
- char _pad0[3];
-
- /** Panel title. */
- char title[4];
- char text[4];
- char text_hi[4];
-
- /* header colors */
- /** Region background. */
- char header[4];
- /** Unused. */
- char header_title[4];
- char header_text[4];
- char header_text_hi[4];
-
- /* region tabs */
- char tab_active[4];
- char tab_inactive[4];
- char tab_back[4];
- char tab_outline[4];
-
- /* button/tool regions */
- /** Region background. */
- char button[4];
- /** Panel title. */
- char button_title[4];
- char button_text[4];
- char button_text_hi[4];
-
- /* listview regions */
- /** Region background. */
- char list[4];
- /** Panel title. */
- char list_title[4];
- char list_text[4];
- char list_text_hi[4];
-
- /* navigation bar regions */
- /** Region background. */
- char navigation_bar[4];
- /** Region background. */
- char execution_buts[4];
-
- /* note, cannot use name 'panel' because of DNA mapping old files */
- uiPanelColors panelcolors;
-
- char shade1[4];
- char shade2[4];
-
- char hilite[4];
- char grid[4];
-
- char view_overlay[4];
-
- char wire[4], wire_edit[4], select[4];
- char lamp[4], speaker[4], empty[4], camera[4];
- char active[4], group[4], group_active[4], transform[4];
- char vertex[4], vertex_select[4], vertex_bevel[4], vertex_unreferenced[4];
- char edge[4], edge_select[4];
- char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4], edge_bevel[4];
- /** Solid faces. */
- char face[4], face_select[4];
- /** selected color. */
- char face_dot[4];
- char extra_edge_len[4], extra_edge_angle[4], extra_face_angle[4], extra_face_area[4];
- char normal[4];
- char vertex_normal[4];
- char loop_normal[4];
- char bone_solid[4], bone_pose[4], bone_pose_active[4];
- char strip[4], strip_select[4];
- char cframe[4];
- char time_keyframe[4], time_gp_keyframe[4];
- char freestyle_edge_mark[4], freestyle_face_mark[4];
-
- char nurb_uline[4], nurb_vline[4];
- char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
-
- char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4], handle_auto_clamped[4];
- char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4], handle_sel_auto_clamped[4];
-
- /** Dopesheet. */
- char ds_channel[4], ds_subchannel[4], ds_ipoline[4];
- /** Keytypes. */
- char keytype_keyframe[4], keytype_extreme[4], keytype_breakdown[4], keytype_jitter[4], keytype_movehold[4];
- /** Keytypes. */
- char keytype_keyframe_select[4], keytype_extreme_select[4], keytype_breakdown_select[4], keytype_jitter_select[4], keytype_movehold_select[4];
- char keyborder[4], keyborder_select[4];
- char _pad4[4];
-
- char console_output[4], console_input[4], console_info[4], console_error[4];
- char console_cursor[4], console_select[4];
-
- char vertex_size, outline_width, facedot_size;
- char noodle_curving;
-
- /* syntax for textwindow and nodes */
- char syntaxl[4], syntaxs[4]; // in nodespace used for backdrop matte
- char syntaxb[4], syntaxn[4]; // in nodespace used for color input
- char syntaxv[4], syntaxc[4]; // in nodespace used for converter group
- char syntaxd[4], syntaxr[4]; // in nodespace used for distort
-
- char nodeclass_output[4], nodeclass_filter[4];
- char nodeclass_vector[4], nodeclass_texture[4];
- char nodeclass_shader[4], nodeclass_script[4];
- char nodeclass_pattern[4], nodeclass_layout[4];
-
- /** For sequence editor. */
- char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];
- char effect[4], transition[4], meta[4], text_strip[4];
-
- /** For dopesheet - scale factor for size of keyframes (i.e. height of channels). */
- float keyframe_scale_fac;
-
- char editmesh_active[4];
-
- char handle_vertex[4];
- char handle_vertex_select[4];
-
- char handle_vertex_size;
-
- char clipping_border_3d[4];
-
- char marker_outline[4], marker[4], act_marker[4], sel_marker[4], dis_marker[4], lock_marker[4];
- char bundle_solid[4];
- char path_before[4], path_after[4];
- char camera_path[4];
- char _pad1[2];
-
- char gp_vertex_size;
- char gp_vertex[4], gp_vertex_select[4];
-
- char preview_back[4];
- char preview_stitch_face[4];
- char preview_stitch_edge[4];
- char preview_stitch_vert[4];
- char preview_stitch_stitchable[4];
- char preview_stitch_unstitchable[4];
- char preview_stitch_active[4];
-
- /** Two uses, for uvs with modifier applied on mesh and uvs during painting. */
- char uv_shadow[4];
- /** Uvs of other objects. */
- char uv_others[4];
-
- /** Outliner - filter match. */
- char match[4];
- /** Outliner - selected item. */
- char selected_highlight[4];
-
- /** Skin modifier root color. */
- char skin_root[4];
-
- /* NLA */
- /** Active Action + Summary Channel. */
- char anim_active[4];
- /** Active Action = NULL. */
- char anim_non_active[4];
- /** Preview range overlay. */
- char anim_preview_range[4];
- char _pad2[4];
-
- /** NLA 'Tweaking' action/strip. */
- char nla_tweaking[4];
- /** NLA - warning color for duplicate instances of tweaking strip. */
- char nla_tweakdupli[4];
-
- /** NLA "Transition" strips. */
- char nla_transition[4], nla_transition_sel[4];
- /** NLA "Meta" strips. */
- char nla_meta[4], nla_meta_sel[4];
- /** NLA "Sound" strips. */
- char nla_sound[4], nla_sound_sel[4];
-
- /* info */
- char info_selected[4], info_selected_text[4];
- char info_error[4], info_error_text[4];
- char info_warning[4], info_warning_text[4];
- char info_info[4], info_info_text[4];
- char info_debug[4], info_debug_text[4];
-
- char paint_curve_pivot[4];
- char paint_curve_handle[4];
-
- char metadatabg[4];
- char metadatatext[4];
+ /* main window colors */
+ char back[4];
+ char back_grad[4];
+
+ char show_back_grad;
+ char _pad0[3];
+
+ /** Panel title. */
+ char title[4];
+ char text[4];
+ char text_hi[4];
+
+ /* header colors */
+ /** Region background. */
+ char header[4];
+ /** Unused. */
+ char header_title[4];
+ char header_text[4];
+ char header_text_hi[4];
+
+ /* region tabs */
+ char tab_active[4];
+ char tab_inactive[4];
+ char tab_back[4];
+ char tab_outline[4];
+
+ /* button/tool regions */
+ /** Region background. */
+ char button[4];
+ /** Panel title. */
+ char button_title[4];
+ char button_text[4];
+ char button_text_hi[4];
+
+ /* listview regions */
+ /** Region background. */
+ char list[4];
+ /** Panel title. */
+ char list_title[4];
+ char list_text[4];
+ char list_text_hi[4];
+
+ /* navigation bar regions */
+ /** Region background. */
+ char navigation_bar[4];
+ /** Region background. */
+ char execution_buts[4];
+
+ /* note, cannot use name 'panel' because of DNA mapping old files */
+ uiPanelColors panelcolors;
+
+ char shade1[4];
+ char shade2[4];
+
+ char hilite[4];
+ char grid[4];
+
+ char view_overlay[4];
+
+ char wire[4], wire_edit[4], select[4];
+ char lamp[4], speaker[4], empty[4], camera[4];
+ char active[4], group[4], group_active[4], transform[4];
+ char vertex[4], vertex_select[4], vertex_bevel[4], vertex_unreferenced[4];
+ char edge[4], edge_select[4];
+ char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4], edge_bevel[4];
+ /** Solid faces. */
+ char face[4], face_select[4];
+ /** selected color. */
+ char face_dot[4];
+ char extra_edge_len[4], extra_edge_angle[4], extra_face_angle[4], extra_face_area[4];
+ char normal[4];
+ char vertex_normal[4];
+ char loop_normal[4];
+ char bone_solid[4], bone_pose[4], bone_pose_active[4];
+ char strip[4], strip_select[4];
+ char cframe[4];
+ char time_keyframe[4], time_gp_keyframe[4];
+ char freestyle_edge_mark[4], freestyle_face_mark[4];
+
+ char nurb_uline[4], nurb_vline[4];
+ char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
+
+ char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4], handle_auto_clamped[4];
+ char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4],
+ handle_sel_auto_clamped[4];
+
+ /** Dopesheet. */
+ char ds_channel[4], ds_subchannel[4], ds_ipoline[4];
+ /** Keytypes. */
+ char keytype_keyframe[4], keytype_extreme[4], keytype_breakdown[4], keytype_jitter[4],
+ keytype_movehold[4];
+ /** Keytypes. */
+ char keytype_keyframe_select[4], keytype_extreme_select[4], keytype_breakdown_select[4],
+ keytype_jitter_select[4], keytype_movehold_select[4];
+ char keyborder[4], keyborder_select[4];
+ char _pad4[4];
+
+ char console_output[4], console_input[4], console_info[4], console_error[4];
+ char console_cursor[4], console_select[4];
+
+ char vertex_size, outline_width, facedot_size;
+ char noodle_curving;
+
+ /* syntax for textwindow and nodes */
+ char syntaxl[4], syntaxs[4]; // in nodespace used for backdrop matte
+ char syntaxb[4], syntaxn[4]; // in nodespace used for color input
+ char syntaxv[4], syntaxc[4]; // in nodespace used for converter group
+ char syntaxd[4], syntaxr[4]; // in nodespace used for distort
+
+ char nodeclass_output[4], nodeclass_filter[4];
+ char nodeclass_vector[4], nodeclass_texture[4];
+ char nodeclass_shader[4], nodeclass_script[4];
+ char nodeclass_pattern[4], nodeclass_layout[4];
+
+ /** For sequence editor. */
+ char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];
+ char effect[4], transition[4], meta[4], text_strip[4];
+
+ /** For dopesheet - scale factor for size of keyframes (i.e. height of channels). */
+ float keyframe_scale_fac;
+
+ char editmesh_active[4];
+
+ char handle_vertex[4];
+ char handle_vertex_select[4];
+
+ char handle_vertex_size;
+
+ char clipping_border_3d[4];
+
+ char marker_outline[4], marker[4], act_marker[4], sel_marker[4], dis_marker[4], lock_marker[4];
+ char bundle_solid[4];
+ char path_before[4], path_after[4];
+ char camera_path[4];
+ char _pad1[2];
+
+ char gp_vertex_size;
+ char gp_vertex[4], gp_vertex_select[4];
+
+ char preview_back[4];
+ char preview_stitch_face[4];
+ char preview_stitch_edge[4];
+ char preview_stitch_vert[4];
+ char preview_stitch_stitchable[4];
+ char preview_stitch_unstitchable[4];
+ char preview_stitch_active[4];
+
+ /** Two uses, for uvs with modifier applied on mesh and uvs during painting. */
+ char uv_shadow[4];
+ /** Uvs of other objects. */
+ char uv_others[4];
+
+ /** Outliner - filter match. */
+ char match[4];
+ /** Outliner - selected item. */
+ char selected_highlight[4];
+
+ /** Skin modifier root color. */
+ char skin_root[4];
+
+ /* NLA */
+ /** Active Action + Summary Channel. */
+ char anim_active[4];
+ /** Active Action = NULL. */
+ char anim_non_active[4];
+ /** Preview range overlay. */
+ char anim_preview_range[4];
+ char _pad2[4];
+
+ /** NLA 'Tweaking' action/strip. */
+ char nla_tweaking[4];
+ /** NLA - warning color for duplicate instances of tweaking strip. */
+ char nla_tweakdupli[4];
+
+ /** NLA "Transition" strips. */
+ char nla_transition[4], nla_transition_sel[4];
+ /** NLA "Meta" strips. */
+ char nla_meta[4], nla_meta_sel[4];
+ /** NLA "Sound" strips. */
+ char nla_sound[4], nla_sound_sel[4];
+
+ /* info */
+ char info_selected[4], info_selected_text[4];
+ char info_error[4], info_error_text[4];
+ char info_warning[4], info_warning_text[4];
+ char info_info[4], info_info_text[4];
+ char info_debug[4], info_debug_text[4];
+
+ char paint_curve_pivot[4];
+ char paint_curve_handle[4];
+
+ char metadatabg[4];
+ char metadatatext[4];
} ThemeSpace;
-
/* set of colors for use as a custom color set for Objects/Bones wire drawing */
typedef struct ThemeWireColor {
- char solid[4];
- char select[4];
- char active[4];
+ char solid[4];
+ char select[4];
+ char active[4];
- /** #eWireColor_Flags. */
- short flag;
- char _pad0[2];
+ /** #eWireColor_Flags. */
+ short flag;
+ char _pad0[2];
} ThemeWireColor;
/** #ThemeWireColor.flag */
typedef enum eWireColor_Flags {
- TH_WIRECOLOR_CONSTCOLS = (1 << 0),
- TH_WIRECOLOR_TEXTCOLS = (1 << 1),
+ TH_WIRECOLOR_CONSTCOLS = (1 << 0),
+ TH_WIRECOLOR_TEXTCOLS = (1 << 1),
} eWireColor_Flags;
/* A theme */
typedef struct bTheme {
- struct bTheme *next, *prev;
- char name[32];
-
- ThemeUI tui;
-
- /* Individual Spacetypes */
- /* 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;
-
- /* 20 sets of bone colors for this theme */
- ThemeWireColor tarm[20];
- /*ThemeWireColor tobj[20];*/
-
- int active_theme_area;
- char _pad0[4];
+ struct bTheme *next, *prev;
+ char name[32];
+
+ ThemeUI tui;
+
+ /* Individual Spacetypes */
+ /* 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;
+
+ /* 20 sets of bone colors for this theme */
+ ThemeWireColor tarm[20];
+ /*ThemeWireColor tobj[20];*/
+
+ int active_theme_area;
+ char _pad0[4];
} bTheme;
-#define UI_THEMESPACE_START(btheme) (CHECK_TYPE_INLINE(btheme, bTheme *), &((btheme)->tbuts))
-#define UI_THEMESPACE_END(btheme) (CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->tclip) + 1))
+#define UI_THEMESPACE_START(btheme) (CHECK_TYPE_INLINE(btheme, bTheme *), &((btheme)->tbuts))
+#define UI_THEMESPACE_END(btheme) (CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->tclip) + 1))
typedef struct bAddon {
- struct bAddon *next, *prev;
- char module[64];
- /** User-Defined Properties on this Addon (for storing preferences). */
- IDProperty *prop;
+ struct bAddon *next, *prev;
+ char module[64];
+ /** User-Defined Properties on this Addon (for storing preferences). */
+ IDProperty *prop;
} bAddon;
typedef struct bPathCompare {
- struct bPathCompare *next, *prev;
- /** FILE_MAXDIR. */
- char path[768];
- char flag;
- char _pad0[7];
+ struct bPathCompare *next, *prev;
+ /** FILE_MAXDIR. */
+ char path[768];
+ char flag;
+ char _pad0[7];
} bPathCompare;
typedef struct bUserMenu {
- struct bUserMenu *next, *prev;
- char space_type;
- char _pad0[7];
- char context[64];
- /* bUserMenuItem */
- ListBase items;
+ struct bUserMenu *next, *prev;
+ char space_type;
+ char _pad0[7];
+ char context[64];
+ /* bUserMenuItem */
+ ListBase items;
} bUserMenu;
/* May be part of bUserMenu or other list. */
typedef struct bUserMenuItem {
- struct bUserMenuItem *next, *prev;
- char ui_name[64];
- char type;
- char _pad0[7];
+ struct bUserMenuItem *next, *prev;
+ char ui_name[64];
+ char type;
+ char _pad0[7];
} bUserMenuItem;
typedef struct bUserMenuItem_Op {
- bUserMenuItem item;
- char op_idname[64];
- struct IDProperty *prop;
- char opcontext;
- char _pad0[7];
+ bUserMenuItem item;
+ char op_idname[64];
+ struct IDProperty *prop;
+ char opcontext;
+ char _pad0[7];
} bUserMenuItem_Op;
typedef struct bUserMenuItem_Menu {
- bUserMenuItem item;
- char mt_idname[64];
+ bUserMenuItem item;
+ char mt_idname[64];
} bUserMenuItem_Menu;
typedef struct bUserMenuItem_Prop {
- bUserMenuItem item;
- char context_data_path[256];
- char prop_id[64];
- int prop_index;
- char _pad0[4];
+ bUserMenuItem item;
+ char context_data_path[256];
+ char prop_id[64];
+ int prop_index;
+ char _pad0[4];
} bUserMenuItem_Prop;
enum {
- USER_MENU_TYPE_SEP = 1,
- USER_MENU_TYPE_OPERATOR = 2,
- USER_MENU_TYPE_MENU = 3,
- USER_MENU_TYPE_PROP = 4,
+ USER_MENU_TYPE_SEP = 1,
+ USER_MENU_TYPE_OPERATOR = 2,
+ USER_MENU_TYPE_MENU = 3,
+ USER_MENU_TYPE_PROP = 4,
};
typedef struct SolidLight {
- int flag;
- float smooth;
- char _pad0[8];
- float col[4], spec[4], vec[4];
+ int flag;
+ float smooth;
+ char _pad0[8];
+ float col[4], spec[4], vec[4];
} SolidLight;
typedef struct WalkNavigation {
- /** Speed factor for look around. */
- float mouse_speed;
- float walk_speed;
- float walk_speed_factor;
- float view_height;
- float jump_height;
- /** Duration to use for teleporting. */
- float teleport_time;
- short flag;
- char _pad0[6];
+ /** Speed factor for look around. */
+ float mouse_speed;
+ float walk_speed;
+ float walk_speed_factor;
+ float view_height;
+ float jump_height;
+ /** Duration to use for teleporting. */
+ float teleport_time;
+ short flag;
+ char _pad0[6];
} WalkNavigation;
typedef struct UserDef {
- /* UserDef has separate do-version handling, and can be read from other files */
- int versionfile, subversionfile;
-
- /** #eUserPref_Flag. */
- int flag;
- /** #eDupli_ID_Flags. */
- int dupflag;
- int savetime;
- /** FILE_MAXDIR length. */
- char tempdir[768];
- char fontdir[768];
- /** FILE_MAX length. */
- char renderdir[1024];
- /* EXR cache path */
- /** 768 = FILE_MAXDIR. */
- char render_cachedir[768];
- char textudir[768];
- char pythondir[768];
- char sounddir[768];
- char i18ndir[768];
- /** 1024 = FILE_MAX. */
- char image_editor[1024];
- /** 1024 = FILE_MAX. */
- char anim_player[1024];
- int anim_player_preset;
-
- /** Minimum spacing between gridlines in View2D grids. */
- short v2d_min_gridsize;
- /** #eTimecodeStyles, style of timecode display. */
- short timecode_style;
-
- short versions;
- short dbl_click_time;
-
- char _pad0[2];
- short wheellinescroll;
- /** #eUserpref_UI_Flag. */
- int uiflag;
- /** #eUserpref_UI_Flag2. */
- char uiflag2;
- char gpu_flag;
- char _pad8[2];
- /* Experimental flag for app-templates to make changes to behavior
- * which are outside the scope of typical preferences. */
- short app_flag;
- short language;
- short userpref;
- char userpref_flag;
- char viewzoom;
-
- int mixbufsize;
- int audiodevice;
- int audiorate;
- int audioformat;
- int audiochannels;
-
- /** Setting for UI scale. */
- float ui_scale;
- /** Setting for UI line width. */
- int ui_line_width;
- /** Runtime, full DPI divided by pixelsize. */
- int dpi;
- /** Runtime, multiplier to scale UI elements based on DPI. */
- float dpi_fac;
- /** Runtime, line width and point size based on DPI. */
- float pixelsize;
- /** Deprecated, for forward compatibility. */
- int virtual_pixel;
-
- /** Console scrollback limit. */
- int scrollback;
- /** Node insert offset (aka auto-offset) margin, but might be useful for later stuff as well. */
- char node_margin;
- char _pad2[5];
- /** #eUserpref_Translation_Flags. */
- short transopts;
- short menuthreshold1, menuthreshold2;
-
- /* startup template */
- char app_template[64];
-
- struct ListBase themes;
- struct ListBase uifonts;
- struct ListBase uistyles;
- struct ListBase user_keymaps;
- /** #wmKeyConfigPref. */
- struct ListBase user_keyconfig_prefs;
- struct ListBase addons;
- struct ListBase autoexec_paths;
- /** #bUserMenu. */
- struct ListBase user_menus;
-
- char keyconfigstr[64];
-
- short undosteps;
- char _pad1[2];
- int undomemory;
- float gpu_viewport_quality;
- short gp_manhattendist, gp_euclideandist, gp_eraser;
- /** #eGP_UserdefSettings. */
- short gp_settings;
- char _pad13[4];
- struct SolidLight light_param[4];
- float light_ambient[3];
- char _pad3[4];
- short gizmo_flag, gizmo_size;
- short edit_studio_light;
- char _pad6[4];
- short textimeout, texcollectrate;
- char _pad14[2];
- int memcachelimit;
- int prefetchframes;
- /** Control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use. */
- float pad_rot_angle;
- char _pad12[2];
- short obcenter_dia;
- /** Rotating view icon size. */
- short rvisize;
- /** Rotating view icon brightness. */
- short rvibright;
- /** Maximum number of recently used files to remember . */
- short recent_files;
- /** Milliseconds to spend spinning the view. */
- short smooth_viewtx;
- short glreslimit;
- short curssize;
- /** #eColorPicker_Types. */
- short color_picker_type;
- /** Interpolation mode for newly added F-Curves. */
- char ipo_new;
- /** Handle types for newly added keyframes. */
- char keyhandles_new;
- char _pad11[3];
- /** #eZoomFrame_Mode. */
- char view_frame_type;
-
- /** Number of keyframes to zoom around current frame. */
- int view_frame_keyframes;
- /** Seconds to zoom around current frame. */
- float view_frame_seconds;
-
- char _pad7[6];
-
- /** Private, defaults to 20 for 72 DPI setting. */
- short widget_unit;
- short anisotropic_filter;
-
- /** Tablet API to use (Windows only). */
- short tablet_api;
-
- /** Raw tablet pressure that maps to 100%. */
- float pressure_threshold_max;
- /** Curve non-linearity parameter. */
- float pressure_softness;
-
- /** Overall sensitivity of 3D mouse. */
- float ndof_sensitivity;
- float ndof_orbit_sensitivity;
- /** Deadzone of 3D mouse. */
- float ndof_deadzone;
- /** #eNdof_Flag, flags for 3D mouse. */
- int ndof_flag;
-
- /** #eMultiSample_Type, amount of samples for OpenGL FSA, if zero no FSA. */
- short ogl_multisamples;
-
- /** eImageDrawMethod, Method to be used to draw the images
- * (AUTO, GLSL, Textures or DrawPixels) */
- short image_draw_method;
-
- float glalphaclip;
-
- /** #eAutokey_Mode, autokeying mode. */
- short autokey_mode;
- /** Flags for autokeying. */
- short autokey_flag;
-
- /** Options for text rendering. */
- short text_render;
- char _pad9[2];
-
- /** From texture.h. */
- struct ColorBand coba_weight;
-
- float sculpt_paint_overlay_col[3];
- /** Default color for newly created Grease Pencil layers. */
- float gpencil_new_layer_col[4];
-
- short tweak_threshold;
- char move_threshold;
- char navigation_mode;
-
- char font_path_ui[1024];
- char font_path_ui_mono[1024];
-
- int compute_device_type;
- int compute_device_id;
-
- /** Opacity of inactive F-Curves in F-Curve Editor. */
- float fcu_inactive_alpha;
-
- /**
- * If keeping a pie menu spawn button pressed after this time,
- * it turns into a drag/release pie menu.
- */
- short pie_tap_timeout;
- /**
- * Direction in the pie menu will always be calculated from the
- * initial position within this time limit.
- */
- short pie_initial_timeout;
- short pie_animation_timeout;
- short pie_menu_confirm;
- /** Pie menu radius. */
- short pie_menu_radius;
- /** Pie menu distance from center before a direction is set. */
- short pie_menu_threshold;
-
- struct WalkNavigation walk_navigation;
-
- short opensubdiv_compute_type;
- /** #eMultiSample_Type, amount of samples for Grease Pencil. */
- short gpencil_multisamples;
-
- char factor_display_type;
-
- char _pad5[3];
+ /* UserDef has separate do-version handling, and can be read from other files */
+ int versionfile, subversionfile;
+
+ /** #eUserPref_Flag. */
+ int flag;
+ /** #eDupli_ID_Flags. */
+ int dupflag;
+ int savetime;
+ /** FILE_MAXDIR length. */
+ char tempdir[768];
+ char fontdir[768];
+ /** FILE_MAX length. */
+ char renderdir[1024];
+ /* EXR cache path */
+ /** 768 = FILE_MAXDIR. */
+ char render_cachedir[768];
+ char textudir[768];
+ char pythondir[768];
+ char sounddir[768];
+ char i18ndir[768];
+ /** 1024 = FILE_MAX. */
+ char image_editor[1024];
+ /** 1024 = FILE_MAX. */
+ char anim_player[1024];
+ int anim_player_preset;
+
+ /** Minimum spacing between gridlines in View2D grids. */
+ short v2d_min_gridsize;
+ /** #eTimecodeStyles, style of timecode display. */
+ short timecode_style;
+
+ short versions;
+ short dbl_click_time;
+
+ char _pad0[2];
+ short wheellinescroll;
+ /** #eUserpref_UI_Flag. */
+ int uiflag;
+ /** #eUserpref_UI_Flag2. */
+ char uiflag2;
+ char gpu_flag;
+ char _pad8[2];
+ /* Experimental flag for app-templates to make changes to behavior
+ * which are outside the scope of typical preferences. */
+ short app_flag;
+ short language;
+ short userpref;
+ char userpref_flag;
+ char viewzoom;
+
+ int mixbufsize;
+ int audiodevice;
+ int audiorate;
+ int audioformat;
+ int audiochannels;
+
+ /** Setting for UI scale. */
+ float ui_scale;
+ /** Setting for UI line width. */
+ int ui_line_width;
+ /** Runtime, full DPI divided by pixelsize. */
+ int dpi;
+ /** Runtime, multiplier to scale UI elements based on DPI. */
+ float dpi_fac;
+ /** Runtime, line width and point size based on DPI. */
+ float pixelsize;
+ /** Deprecated, for forward compatibility. */
+ int virtual_pixel;
+
+ /** Console scrollback limit. */
+ int scrollback;
+ /** Node insert offset (aka auto-offset) margin, but might be useful for later stuff as well. */
+ char node_margin;
+ char _pad2[5];
+ /** #eUserpref_Translation_Flags. */
+ short transopts;
+ short menuthreshold1, menuthreshold2;
+
+ /* startup template */
+ char app_template[64];
+
+ struct ListBase themes;
+ struct ListBase uifonts;
+ struct ListBase uistyles;
+ struct ListBase user_keymaps;
+ /** #wmKeyConfigPref. */
+ struct ListBase user_keyconfig_prefs;
+ struct ListBase addons;
+ struct ListBase autoexec_paths;
+ /** #bUserMenu. */
+ struct ListBase user_menus;
+
+ char keyconfigstr[64];
+
+ short undosteps;
+ char _pad1[2];
+ int undomemory;
+ float gpu_viewport_quality;
+ short gp_manhattendist, gp_euclideandist, gp_eraser;
+ /** #eGP_UserdefSettings. */
+ short gp_settings;
+ char _pad13[4];
+ struct SolidLight light_param[4];
+ float light_ambient[3];
+ char _pad3[4];
+ short gizmo_flag, gizmo_size;
+ short edit_studio_light;
+ char _pad6[4];
+ short textimeout, texcollectrate;
+ char _pad14[2];
+ int memcachelimit;
+ int prefetchframes;
+ /** Control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use. */
+ float pad_rot_angle;
+ char _pad12[2];
+ short obcenter_dia;
+ /** Rotating view icon size. */
+ short rvisize;
+ /** Rotating view icon brightness. */
+ short rvibright;
+ /** Maximum number of recently used files to remember . */
+ short recent_files;
+ /** Milliseconds to spend spinning the view. */
+ short smooth_viewtx;
+ short glreslimit;
+ short curssize;
+ /** #eColorPicker_Types. */
+ short color_picker_type;
+ /** Interpolation mode for newly added F-Curves. */
+ char ipo_new;
+ /** Handle types for newly added keyframes. */
+ char keyhandles_new;
+ char _pad11[3];
+ /** #eZoomFrame_Mode. */
+ char view_frame_type;
+
+ /** Number of keyframes to zoom around current frame. */
+ int view_frame_keyframes;
+ /** Seconds to zoom around current frame. */
+ float view_frame_seconds;
+
+ char _pad7[6];
+
+ /** Private, defaults to 20 for 72 DPI setting. */
+ short widget_unit;
+ short anisotropic_filter;
+
+ /** Tablet API to use (Windows only). */
+ short tablet_api;
+
+ /** Raw tablet pressure that maps to 100%. */
+ float pressure_threshold_max;
+ /** Curve non-linearity parameter. */
+ float pressure_softness;
+
+ /** Overall sensitivity of 3D mouse. */
+ float ndof_sensitivity;
+ float ndof_orbit_sensitivity;
+ /** Deadzone of 3D mouse. */
+ float ndof_deadzone;
+ /** #eNdof_Flag, flags for 3D mouse. */
+ int ndof_flag;
+
+ /** #eMultiSample_Type, amount of samples for OpenGL FSA, if zero no FSA. */
+ short ogl_multisamples;
+
+ /** eImageDrawMethod, Method to be used to draw the images
+ * (AUTO, GLSL, Textures or DrawPixels) */
+ short image_draw_method;
+
+ float glalphaclip;
+
+ /** #eAutokey_Mode, autokeying mode. */
+ short autokey_mode;
+ /** Flags for autokeying. */
+ short autokey_flag;
+
+ /** Options for text rendering. */
+ short text_render;
+ char _pad9[2];
+
+ /** From texture.h. */
+ struct ColorBand coba_weight;
+
+ float sculpt_paint_overlay_col[3];
+ /** Default color for newly created Grease Pencil layers. */
+ float gpencil_new_layer_col[4];
+
+ short tweak_threshold;
+ char move_threshold;
+ char navigation_mode;
+
+ char font_path_ui[1024];
+ char font_path_ui_mono[1024];
+
+ int compute_device_type;
+ int compute_device_id;
+
+ /** Opacity of inactive F-Curves in F-Curve Editor. */
+ float fcu_inactive_alpha;
+
+ /**
+ * If keeping a pie menu spawn button pressed after this time,
+ * it turns into a drag/release pie menu.
+ */
+ short pie_tap_timeout;
+ /**
+ * Direction in the pie menu will always be calculated from the
+ * initial position within this time limit.
+ */
+ short pie_initial_timeout;
+ short pie_animation_timeout;
+ short pie_menu_confirm;
+ /** Pie menu radius. */
+ short pie_menu_radius;
+ /** Pie menu distance from center before a direction is set. */
+ short pie_menu_threshold;
+
+ struct WalkNavigation walk_navigation;
+
+ short opensubdiv_compute_type;
+ /** #eMultiSample_Type, amount of samples for Grease Pencil. */
+ short gpencil_multisamples;
+
+ char factor_display_type;
+
+ char _pad5[3];
} UserDef;
/* from blenkernel blender.c */
@@ -773,175 +775,177 @@ extern UserDef U;
/** #UserDef.userpref (UI active_section) */
typedef enum eUserPref_Section {
- USER_SECTION_INTERFACE = 0,
- USER_SECTION_EDITING = 1,
- USER_SECTION_SAVE_LOAD = 2,
- USER_SECTION_SYSTEM = 3,
- USER_SECTION_THEME = 4,
- USER_SECTION_INPUT = 5,
- USER_SECTION_ADDONS = 6,
- USER_SECTION_LIGHT = 7,
- USER_SECTION_KEYMAP = 8,
+ USER_SECTION_INTERFACE = 0,
+ USER_SECTION_EDITING = 1,
+ USER_SECTION_SAVE_LOAD = 2,
+ USER_SECTION_SYSTEM = 3,
+ USER_SECTION_THEME = 4,
+ USER_SECTION_INPUT = 5,
+ USER_SECTION_ADDONS = 6,
+ USER_SECTION_LIGHT = 7,
+ USER_SECTION_KEYMAP = 8,
#ifdef WITH_USERDEF_WORKSPACES
- USER_SECTION_WORKSPACE_CONFIG = 9,
- USER_SECTION_WORKSPACE_ADDONS = 10,
- USER_SECTION_WORKSPACE_KEYMAPS = 11,
+ USER_SECTION_WORKSPACE_CONFIG = 9,
+ USER_SECTION_WORKSPACE_ADDONS = 10,
+ USER_SECTION_WORKSPACE_KEYMAPS = 11,
#endif
- USER_SECTION_VIEWPORT = 12,
- USER_SECTION_ANIMATION = 13,
- USER_SECTION_NAVIGATION = 14,
- USER_SECTION_FILE_PATHS = 15,
+ USER_SECTION_VIEWPORT = 12,
+ USER_SECTION_ANIMATION = 13,
+ USER_SECTION_NAVIGATION = 14,
+ USER_SECTION_FILE_PATHS = 15,
} eUserPref_Section;
/* UserDef.userpref_flag (State of the user preferences UI). */
typedef enum eUserPref_SectionFlag {
- /* Hide/expand keymap preferences. */
- USER_SECTION_INPUT_HIDE_UI_KEYCONFIG = (1 << 0),
+ /* Hide/expand keymap preferences. */
+ USER_SECTION_INPUT_HIDE_UI_KEYCONFIG = (1 << 0),
} eUserPref_SectionFlag;
/** #UserDef.flag */
typedef enum eUserPref_Flag {
- USER_AUTOSAVE = (1 << 0),
- USER_FLAG_NUMINPUT_ADVANCED = (1 << 1),
- USER_FLAG_UNUSED_2 = (1 << 2), /* cleared */
- USER_FLAG_UNUSED_3 = (1 << 3), /* cleared */
- USER_FLAG_UNUSED_4 = (1 << 4), /* cleared */
- USER_TRACKBALL = (1 << 5),
- USER_FLAG_UNUSED_6 = (1 << 6), /* cleared */
- USER_FLAG_UNUSED_7 = (1 << 7), /* cleared */
- USER_MAT_ON_OB = (1 << 8),
- USER_FLAG_UNUSED_9 = (1 << 9), /* cleared */
- USER_DEVELOPER_UI = (1 << 10),
- USER_TOOLTIPS = (1 << 11),
- USER_TWOBUTTONMOUSE = (1 << 12),
- USER_NONUMPAD = (1 << 13),
- USER_FLAG_UNUSED_14 = (1 << 14), /* cleared */
- USER_FILECOMPRESS = (1 << 15),
- USER_SAVE_PREVIEWS = (1 << 16),
- USER_CUSTOM_RANGE = (1 << 17),
- USER_ADD_EDITMODE = (1 << 18),
- USER_ADD_VIEWALIGNED = (1 << 19),
- USER_RELPATHS = (1 << 20),
- USER_RELEASECONFIRM = (1 << 21),
- USER_SCRIPT_AUTOEXEC_DISABLE = (1 << 22),
- USER_FILENOUI = (1 << 23),
- USER_NONEGFRAMES = (1 << 24),
- USER_TXT_TABSTOSPACES_DISABLE = (1 << 25),
- USER_TOOLTIPS_PYTHON = (1 << 26),
+ USER_AUTOSAVE = (1 << 0),
+ USER_FLAG_NUMINPUT_ADVANCED = (1 << 1),
+ USER_FLAG_UNUSED_2 = (1 << 2), /* cleared */
+ USER_FLAG_UNUSED_3 = (1 << 3), /* cleared */
+ USER_FLAG_UNUSED_4 = (1 << 4), /* cleared */
+ USER_TRACKBALL = (1 << 5),
+ USER_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ USER_FLAG_UNUSED_7 = (1 << 7), /* cleared */
+ USER_MAT_ON_OB = (1 << 8),
+ USER_FLAG_UNUSED_9 = (1 << 9), /* cleared */
+ USER_DEVELOPER_UI = (1 << 10),
+ USER_TOOLTIPS = (1 << 11),
+ USER_TWOBUTTONMOUSE = (1 << 12),
+ USER_NONUMPAD = (1 << 13),
+ USER_FLAG_UNUSED_14 = (1 << 14), /* cleared */
+ USER_FILECOMPRESS = (1 << 15),
+ USER_SAVE_PREVIEWS = (1 << 16),
+ USER_CUSTOM_RANGE = (1 << 17),
+ USER_ADD_EDITMODE = (1 << 18),
+ USER_ADD_VIEWALIGNED = (1 << 19),
+ USER_RELPATHS = (1 << 20),
+ USER_RELEASECONFIRM = (1 << 21),
+ USER_SCRIPT_AUTOEXEC_DISABLE = (1 << 22),
+ USER_FILENOUI = (1 << 23),
+ USER_NONEGFRAMES = (1 << 24),
+ USER_TXT_TABSTOSPACES_DISABLE = (1 << 25),
+ USER_TOOLTIPS_PYTHON = (1 << 26),
} eUserPref_Flag;
/** #bPathCompare.flag */
typedef enum ePathCompare_Flag {
- USER_PATHCMP_GLOB = (1 << 0),
+ USER_PATHCMP_GLOB = (1 << 0),
} ePathCompare_Flag;
/* Helper macro for checking frame clamping */
-#define FRAMENUMBER_MIN_CLAMP(cfra) { \
- if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) \
- cfra = 0; \
- } (void)0
+#define FRAMENUMBER_MIN_CLAMP(cfra) \
+ { \
+ if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) \
+ cfra = 0; \
+ } \
+ (void)0
/** #UserDef.viewzoom */
typedef enum eViewZoom_Style {
- USER_ZOOM_CONT = 0,
- USER_ZOOM_SCALE = 1,
- USER_ZOOM_DOLLY = 2,
+ USER_ZOOM_CONT = 0,
+ USER_ZOOM_SCALE = 1,
+ USER_ZOOM_DOLLY = 2,
} eViewZoom_Style;
/** #UserDef.navigation_mode */
typedef enum eViewNavigation_Method {
- VIEW_NAVIGATION_WALK = 0,
- VIEW_NAVIGATION_FLY = 1,
+ VIEW_NAVIGATION_WALK = 0,
+ VIEW_NAVIGATION_FLY = 1,
} eViewNavigation_Method;
/** #UserDef.flag */
typedef enum eWalkNavigation_Flag {
- USER_WALK_GRAVITY = (1 << 0),
- USER_WALK_MOUSE_REVERSE = (1 << 1),
+ USER_WALK_GRAVITY = (1 << 0),
+ USER_WALK_MOUSE_REVERSE = (1 << 1),
} eWalkNavigation_Flag;
/** #UserDef.uiflag */
typedef enum eUserpref_UI_Flag {
- USER_UIFLAG_UNUSED_0 = (1 << 0), /* cleared */
- USER_UIFLAG_UNUSED_1 = (1 << 1), /* cleared */
- USER_WHEELZOOMDIR = (1 << 2),
- USER_FILTERFILEEXTS = (1 << 3),
- USER_DRAWVIEWINFO = (1 << 4),
- USER_PLAINMENUS = (1 << 5),
- USER_LOCK_CURSOR_ADJUST = (1 << 6),
- USER_HEADER_BOTTOM = (1 << 7),
- /** Otherwise use header alignment from the file. */
- USER_HEADER_FROM_PREF = (1 << 8),
- USER_MENUOPENAUTO = (1 << 9),
- USER_DEPTH_CURSOR = (1 << 10),
- USER_AUTOPERSP = (1 << 11),
- USER_UIFLAG_UNUSED_12 = (1 << 12), /* cleared */
- USER_GLOBALUNDO = (1 << 13),
- USER_ORBIT_SELECTION = (1 << 14),
- USER_DEPTH_NAVIGATE = (1 << 15),
- USER_HIDE_DOT = (1 << 16),
- USER_SHOW_GIZMO_AXIS = (1 << 17),
- USER_SHOW_VIEWPORTNAME = (1 << 18),
- USER_CAM_LOCK_NO_PARENT = (1 << 19),
- USER_ZOOM_TO_MOUSEPOS = (1 << 20),
- USER_SHOW_FPS = (1 << 21),
- USER_UIFLAG_UNUSED_22 = (1 << 22), /* cleared */
- USER_MENUFIXEDORDER = (1 << 23),
- USER_CONTINUOUS_MOUSE = (1 << 24),
- USER_ZOOM_INVERT = (1 << 25),
- USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */
- USER_SPLASH_DISABLE = (1 << 27),
- USER_HIDE_RECENT = (1 << 28),
- USER_SHOW_THUMBNAILS = (1 << 29),
- USER_SAVE_PROMPT = (1 << 30),
- USER_HIDE_SYSTEM_BOOKMARKS = (1u << 31),
+ USER_UIFLAG_UNUSED_0 = (1 << 0), /* cleared */
+ USER_UIFLAG_UNUSED_1 = (1 << 1), /* cleared */
+ USER_WHEELZOOMDIR = (1 << 2),
+ USER_FILTERFILEEXTS = (1 << 3),
+ USER_DRAWVIEWINFO = (1 << 4),
+ USER_PLAINMENUS = (1 << 5),
+ USER_LOCK_CURSOR_ADJUST = (1 << 6),
+ USER_HEADER_BOTTOM = (1 << 7),
+ /** Otherwise use header alignment from the file. */
+ USER_HEADER_FROM_PREF = (1 << 8),
+ USER_MENUOPENAUTO = (1 << 9),
+ USER_DEPTH_CURSOR = (1 << 10),
+ USER_AUTOPERSP = (1 << 11),
+ USER_UIFLAG_UNUSED_12 = (1 << 12), /* cleared */
+ USER_GLOBALUNDO = (1 << 13),
+ USER_ORBIT_SELECTION = (1 << 14),
+ USER_DEPTH_NAVIGATE = (1 << 15),
+ USER_HIDE_DOT = (1 << 16),
+ USER_SHOW_GIZMO_AXIS = (1 << 17),
+ USER_SHOW_VIEWPORTNAME = (1 << 18),
+ USER_CAM_LOCK_NO_PARENT = (1 << 19),
+ USER_ZOOM_TO_MOUSEPOS = (1 << 20),
+ USER_SHOW_FPS = (1 << 21),
+ USER_UIFLAG_UNUSED_22 = (1 << 22), /* cleared */
+ USER_MENUFIXEDORDER = (1 << 23),
+ USER_CONTINUOUS_MOUSE = (1 << 24),
+ USER_ZOOM_INVERT = (1 << 25),
+ USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */
+ USER_SPLASH_DISABLE = (1 << 27),
+ USER_HIDE_RECENT = (1 << 28),
+ USER_SHOW_THUMBNAILS = (1 << 29),
+ USER_SAVE_PROMPT = (1 << 30),
+ USER_HIDE_SYSTEM_BOOKMARKS = (1u << 31),
} eUserpref_UI_Flag;
/** #UserDef.uiflag2
*
* \note don't add new flags here, use 'uiflag' which has flags free. */
typedef enum eUserpref_UI_Flag2 {
- USER_UIFLAG2_UNUSED_0 = (1 << 0), /* cleared */
- USER_REGION_OVERLAP = (1 << 1),
- USER_TRACKPAD_NATURAL = (1 << 2),
- USER_UIFLAG2_UNUSED_3 = (1 << 3), /* dirty */
+ USER_UIFLAG2_UNUSED_0 = (1 << 0), /* cleared */
+ USER_REGION_OVERLAP = (1 << 1),
+ USER_TRACKPAD_NATURAL = (1 << 2),
+ USER_UIFLAG2_UNUSED_3 = (1 << 3), /* dirty */
} eUserpref_UI_Flag2;
typedef enum eUserpref_GPU_Flag {
- USER_GPU_FLAG_NO_DEPT_PICK = (1 << 0),
- USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE = (1 << 1),
+ USER_GPU_FLAG_NO_DEPT_PICK = (1 << 0),
+ USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE = (1 << 1),
} eUserpref_GPU_Flag;
/** #UserDef.tablet_api */
typedef enum eUserpref_TableAPI {
- USER_TABLET_AUTOMATIC = 0,
- USER_TABLET_NATIVE = 1,
- USER_TABLET_WINTAB = 2,
+ USER_TABLET_AUTOMATIC = 0,
+ USER_TABLET_NATIVE = 1,
+ USER_TABLET_WINTAB = 2,
} eUserpref_TabletAPI;
/** #UserDef.app_flag */
typedef enum eUserpref_APP_Flag {
- USER_APP_LOCK_UI_LAYOUT = (1 << 0),
+ USER_APP_LOCK_UI_LAYOUT = (1 << 0),
} eUserpref_APP_Flag;
/** Auto-Keying mode.
* #UserDef.autokey_mode */
typedef enum eAutokey_Mode {
- /* AUTOKEY_ON is a bitflag */
- AUTOKEY_ON = 1,
+ /* AUTOKEY_ON is a bitflag */
+ AUTOKEY_ON = 1,
- /** AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2)
- * to preserve setting, even when autokey turned off */
- AUTOKEY_MODE_NORMAL = 3,
- AUTOKEY_MODE_EDITKEYS = 5,
+ /** AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2)
+ * to preserve setting, even when autokey turned off */
+ AUTOKEY_MODE_NORMAL = 3,
+ AUTOKEY_MODE_EDITKEYS = 5,
} eAutokey_Mode;
/** Zoom to frame mode.
* #UserDef.view_frame_type */
typedef enum eZoomFrame_Mode {
- ZOOM_FRAME_MODE_KEEP_RANGE = 0,
- ZOOM_FRAME_MODE_SECONDS = 1,
- ZOOM_FRAME_MODE_KEYFRAMES = 2,
+ ZOOM_FRAME_MODE_KEEP_RANGE = 0,
+ ZOOM_FRAME_MODE_SECONDS = 1,
+ ZOOM_FRAME_MODE_KEYFRAMES = 2,
} eZoomFrame_Mode;
/** Auto-Keying flag
@@ -949,182 +953,182 @@ typedef enum eZoomFrame_Mode {
* \note #eAutokey_Flag is used with a macro, search for lines like IS_AUTOKEY_FLAG(INSERTAVAIL).
*/
typedef enum eAutokey_Flag {
- AUTOKEY_FLAG_INSERTAVAIL = (1 << 0),
- AUTOKEY_FLAG_INSERTNEEDED = (1 << 1),
- AUTOKEY_FLAG_AUTOMATKEY = (1 << 2),
- AUTOKEY_FLAG_XYZ2RGB = (1 << 3),
-
- /* toolsettings->autokey_flag */
- AUTOKEY_FLAG_ONLYKEYINGSET = (1 << 6),
- AUTOKEY_FLAG_NOWARNING = (1 << 7),
- AUTOKEY_FLAG_CYCLEAWARE = (1 << 8),
- ANIMRECORD_FLAG_WITHNLA = (1 << 10),
+ AUTOKEY_FLAG_INSERTAVAIL = (1 << 0),
+ AUTOKEY_FLAG_INSERTNEEDED = (1 << 1),
+ AUTOKEY_FLAG_AUTOMATKEY = (1 << 2),
+ AUTOKEY_FLAG_XYZ2RGB = (1 << 3),
+
+ /* toolsettings->autokey_flag */
+ AUTOKEY_FLAG_ONLYKEYINGSET = (1 << 6),
+ AUTOKEY_FLAG_NOWARNING = (1 << 7),
+ AUTOKEY_FLAG_CYCLEAWARE = (1 << 8),
+ ANIMRECORD_FLAG_WITHNLA = (1 << 10),
} eAutokey_Flag;
/** #UserDef.transopts */
typedef enum eUserpref_Translation_Flags {
- USER_TR_TOOLTIPS = (1 << 0),
- USER_TR_IFACE = (1 << 1),
- USER_TR_UNUSED_2 = (1 << 2), /* cleared */
- USER_TR_UNUSED_3 = (1 << 3), /* cleared */
- USER_TR_UNUSED_4 = (1 << 4), /* cleared */
- USER_DOTRANSLATE = (1 << 5),
- USER_TR_UNUSED_6 = (1 << 6), /* cleared */
- USER_TR_UNUSED_7 = (1 << 7), /* cleared */
- USER_TR_NEWDATANAME = (1 << 8),
+ USER_TR_TOOLTIPS = (1 << 0),
+ USER_TR_IFACE = (1 << 1),
+ USER_TR_UNUSED_2 = (1 << 2), /* cleared */
+ USER_TR_UNUSED_3 = (1 << 3), /* cleared */
+ USER_TR_UNUSED_4 = (1 << 4), /* cleared */
+ USER_DOTRANSLATE = (1 << 5),
+ USER_TR_UNUSED_6 = (1 << 6), /* cleared */
+ USER_TR_UNUSED_7 = (1 << 7), /* cleared */
+ USER_TR_NEWDATANAME = (1 << 8),
} eUserpref_Translation_Flags;
/** #UserDef.dupflag */
typedef 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_IPO = (1 << 6),
- USER_DUP_MAT = (1 << 7),
- USER_DUP_TEX = (1 << 8),
- USER_DUP_ARM = (1 << 9),
- USER_DUP_ACT = (1 << 10),
- USER_DUP_PSYS = (1 << 11),
+ 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_IPO = (1 << 6),
+ USER_DUP_MAT = (1 << 7),
+ USER_DUP_TEX = (1 << 8),
+ USER_DUP_ARM = (1 << 9),
+ USER_DUP_ACT = (1 << 10),
+ USER_DUP_PSYS = (1 << 11),
} eDupli_ID_Flags;
/** Max anti alias draw method
* #UserDef.gpu_viewport_antialias */
typedef enum eOpenGL_AntiAliasMethod {
- USER_AA_NONE = 0,
- USER_AA_FXAA = 1,
- USER_AA_TAA8 = 2,
+ USER_AA_NONE = 0,
+ USER_AA_FXAA = 1,
+ USER_AA_TAA8 = 2,
} eOpenGL_AntiAliasMethod;
/** Text draw options
* #UserDef.text_render */
typedef enum eText_Draw_Options {
- USER_TEXT_DISABLE_AA = (1 << 0),
+ USER_TEXT_DISABLE_AA = (1 << 0),
- USER_TEXT_HINTING_NONE = (1 << 1),
- USER_TEXT_HINTING_SLIGHT = (1 << 2),
- USER_TEXT_HINTING_FULL = (1 << 3),
+ USER_TEXT_HINTING_NONE = (1 << 1),
+ USER_TEXT_HINTING_SLIGHT = (1 << 2),
+ USER_TEXT_HINTING_FULL = (1 << 3),
} eText_Draw_Options;
/** Grease Pencil Settings.
* #UserDef.gp_settings */
typedef enum eGP_UserdefSettings {
- GP_PAINT_UNUSED_0 = (1 << 0),
- GP_PAINT_DOSIMPLIFY = (1 << 1),
+ GP_PAINT_UNUSED_0 = (1 << 0),
+ GP_PAINT_DOSIMPLIFY = (1 << 1),
} eGP_UserdefSettings;
enum {
- USER_GIZMO_DRAW = (1 << 0),
+ USER_GIZMO_DRAW = (1 << 0),
};
/** Color Picker Types.
* #UserDef.color_picker_type */
typedef enum eColorPicker_Types {
- USER_CP_CIRCLE_HSV = 0,
- USER_CP_SQUARE_SV = 1,
- USER_CP_SQUARE_HS = 2,
- USER_CP_SQUARE_HV = 3,
- USER_CP_CIRCLE_HSL = 4,
+ USER_CP_CIRCLE_HSV = 0,
+ USER_CP_SQUARE_SV = 1,
+ USER_CP_SQUARE_HS = 2,
+ USER_CP_SQUARE_HV = 3,
+ USER_CP_CIRCLE_HSL = 4,
} eColorPicker_Types;
/** Timecode display styles
* #UserDef.timecode_style */
typedef enum eTimecodeStyles {
- /* as little info as is necessary to show relevant info
- * with '+' to denote the frames
- * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS
- */
- USER_TIMECODE_MINIMAL = 0,
+ /* as little info as is necessary to show relevant info
+ * with '+' to denote the frames
+ * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS
+ */
+ USER_TIMECODE_MINIMAL = 0,
- /* reduced SMPTE - (HH:)MM:SS:FF */
- USER_TIMECODE_SMPTE_MSF = 1,
+ /* reduced SMPTE - (HH:)MM:SS:FF */
+ USER_TIMECODE_SMPTE_MSF = 1,
- /* full SMPTE - HH:MM:SS:FF */
- USER_TIMECODE_SMPTE_FULL = 2,
+ /* full SMPTE - HH:MM:SS:FF */
+ USER_TIMECODE_SMPTE_FULL = 2,
- /* milliseconds for sub-frames - HH:MM:SS.sss */
- USER_TIMECODE_MILLISECONDS = 3,
+ /* milliseconds for sub-frames - HH:MM:SS.sss */
+ USER_TIMECODE_MILLISECONDS = 3,
- /* seconds only */
- USER_TIMECODE_SECONDS_ONLY = 4,
+ /* seconds only */
+ USER_TIMECODE_SECONDS_ONLY = 4,
- /* Private (not exposed as generic choices) options. */
- /* milliseconds for sub-frames , SubRip format- HH:MM:SS,sss */
- USER_TIMECODE_SUBRIP = 100,
+ /* Private (not exposed as generic choices) options. */
+ /* milliseconds for sub-frames , SubRip format- HH:MM:SS,sss */
+ USER_TIMECODE_SUBRIP = 100,
} eTimecodeStyles;
/** #UserDef.ndof_flag (3D mouse options) */
typedef enum eNdof_Flag {
- NDOF_SHOW_GUIDE = (1 << 0),
- NDOF_FLY_HELICOPTER = (1 << 1),
- NDOF_LOCK_HORIZON = (1 << 2),
-
- /* the following might not need to be saved between sessions,
- * but they do need to live somewhere accessible... */
- NDOF_SHOULD_PAN = (1 << 3),
- NDOF_SHOULD_ZOOM = (1 << 4),
- NDOF_SHOULD_ROTATE = (1 << 5),
-
- /* orbit navigation modes */
-
- /* exposed as Orbit|Explore in the UI */
- NDOF_MODE_ORBIT = (1 << 6),
-
- /* actually... users probably don't care about what the mode
- * is called, just that it feels right */
- /* zoom is up/down if this flag is set (otherwise forward/backward) */
- NDOF_PAN_YZ_SWAP_AXIS = (1 << 7),
- NDOF_ZOOM_INVERT = (1 << 8),
- NDOF_ROTX_INVERT_AXIS = (1 << 9),
- NDOF_ROTY_INVERT_AXIS = (1 << 10),
- NDOF_ROTZ_INVERT_AXIS = (1 << 11),
- NDOF_PANX_INVERT_AXIS = (1 << 12),
- NDOF_PANY_INVERT_AXIS = (1 << 13),
- NDOF_PANZ_INVERT_AXIS = (1 << 14),
- NDOF_TURNTABLE = (1 << 15),
+ NDOF_SHOW_GUIDE = (1 << 0),
+ NDOF_FLY_HELICOPTER = (1 << 1),
+ NDOF_LOCK_HORIZON = (1 << 2),
+
+ /* the following might not need to be saved between sessions,
+ * but they do need to live somewhere accessible... */
+ NDOF_SHOULD_PAN = (1 << 3),
+ NDOF_SHOULD_ZOOM = (1 << 4),
+ NDOF_SHOULD_ROTATE = (1 << 5),
+
+ /* orbit navigation modes */
+
+ /* exposed as Orbit|Explore in the UI */
+ NDOF_MODE_ORBIT = (1 << 6),
+
+ /* actually... users probably don't care about what the mode
+ * is called, just that it feels right */
+ /* zoom is up/down if this flag is set (otherwise forward/backward) */
+ NDOF_PAN_YZ_SWAP_AXIS = (1 << 7),
+ NDOF_ZOOM_INVERT = (1 << 8),
+ NDOF_ROTX_INVERT_AXIS = (1 << 9),
+ NDOF_ROTY_INVERT_AXIS = (1 << 10),
+ NDOF_ROTZ_INVERT_AXIS = (1 << 11),
+ NDOF_PANX_INVERT_AXIS = (1 << 12),
+ NDOF_PANY_INVERT_AXIS = (1 << 13),
+ NDOF_PANZ_INVERT_AXIS = (1 << 14),
+ NDOF_TURNTABLE = (1 << 15),
} eNdof_Flag;
#define NDOF_PIXELS_PER_SECOND 600.0f
/** UserDef.ogl_multisamples and gpencil_multisamples */
typedef enum eMultiSample_Type {
- USER_MULTISAMPLE_NONE = 0,
- USER_MULTISAMPLE_2 = 2,
- USER_MULTISAMPLE_4 = 4,
- USER_MULTISAMPLE_8 = 8,
- USER_MULTISAMPLE_16 = 16,
+ USER_MULTISAMPLE_NONE = 0,
+ USER_MULTISAMPLE_2 = 2,
+ USER_MULTISAMPLE_4 = 4,
+ USER_MULTISAMPLE_8 = 8,
+ USER_MULTISAMPLE_16 = 16,
} eMultiSample_Type;
/** #UserDef.image_draw_method */
typedef enum eImageDrawMethod {
- /* IMAGE_DRAW_METHOD_AUTO = 0, */ /* Currently unused */
- IMAGE_DRAW_METHOD_GLSL = 1,
- IMAGE_DRAW_METHOD_2DTEXTURE = 2,
- IMAGE_DRAW_METHOD_DRAWPIXELS = 3,
+ /* IMAGE_DRAW_METHOD_AUTO = 0, */ /* Currently unused */
+ IMAGE_DRAW_METHOD_GLSL = 1,
+ IMAGE_DRAW_METHOD_2DTEXTURE = 2,
+ IMAGE_DRAW_METHOD_DRAWPIXELS = 3,
} eImageDrawMethod;
/** #UserDef.virtual_pixel */
typedef enum eUserpref_VirtualPixel {
- VIRTUAL_PIXEL_NATIVE = 0,
- VIRTUAL_PIXEL_DOUBLE = 1,
+ VIRTUAL_PIXEL_NATIVE = 0,
+ VIRTUAL_PIXEL_DOUBLE = 1,
} eUserpref_VirtualPixel;
typedef enum eOpensubdiv_Computee_Type {
- USER_OPENSUBDIV_COMPUTE_NONE = 0,
- USER_OPENSUBDIV_COMPUTE_CPU = 1,
- USER_OPENSUBDIV_COMPUTE_OPENMP = 2,
- USER_OPENSUBDIV_COMPUTE_OPENCL = 3,
- USER_OPENSUBDIV_COMPUTE_CUDA = 4,
- USER_OPENSUBDIV_COMPUTE_GLSL_TRANSFORM_FEEDBACK = 5,
- USER_OPENSUBDIV_COMPUTE_GLSL_COMPUTE = 6,
+ USER_OPENSUBDIV_COMPUTE_NONE = 0,
+ USER_OPENSUBDIV_COMPUTE_CPU = 1,
+ USER_OPENSUBDIV_COMPUTE_OPENMP = 2,
+ USER_OPENSUBDIV_COMPUTE_OPENCL = 3,
+ USER_OPENSUBDIV_COMPUTE_CUDA = 4,
+ USER_OPENSUBDIV_COMPUTE_GLSL_TRANSFORM_FEEDBACK = 5,
+ USER_OPENSUBDIV_COMPUTE_GLSL_COMPUTE = 6,
} eOpensubdiv_Computee_Type;
/** #UserDef.factor_display_type */
typedef enum eUserpref_FactorDisplay {
- USER_FACTOR_AS_FACTOR = 0,
- USER_FACTOR_AS_PERCENTAGE = 1,
+ USER_FACTOR_AS_FACTOR = 0,
+ USER_FACTOR_AS_PERCENTAGE = 1,
} eUserpref_FactorDisplay;
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_vec_types.h b/source/blender/makesdna/DNA_vec_types.h
index a8aeecf53dc..06e6d881d0e 100644
--- a/source/blender/makesdna/DNA_vec_types.h
+++ b/source/blender/makesdna/DNA_vec_types.h
@@ -28,59 +28,59 @@
/** vector of two shorts. */
typedef struct vec2s {
- short x, y;
+ short x, y;
} vec2s;
/** vector of two floats. */
typedef struct vec2f {
- float x, y;
+ float x, y;
} vec2f;
/* not used at the moment */
/*
typedef struct vec2i {
- int x, y;
+ int x, y;
} vec2i;
typedef struct vec2d {
- double x, y;
+ double x, y;
} vec2d;
typedef struct vec3i {
- int x, y, z;
+ int x, y, z;
} vec3i;
*/
typedef struct vec3f {
- float x, y, z;
+ float x, y, z;
} vec3f;
/*
typedef struct vec3d {
- double x, y, z;
+ double x, y, z;
} vec3d;
typedef struct vec4i {
- int x, y, z, w;
+ int x, y, z, w;
} vec4i;
typedef struct vec4f {
- float x, y, z, w;
+ float x, y, z, w;
} vec4f;
typedef struct vec4d {
- double x, y, z, w;
+ double x, y, z, w;
} vec4d;
*/
/** integer rectangle. */
typedef struct rcti {
- int xmin, xmax;
- int ymin, ymax;
+ int xmin, xmax;
+ int ymin, ymax;
} rcti;
/** float rectangle. */
typedef struct rctf {
- float xmin, xmax;
- float ymin, ymax;
+ float xmin, xmax;
+ float ymin, ymax;
} rctf;
#endif
diff --git a/source/blender/makesdna/DNA_vfont_types.h b/source/blender/makesdna/DNA_vfont_types.h
index 225249a49b4..295552635fe 100644
--- a/source/blender/makesdna/DNA_vfont_types.h
+++ b/source/blender/makesdna/DNA_vfont_types.h
@@ -33,32 +33,32 @@ struct PackedFile;
struct VFontData;
typedef struct VFont {
- ID id;
+ ID id;
- /** 1024 = FILE_MAX. */
- char name[1024];
+ /** 1024 = FILE_MAX. */
+ char name[1024];
- struct VFontData *data;
- struct PackedFile *packedfile;
+ struct VFontData *data;
+ struct PackedFile *packedfile;
- /* runtime only, holds memory for freetype to read from
- * TODO, replace this with blf_font_new() style loading */
- struct PackedFile *temp_pf;
+ /* runtime only, holds memory for freetype to read from
+ * TODO, replace this with blf_font_new() style loading */
+ struct PackedFile *temp_pf;
} VFont;
/* *************** FONT ****************** */
-#define FO_EDIT 0
-#define FO_CURS 1
-#define FO_CURSUP 2
-#define FO_CURSDOWN 3
-#define FO_DUPLI 4
-#define FO_PAGEUP 8
-#define FO_PAGEDOWN 9
-#define FO_SELCHANGE 10
+#define FO_EDIT 0
+#define FO_CURS 1
+#define FO_CURSUP 2
+#define FO_CURSDOWN 3
+#define FO_DUPLI 4
+#define FO_PAGEUP 8
+#define FO_PAGEDOWN 9
+#define FO_SELCHANGE 10
/* BKE_vfont_to_curve will move the cursor in these cases */
#define FO_CURS_IS_MOTION(mode) (ELEM(mode, FO_CURSUP, FO_CURSDOWN, FO_PAGEUP, FO_PAGEDOWN))
#define FO_BUILTIN_NAME "<builtin>"
-#endif /* __DNA_VFONT_TYPES_H__ */
+#endif /* __DNA_VFONT_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index d761cb7ff91..0f25b47cb0b 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -30,156 +30,156 @@
/* View 2D data - stored per region */
typedef struct View2D {
- /** Tot - area that data can be drawn in; cur - region of tot that is visible in viewport. */
- rctf tot, cur;
- /** Vert - vertical scrollbar region; hor - horizontal scrollbar region. */
- rcti vert, hor;
- /** Mask - region (in screenspace) within which 'cur' can be viewed. */
- 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, maxzoom;
-
- /** Scroll - scrollbars to display (bitflag). */
- short scroll;
- /** Scroll_ui - temp settings used for UI drawing of scrollers. */
- short scroll_ui;
-
- /** Keeptot - 'cur' rect cannot move outside the 'tot' rect?. */
- short keeptot;
- /** Keepzoom - axes that zooming cannot occur on, and also clamp within zoom-limits. */
- short keepzoom;
- /** Keepofs - axes that translation is not allowed to occur on. */
- short keepofs;
-
- /** Settings. */
- short flag;
- /** Alignment of content in totrect. */
- short align;
-
- /** Storage of current winx/winy values, set in UI_view2d_size_update. */
- short winx, winy;
- /** Storage of previous winx/winy values encountered by UI_view2d_curRect_validate(),
- * for keepaspect. */
- short oldwinx, oldwiny;
-
- /** Pivot point for transforms (rotate and scale). */
- short around;
-
- /** Different offset per tab, for buttons. */
- float *tab_offset;
- /** Number of tabs stored. */
- int tab_num;
- /** Current tab. */
- int tab_cur;
-
- /* Usually set externally (as in, not in view2d files). */
- /** Alpha of vertical and horizontal scrollbars (range is [0, 255]). */
- char alpha_vert, alpha_hor;
- char _pad[6];
-
- /* animated smooth view */
- struct SmoothView2DStore *sms;
- struct wmTimer *smooth_timer;
+ /** Tot - area that data can be drawn in; cur - region of tot that is visible in viewport. */
+ rctf tot, cur;
+ /** Vert - vertical scrollbar region; hor - horizontal scrollbar region. */
+ rcti vert, hor;
+ /** Mask - region (in screenspace) within which 'cur' can be viewed. */
+ 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, maxzoom;
+
+ /** Scroll - scrollbars to display (bitflag). */
+ short scroll;
+ /** Scroll_ui - temp settings used for UI drawing of scrollers. */
+ short scroll_ui;
+
+ /** Keeptot - 'cur' rect cannot move outside the 'tot' rect?. */
+ short keeptot;
+ /** Keepzoom - axes that zooming cannot occur on, and also clamp within zoom-limits. */
+ short keepzoom;
+ /** Keepofs - axes that translation is not allowed to occur on. */
+ short keepofs;
+
+ /** Settings. */
+ short flag;
+ /** Alignment of content in totrect. */
+ short align;
+
+ /** Storage of current winx/winy values, set in UI_view2d_size_update. */
+ short winx, winy;
+ /** Storage of previous winx/winy values encountered by UI_view2d_curRect_validate(),
+ * for keepaspect. */
+ short oldwinx, oldwiny;
+
+ /** Pivot point for transforms (rotate and scale). */
+ short around;
+
+ /** Different offset per tab, for buttons. */
+ float *tab_offset;
+ /** Number of tabs stored. */
+ int tab_num;
+ /** Current tab. */
+ int tab_cur;
+
+ /* Usually set externally (as in, not in view2d files). */
+ /** Alpha of vertical and horizontal scrollbars (range is [0, 255]). */
+ char alpha_vert, alpha_hor;
+ char _pad[6];
+
+ /* animated smooth view */
+ struct SmoothView2DStore *sms;
+ struct wmTimer *smooth_timer;
} View2D;
/* ---------------------------------- */
/* view zooming restrictions, per axis (v2d->keepzoom) */
enum {
- /* 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),
+ /* 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),
};
/* view panning restrictions, per axis (v2d->keepofs) */
enum {
- /* 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),
+ /* 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),
};
/* view extent restrictions (v2d->keeptot) */
enum {
- /** '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,
+ /** '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 (v2d->flag) */
enum {
- /* global view2d horizontal locking (for showing same time interval) */
- /* TODO: this flag may be set in old files but is not accessible currently,
- * should be exposed from RNA - Campbell */
- 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),
- /* view settings need to be set still... */
- V2D_IS_INITIALISED = (1 << 10),
+ /* global view2d horizontal locking (for showing same time interval) */
+ /* TODO: this flag may be set in old files but is not accessible currently,
+ * should be exposed from RNA - Campbell */
+ 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),
+ /* view settings need to be set still... */
+ V2D_IS_INITIALISED = (1 << 10),
};
/* scroller flags for View2D (v2d->scroll) */
enum {
- /* left scrollbar */
- V2D_SCROLL_LEFT = (1 << 0),
- V2D_SCROLL_RIGHT = (1 << 1),
- V2D_SCROLL_VERTICAL = (V2D_SCROLL_LEFT | V2D_SCROLL_RIGHT),
- /* horizontal scrollbar */
- V2D_SCROLL_TOP = (1 << 2),
- V2D_SCROLL_BOTTOM = (1 << 3),
- /* UNUSED = (1 << 4), */
- V2D_SCROLL_HORIZONTAL = (V2D_SCROLL_TOP | V2D_SCROLL_BOTTOM),
- /* scale markings - vertical */
- V2D_SCROLL_SCALE_VERTICAL = (1 << 5),
- /* scale markings - horizontal */
- V2D_SCROLL_SCALE_HORIZONTAL = (1 << 6),
- /* induce hiding of scrollbars - set by region drawing in response to size of region */
- V2D_SCROLL_VERTICAL_HIDE = (1 << 7),
- V2D_SCROLL_HORIZONTAL_HIDE = (1 << 8),
- /* scrollbar extends beyond its available window -
- * set when calculating scrollbars for drawing */
- V2D_SCROLL_VERTICAL_FULLR = (1 << 9),
- V2D_SCROLL_HORIZONTAL_FULLR = (1 << 10),
+ /* left scrollbar */
+ V2D_SCROLL_LEFT = (1 << 0),
+ V2D_SCROLL_RIGHT = (1 << 1),
+ V2D_SCROLL_VERTICAL = (V2D_SCROLL_LEFT | V2D_SCROLL_RIGHT),
+ /* horizontal scrollbar */
+ V2D_SCROLL_TOP = (1 << 2),
+ V2D_SCROLL_BOTTOM = (1 << 3),
+ /* UNUSED = (1 << 4), */
+ V2D_SCROLL_HORIZONTAL = (V2D_SCROLL_TOP | V2D_SCROLL_BOTTOM),
+ /* scale markings - vertical */
+ V2D_SCROLL_SCALE_VERTICAL = (1 << 5),
+ /* scale markings - horizontal */
+ V2D_SCROLL_SCALE_HORIZONTAL = (1 << 6),
+ /* induce hiding of scrollbars - set by region drawing in response to size of region */
+ V2D_SCROLL_VERTICAL_HIDE = (1 << 7),
+ V2D_SCROLL_HORIZONTAL_HIDE = (1 << 8),
+ /* scrollbar extends beyond its available window -
+ * set when calculating scrollbars for drawing */
+ V2D_SCROLL_VERTICAL_FULLR = (1 << 9),
+ V2D_SCROLL_HORIZONTAL_FULLR = (1 << 10),
};
/* scroll_ui, activate flag for drawing */
enum {
- V2D_SCROLL_H_ACTIVE = (1 << 0),
- V2D_SCROLL_V_ACTIVE = (1 << 1),
+ V2D_SCROLL_H_ACTIVE = (1 << 0),
+ V2D_SCROLL_V_ACTIVE = (1 << 1),
};
/* alignment flags for totrect, flags use 'shading-out' convention (v2d->align) */
enum {
- /* 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),
+ /* 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),
};
#endif
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 53519de42a4..3e409f36724 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -47,547 +47,543 @@ struct wmTimer;
typedef struct 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 texcoords. */
- 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 editmode without first going into worldspace. */
- float clip_local[6][4];
- struct BoundBox *clipbb;
-
- /** Allocated backup of its self while in localview. */
- struct RegionView3D *localvd;
- struct RenderEngine *render_engine;
- struct ViewDepths *depths;
-
- /** Animated smooth view. */
- struct SmoothView3DStore *sms;
- struct wmTimer *smooth_timer;
-
-
- /** 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];
-
- float gridview DNA_DEPRECATED;
-
- /** View rotation, must be kept normalized. */
- float viewquat[4];
- /** Distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs'. */
- float dist;
- /** Camera view offsets, 1.0 = viewplane moves entire width/height. */
- float camdx, camdy;
- /** Runtime only. */
- float pixsize;
- /**
- * View center & orbit pivot, negative of worldspace location,
- * also matches -viewinv[3][0:3] in ortho mode.
- */
- float ofs[3];
- /** Viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac. */
- float camzoom;
- /**
- * Check if persp/ortho view, since 'persp' cant be used for this since
- * it can have cameras assigned as well. (only set in #view3d_winmatrix_set)
- */
- char is_persp;
- char persp;
- char view;
- char viewlock;
- /** Options for quadview (store while out of quad view). */
- char viewlock_quad;
- char _pad[3];
- /** 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;
- short rflag;
-
-
- /** Last view (use when switching out of camera view). */
- float lviewquat[4];
- /** Lpersp can never be set to 'RV3D_CAMOB'. */
- short lpersp, lview;
-
- /** Active rotation from NDOF or elsewhere. */
- float rot_angle;
- float rot_axis[3];
+ /** 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 texcoords. */
+ 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 editmode without first going into worldspace. */
+ float clip_local[6][4];
+ struct BoundBox *clipbb;
+
+ /** Allocated backup of its self while in localview. */
+ struct RegionView3D *localvd;
+ struct RenderEngine *render_engine;
+ struct ViewDepths *depths;
+
+ /** Animated smooth view. */
+ struct SmoothView3DStore *sms;
+ struct wmTimer *smooth_timer;
+
+ /** 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];
+
+ float gridview DNA_DEPRECATED;
+
+ /** View rotation, must be kept normalized. */
+ float viewquat[4];
+ /** Distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs'. */
+ float dist;
+ /** Camera view offsets, 1.0 = viewplane moves entire width/height. */
+ float camdx, camdy;
+ /** Runtime only. */
+ float pixsize;
+ /**
+ * View center & orbit pivot, negative of worldspace location,
+ * also matches -viewinv[3][0:3] in ortho mode.
+ */
+ float ofs[3];
+ /** Viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac. */
+ float camzoom;
+ /**
+ * Check if persp/ortho view, since 'persp' cant be used for this since
+ * it can have cameras assigned as well. (only set in #view3d_winmatrix_set)
+ */
+ char is_persp;
+ char persp;
+ char view;
+ char viewlock;
+ /** Options for quadview (store while out of quad view). */
+ char viewlock_quad;
+ char _pad[3];
+ /** 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;
+ short rflag;
+
+ /** Last view (use when switching out of camera view). */
+ float lviewquat[4];
+ /** Lpersp can never be set to 'RV3D_CAMOB'. */
+ short lpersp, lview;
+
+ /** Active rotation from NDOF or elsewhere. */
+ float rot_angle;
+ float rot_axis[3];
} RegionView3D;
typedef struct View3DCursor {
- float location[3];
+ float location[3];
- float rotation_quaternion[4];
- float rotation_euler[3];
- float rotation_axis[3], rotation_angle;
- short rotation_mode;
+ float rotation_quaternion[4];
+ float rotation_euler[3];
+ float rotation_axis[3], rotation_angle;
+ short rotation_mode;
- char _pad[6];
+ char _pad[6];
} View3DCursor;
/** 3D Viewport Shading settings. */
typedef struct View3DShading {
- /** Shading type (VIEW3D_SHADE_SOLID, ..). */
- char type;
- /** Runtime, for toggle between rendered viewport. */
- char prev_type;
- char prev_type_wire;
+ /** Shading type (VIEW3D_SHADE_SOLID, ..). */
+ char type;
+ /** Runtime, for toggle between rendered viewport. */
+ char prev_type;
+ char prev_type_wire;
- char color_type;
- short flag;
+ char color_type;
+ short flag;
- char light;
- char background_type;
- char cavity_type;
- char wire_color_type;
- char _pad[6];
+ char light;
+ char background_type;
+ char cavity_type;
+ char wire_color_type;
+ char _pad[6];
- /** FILE_MAXFILE. */
- char studio_light[256];
- /** FILE_MAXFILE. */
- char lookdev_light[256];
- /** FILE_MAXFILE. */
- char matcap[256];
+ /** FILE_MAXFILE. */
+ char studio_light[256];
+ /** FILE_MAXFILE. */
+ char lookdev_light[256];
+ /** FILE_MAXFILE. */
+ char matcap[256];
- float shadow_intensity;
- float single_color[3];
+ float shadow_intensity;
+ float single_color[3];
- float studiolight_rot_z;
- float studiolight_background;
+ float studiolight_rot_z;
+ float studiolight_background;
- float object_outline_color[3];
- float xray_alpha;
- float xray_alpha_wire;
+ float object_outline_color[3];
+ float xray_alpha;
+ float xray_alpha_wire;
- float cavity_valley_factor;
- float cavity_ridge_factor;
+ float cavity_valley_factor;
+ float cavity_ridge_factor;
- float background_color[3];
+ float background_color[3];
- float curvature_ridge_factor;
- float curvature_valley_factor;
+ float curvature_ridge_factor;
+ float curvature_valley_factor;
} View3DShading;
/** 3D Viewport Overlay settings. */
typedef struct View3DOverlay {
- int flag;
+ int flag;
- /** Edit mode settings. */
- int edit_flag;
- float normals_length;
- float backwire_opacity;
+ /** Edit mode settings. */
+ int edit_flag;
+ float normals_length;
+ float backwire_opacity;
- /** Paint mode settings. */
- int paint_flag;
+ /** Paint mode settings. */
+ int paint_flag;
- /** Weight paint mode settings. */
- int wpaint_flag;
- char _pad2[4];
+ /** Weight paint mode settings. */
+ int wpaint_flag;
+ char _pad2[4];
- /** Alpha for texture, weight, vertex paint overlay. */
- float texture_paint_mode_opacity;
- float vertex_paint_mode_opacity;
- float weight_paint_mode_opacity;
+ /** Alpha for texture, weight, vertex paint overlay. */
+ float texture_paint_mode_opacity;
+ float vertex_paint_mode_opacity;
+ float weight_paint_mode_opacity;
- /** Armature edit/pose mode settings. */
- int _pad3;
- float xray_alpha_bone;
+ /** Armature edit/pose mode settings. */
+ int _pad3;
+ float xray_alpha_bone;
- /** Other settings. */
- float wireframe_threshold;
+ /** Other settings. */
+ float wireframe_threshold;
- /** Grease pencil settings. */
- float gpencil_paper_opacity;
- float gpencil_grid_opacity;
- float gpencil_fade_layer;
+ /** Grease pencil settings. */
+ float gpencil_paper_opacity;
+ float gpencil_grid_opacity;
+ float gpencil_fade_layer;
} View3DOverlay;
typedef struct View3D_Runtime {
- /** Nkey panel stores stuff here. */
- void *properties_storage;
+ /** Nkey panel stores stuff here. */
+ void *properties_storage;
} View3D_Runtime;
/** 3D ViewPort Struct. */
typedef struct View3D {
- struct SpaceLink *next, *prev;
- /** Storage of regions for inactive spaces. */
- ListBase regionbase;
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
+ struct SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
- float viewquat[4] DNA_DEPRECATED;
- float dist DNA_DEPRECATED;
+ float viewquat[4] DNA_DEPRECATED;
+ float dist DNA_DEPRECATED;
- /** Size of bundles in reconstructed data. */
- float bundle_size;
- /** Display style for bundle. */
- char bundle_drawtype;
+ /** Size of bundles in reconstructed data. */
+ float bundle_size;
+ /** Display style for bundle. */
+ char bundle_drawtype;
- char drawtype DNA_DEPRECATED;
+ char drawtype DNA_DEPRECATED;
- char _pad3[1];
+ char _pad3[1];
- /** Multiview current eye - for internal use. */
- char multiview_eye;
+ /** Multiview current eye - for internal use. */
+ char multiview_eye;
- int object_type_exclude_viewport;
- int object_type_exclude_select;
+ int object_type_exclude_viewport;
+ int object_type_exclude_select;
- short persp DNA_DEPRECATED;
- short view DNA_DEPRECATED;
+ short persp DNA_DEPRECATED;
+ short view DNA_DEPRECATED;
- struct Object *camera, *ob_centre;
- rctf render_border;
+ struct Object *camera, *ob_centre;
+ rctf render_border;
- /** Allocated backup of its self while in localview. */
- struct View3D *localvd;
+ /** Allocated backup of its self while in localview. */
+ struct View3D *localvd;
- /** Optional string for armature bone to define center, MAXBONENAME. */
- char ob_centre_bone[64];
+ /** Optional string for armature bone to define center, MAXBONENAME. */
+ char ob_centre_bone[64];
- unsigned short local_view_uuid;
- char _pad6[2];
- int layact DNA_DEPRECATED;
+ unsigned short local_view_uuid;
+ char _pad6[2];
+ int layact DNA_DEPRECATED;
- /** Optional bool for 3d cursor to define center. */
- short ob_centre_cursor;
- short scenelock;
- short gp_flag;
- short flag;
- int flag2;
+ /** Optional bool for 3d cursor to define center. */
+ short ob_centre_cursor;
+ short scenelock;
+ short gp_flag;
+ short flag;
+ int flag2;
- float lens, grid;
- float clip_start, clip_end;
- float ofs[3] DNA_DEPRECATED;
+ float lens, grid;
+ float clip_start, clip_end;
+ float ofs[3] DNA_DEPRECATED;
- char _pad[1];
+ char _pad[1];
- /** Transform gizmo info. */
- /** #V3D_GIZMO_SHOW_* */
- char gizmo_flag;
+ /** Transform gizmo info. */
+ /** #V3D_GIZMO_SHOW_* */
+ char gizmo_flag;
- char gizmo_show_object;
- char gizmo_show_armature;
- char gizmo_show_empty;
- char gizmo_show_light;
- char gizmo_show_camera;
+ char gizmo_show_object;
+ char gizmo_show_armature;
+ char gizmo_show_empty;
+ char gizmo_show_light;
+ char gizmo_show_camera;
- char gridflag;
+ char gridflag;
- short gridlines;
- /** Number of subdivisions in the grid between each highlighted grid line. */
- short gridsubdiv;
+ short gridlines;
+ /** Number of subdivisions in the grid between each highlighted grid line. */
+ short gridsubdiv;
- /** Actually only used to define the opacity of the grease pencil vertex in edit mode. */
- float vertex_opacity;
+ /** Actually only used to define the opacity of the grease pencil vertex in edit mode. */
+ float vertex_opacity;
- /* note, 'fx_settings.dof' is currently _not_ allocated,
- * instead set (temporarily) from camera */
- struct GPUFXSettings fx_settings;
+ /* note, 'fx_settings.dof' is currently _not_ allocated,
+ * instead set (temporarily) from camera */
+ struct GPUFXSettings fx_settings;
- /* XXX deprecated? */
- /** Grease-Pencil Data (annotation layers). */
- struct bGPdata *gpd DNA_DEPRECATED;
+ /* XXX deprecated? */
+ /** Grease-Pencil Data (annotation layers). */
+ struct bGPdata *gpd DNA_DEPRECATED;
- /** Stereoscopy settings. */
- short stereo3d_flag;
- char stereo3d_camera;
- char _pad4;
- float stereo3d_convergence_factor;
- float stereo3d_volume_alpha;
- float stereo3d_convergence_alpha;
+ /** Stereoscopy settings. */
+ short stereo3d_flag;
+ char stereo3d_camera;
+ char _pad4;
+ float stereo3d_convergence_factor;
+ float stereo3d_volume_alpha;
+ float stereo3d_convergence_alpha;
- /** Display settings. */
- View3DShading shading;
- View3DOverlay overlay;
+ /** Display settings. */
+ View3DShading shading;
+ View3DOverlay overlay;
- /** Runtime evaluation data (keep last). */
- View3D_Runtime runtime;
+ /** Runtime evaluation data (keep last). */
+ View3D_Runtime runtime;
} View3D;
-
/** #View3D.stereo3d_flag */
-#define V3D_S3D_DISPCAMERAS (1 << 0)
-#define V3D_S3D_DISPPLANE (1 << 1)
-#define V3D_S3D_DISPVOLUME (1 << 2)
+#define V3D_S3D_DISPCAMERAS (1 << 0)
+#define V3D_S3D_DISPPLANE (1 << 1)
+#define V3D_S3D_DISPVOLUME (1 << 2)
/** #View3D.flag */
-#define V3D_FLAG_UNUSED_0 (1 << 0) /* cleared */
-#define V3D_FLAG_UNUSED_1 (1 << 1) /* cleared */
-#define V3D_HIDE_HELPLINES (1 << 2)
-#define V3D_INVALID_BACKBUF (1 << 3)
+#define V3D_FLAG_UNUSED_0 (1 << 0) /* cleared */
+#define V3D_FLAG_UNUSED_1 (1 << 1) /* cleared */
+#define V3D_HIDE_HELPLINES (1 << 2)
+#define V3D_INVALID_BACKBUF (1 << 3)
-#define V3D_FLAG_UNUSED_10 (1 << 10) /* cleared */
-#define V3D_SELECT_OUTLINE (1 << 11)
-#define V3D_FLAG_UNUSED_12 (1 << 12) /* cleared */
-#define V3D_GLOBAL_STATS (1 << 13)
-#define V3D_DRAW_CENTERS (1 << 15)
+#define V3D_FLAG_UNUSED_10 (1 << 10) /* cleared */
+#define V3D_SELECT_OUTLINE (1 << 11)
+#define V3D_FLAG_UNUSED_12 (1 << 12) /* cleared */
+#define V3D_GLOBAL_STATS (1 << 13)
+#define V3D_DRAW_CENTERS (1 << 15)
/** #RegionView3D.persp */
-#define RV3D_ORTHO 0
-#define RV3D_PERSP 1
-#define RV3D_CAMOB 2
+#define RV3D_ORTHO 0
+#define RV3D_PERSP 1
+#define RV3D_CAMOB 2
/** #RegionView3D.rflag */
-#define RV3D_CLIPPING (1 << 2)
-#define RV3D_NAVIGATING (1 << 3)
-#define RV3D_GPULIGHT_UPDATE (1 << 4)
-/*#define RV3D_IS_GAME_ENGINE (1 << 5) *//* UNUSED */
+#define RV3D_CLIPPING (1 << 2)
+#define RV3D_NAVIGATING (1 << 3)
+#define RV3D_GPULIGHT_UPDATE (1 << 4)
+/*#define RV3D_IS_GAME_ENGINE (1 << 5) */ /* UNUSED */
/**
* Disable zbuffer offset, skip calls to #ED_view3d_polygon_offset.
* Use when precise surface depth is needed and picking bias isn't, see T45434).
*/
-#define RV3D_ZOFFSET_DISABLED 64
+#define RV3D_ZOFFSET_DISABLED 64
/** #RegionView3D.viewlock */
-#define RV3D_LOCKED (1 << 0)
-#define RV3D_BOXVIEW (1 << 1)
-#define RV3D_BOXCLIP (1 << 2)
+#define RV3D_LOCKED (1 << 0)
+#define RV3D_BOXVIEW (1 << 1)
+#define RV3D_BOXCLIP (1 << 2)
/** #RegionView3D.viewlock_quad */
-#define RV3D_VIEWLOCK_INIT (1 << 7)
+#define RV3D_VIEWLOCK_INIT (1 << 7)
/** #RegionView3D.view */
-#define RV3D_VIEW_USER 0
-#define RV3D_VIEW_FRONT 1
-#define RV3D_VIEW_BACK 2
-#define RV3D_VIEW_LEFT 3
-#define RV3D_VIEW_RIGHT 4
-#define RV3D_VIEW_TOP 5
-#define RV3D_VIEW_BOTTOM 6
-#define RV3D_VIEW_CAMERA 8
-
-#define RV3D_VIEW_IS_AXIS(view) \
- (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
+#define RV3D_VIEW_USER 0
+#define RV3D_VIEW_FRONT 1
+#define RV3D_VIEW_BACK 2
+#define RV3D_VIEW_LEFT 3
+#define RV3D_VIEW_RIGHT 4
+#define RV3D_VIEW_TOP 5
+#define RV3D_VIEW_BOTTOM 6
+#define RV3D_VIEW_CAMERA 8
+
+#define RV3D_VIEW_IS_AXIS(view) (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
/** #View3D.flag2 (int) */
-#define V3D_HIDE_OVERLAYS (1 << 2)
-#define V3D_FLAG2_UNUSED_3 (1 << 3) /* cleared */
-#define V3D_SHOW_ANNOTATION (1 << 4)
-#define V3D_LOCK_CAMERA (1 << 5)
-#define V3D_FLAG2_UNUSED_6 (1 << 6) /* cleared */
+#define V3D_HIDE_OVERLAYS (1 << 2)
+#define V3D_FLAG2_UNUSED_3 (1 << 3) /* cleared */
+#define V3D_SHOW_ANNOTATION (1 << 4)
+#define V3D_LOCK_CAMERA (1 << 5)
+#define V3D_FLAG2_UNUSED_6 (1 << 6) /* cleared */
#define V3D_SHOW_RECONSTRUCTION (1 << 7)
-#define V3D_SHOW_CAMERAPATH (1 << 8)
-#define V3D_SHOW_BUNDLENAME (1 << 9)
-#define V3D_FLAG2_UNUSED_10 (1 << 10) /* cleared */
-#define V3D_RENDER_BORDER (1 << 11)
-#define V3D_FLAG2_UNUSED_12 (1 << 12) /* cleared */
-#define V3D_FLAG2_UNUSED_13 (1 << 13) /* cleared */
-#define V3D_FLAG2_UNUSED_14 (1 << 14) /* cleared */
-#define V3D_FLAG2_UNUSED_15 (1 << 15) /* cleared */
+#define V3D_SHOW_CAMERAPATH (1 << 8)
+#define V3D_SHOW_BUNDLENAME (1 << 9)
+#define V3D_FLAG2_UNUSED_10 (1 << 10) /* cleared */
+#define V3D_RENDER_BORDER (1 << 11)
+#define V3D_FLAG2_UNUSED_12 (1 << 12) /* cleared */
+#define V3D_FLAG2_UNUSED_13 (1 << 13) /* cleared */
+#define V3D_FLAG2_UNUSED_14 (1 << 14) /* cleared */
+#define V3D_FLAG2_UNUSED_15 (1 << 15) /* cleared */
/** #View3D.gp_flag (short) */
-#define V3D_GP_SHOW_PAPER (1 << 0) /* Activate paper to cover all viewport */
-#define V3D_GP_SHOW_GRID (1 << 1) /* Activate paper grid */
-#define V3D_GP_SHOW_EDIT_LINES (1 << 2)
-#define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 3)
-#define V3D_GP_SHOW_ONION_SKIN (1 << 4) /* main switch at view level */
-#define V3D_GP_FADE_NOACTIVE_LAYERS (1 << 5) /* fade layers not active */
+#define V3D_GP_SHOW_PAPER (1 << 0) /* Activate paper to cover all viewport */
+#define V3D_GP_SHOW_GRID (1 << 1) /* Activate paper grid */
+#define V3D_GP_SHOW_EDIT_LINES (1 << 2)
+#define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 3)
+#define V3D_GP_SHOW_ONION_SKIN (1 << 4) /* main switch at view level */
+#define V3D_GP_FADE_NOACTIVE_LAYERS (1 << 5) /* fade layers not active */
/** #View3DShading.light */
enum {
- V3D_LIGHTING_FLAT = 0,
- V3D_LIGHTING_STUDIO = 1,
- V3D_LIGHTING_MATCAP = 2,
+ V3D_LIGHTING_FLAT = 0,
+ V3D_LIGHTING_STUDIO = 1,
+ V3D_LIGHTING_MATCAP = 2,
};
/** #View3DShading.flag */
enum {
- 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_BONE = (1 << 8),
- V3D_SHADING_WORLD_ORIENTATION = (1 << 9),
- V3D_SHADING_BACKFACE_CULLING = (1 << 10),
- V3D_SHADING_DEPTH_OF_FIELD = (1 << 11),
+ 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_BONE = (1 << 8),
+ V3D_SHADING_WORLD_ORIENTATION = (1 << 9),
+ V3D_SHADING_BACKFACE_CULLING = (1 << 10),
+ V3D_SHADING_DEPTH_OF_FIELD = (1 << 11),
};
/** #View3DShading.color_type */
enum {
- 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_MATERIAL_COLOR = 0,
+ V3D_SHADING_RANDOM_COLOR = 1,
+ V3D_SHADING_SINGLE_COLOR = 2,
+ V3D_SHADING_TEXTURE_COLOR = 3,
+ V3D_SHADING_OBJECT_COLOR = 4,
};
/** #View3DShading.background_type */
enum {
- V3D_SHADING_BACKGROUND_THEME = 0,
- V3D_SHADING_BACKGROUND_WORLD = 1,
- V3D_SHADING_BACKGROUND_VIEWPORT = 2,
+ V3D_SHADING_BACKGROUND_THEME = 0,
+ V3D_SHADING_BACKGROUND_WORLD = 1,
+ V3D_SHADING_BACKGROUND_VIEWPORT = 2,
};
/** #View3DShading.cavity_type */
enum {
- V3D_SHADING_CAVITY_SSAO = 0,
- V3D_SHADING_CAVITY_CURVATURE = 1,
- V3D_SHADING_CAVITY_BOTH = 2,
+ V3D_SHADING_CAVITY_SSAO = 0,
+ V3D_SHADING_CAVITY_CURVATURE = 1,
+ V3D_SHADING_CAVITY_BOTH = 2,
};
/** #View3DOverlay.flag */
enum {
- 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_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),
};
/** #View3DOverlay.edit_flag */
enum {
- V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
- V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
- V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
+ V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
+ V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
+ V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
- V3D_OVERLAY_EDIT_OCCLUDE_WIRE = (1 << 3),
+ V3D_OVERLAY_EDIT_OCCLUDE_WIRE = (1 << 3),
- V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
+ V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
- V3D_OVERLAY_EDIT_EDGES = (1 << 5),
- V3D_OVERLAY_EDIT_FACES = (1 << 6),
- V3D_OVERLAY_EDIT_FACE_DOT = (1 << 7),
+ V3D_OVERLAY_EDIT_EDGES = (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_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_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),
+ 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),
- V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
- V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
+ V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
+ V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
};
/** #View3DOverlay.paint_flag */
enum {
- V3D_OVERLAY_PAINT_WIRE = (1 << 0),
+ V3D_OVERLAY_PAINT_WIRE = (1 << 0),
};
/** #View3DOverlay.wpaint_flag */
enum {
- V3D_OVERLAY_WPAINT_CONTOURS = (1 << 0),
+ V3D_OVERLAY_WPAINT_CONTOURS = (1 << 0),
};
/** #View3D.around */
enum {
- /* 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,
+ /* 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 */
-#define V3D_SHOW_FLOOR (1 << 0)
-#define V3D_SHOW_X (1 << 1)
-#define V3D_SHOW_Y (1 << 2)
-#define V3D_SHOW_Z (1 << 3)
+#define V3D_SHOW_FLOOR (1 << 0)
+#define V3D_SHOW_X (1 << 1)
+#define V3D_SHOW_Y (1 << 2)
+#define V3D_SHOW_Z (1 << 3)
/** #TransformOrientationSlot.type */
enum {
- 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_CUSTOM = 1024,
- /** Runtime only, never saved to DNA. */
- V3D_ORIENT_CUSTOM_MATRIX = (V3D_ORIENT_CUSTOM - 1),
+ 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_CUSTOM = 1024,
+ /** Runtime only, never saved to DNA. */
+ V3D_ORIENT_CUSTOM_MATRIX = (V3D_ORIENT_CUSTOM - 1),
};
/** #View3d.gizmo_flag */
enum {
- /** 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),
+ /** 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),
};
/** #View3d.gizmo_show_object */
enum {
- V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0),
- V3D_GIZMO_SHOW_OBJECT_ROTATE = (1 << 1),
- V3D_GIZMO_SHOW_OBJECT_SCALE = (1 << 2),
+ V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0),
+ V3D_GIZMO_SHOW_OBJECT_ROTATE = (1 << 1),
+ V3D_GIZMO_SHOW_OBJECT_SCALE = (1 << 2),
};
/** #View3d.gizmo_show_armature */
enum {
- /** Currently unused (WIP gizmo). */
- V3D_GIZMO_SHOW_ARMATURE_BBONE = (1 << 0),
- /** Not yet implemented. */
- V3D_GIZMO_SHOW_ARMATURE_ROLL = (1 << 1),
+ /** Currently unused (WIP gizmo). */
+ V3D_GIZMO_SHOW_ARMATURE_BBONE = (1 << 0),
+ /** Not yet implemented. */
+ V3D_GIZMO_SHOW_ARMATURE_ROLL = (1 << 1),
};
/** #View3d.gizmo_show_empty */
enum {
- V3D_GIZMO_SHOW_EMPTY_IMAGE = (1 << 0),
- V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD = (1 << 1),
+ V3D_GIZMO_SHOW_EMPTY_IMAGE = (1 << 0),
+ V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD = (1 << 1),
};
/** #View3d.gizmo_show_light */
enum {
- /** Use for both spot & area size. */
- V3D_GIZMO_SHOW_LIGHT_SIZE = (1 << 0),
- V3D_GIZMO_SHOW_LIGHT_LOOK_AT = (1 << 1),
+ /** Use for both spot & area size. */
+ V3D_GIZMO_SHOW_LIGHT_SIZE = (1 << 0),
+ V3D_GIZMO_SHOW_LIGHT_LOOK_AT = (1 << 1),
};
/** #View3d.gizmo_show_camera */
enum {
- /** Also used for ortho size. */
- V3D_GIZMO_SHOW_CAMERA_LENS = (1 << 0),
- V3D_GIZMO_SHOW_CAMERA_DOF_DIST = (1 << 2),
+ /** Also used for ortho size. */
+ V3D_GIZMO_SHOW_CAMERA_LENS = (1 << 0),
+ V3D_GIZMO_SHOW_CAMERA_DOF_DIST = (1 << 2),
};
#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_MIN_FACTOR 0.1657359312880714853f
#define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f
#endif
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 420573c74e2..171c0a25187 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -55,59 +55,60 @@ struct uiLayout;
struct wmTimer;
#define OP_MAX_TYPENAME 64
-#define KMAP_MAX_NAME 64
+#define KMAP_MAX_NAME 64
/* keep in sync with 'rna_enum_wm_report_items' in wm_rna.c */
typedef enum ReportType {
- RPT_DEBUG = (1 << 0),
- RPT_INFO = (1 << 1),
- RPT_OPERATOR = (1 << 2),
- RPT_PROPERTY = (1 << 3),
- RPT_WARNING = (1 << 4),
- RPT_ERROR = (1 << 5),
- RPT_ERROR_INVALID_INPUT = (1 << 6),
- RPT_ERROR_INVALID_CONTEXT = (1 << 7),
- RPT_ERROR_OUT_OF_MEMORY = (1 << 8),
+ RPT_DEBUG = (1 << 0),
+ RPT_INFO = (1 << 1),
+ RPT_OPERATOR = (1 << 2),
+ RPT_PROPERTY = (1 << 3),
+ RPT_WARNING = (1 << 4),
+ RPT_ERROR = (1 << 5),
+ RPT_ERROR_INVALID_INPUT = (1 << 6),
+ RPT_ERROR_INVALID_CONTEXT = (1 << 7),
+ RPT_ERROR_OUT_OF_MEMORY = (1 << 8),
} ReportType;
-#define RPT_DEBUG_ALL (RPT_DEBUG)
-#define RPT_INFO_ALL (RPT_INFO)
-#define RPT_OPERATOR_ALL (RPT_OPERATOR)
-#define RPT_PROPERTY_ALL (RPT_PROPERTY)
-#define RPT_WARNING_ALL (RPT_WARNING)
-#define RPT_ERROR_ALL (RPT_ERROR|RPT_ERROR_INVALID_INPUT|RPT_ERROR_INVALID_CONTEXT|RPT_ERROR_OUT_OF_MEMORY)
+#define RPT_DEBUG_ALL (RPT_DEBUG)
+#define RPT_INFO_ALL (RPT_INFO)
+#define RPT_OPERATOR_ALL (RPT_OPERATOR)
+#define RPT_PROPERTY_ALL (RPT_PROPERTY)
+#define RPT_WARNING_ALL (RPT_WARNING)
+#define RPT_ERROR_ALL \
+ (RPT_ERROR | RPT_ERROR_INVALID_INPUT | RPT_ERROR_INVALID_CONTEXT | RPT_ERROR_OUT_OF_MEMORY)
enum ReportListFlags {
- RPT_PRINT = (1 << 0),
- RPT_STORE = (1 << 1),
- RPT_FREE = (1 << 2),
- RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */
+ RPT_PRINT = (1 << 0),
+ RPT_STORE = (1 << 1),
+ RPT_FREE = (1 << 2),
+ RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */
};
/* These two Lines with # tell makesdna this struct can be excluded. */
#
#
typedef struct Report {
- struct Report *next, *prev;
- /** ReportType. */
- short type;
- short flag;
- /** `strlen(message)`, saves some time calculating the word wrap . */
- int len;
- const char *typestr;
- const char *message;
+ struct Report *next, *prev;
+ /** ReportType. */
+ short type;
+ short flag;
+ /** `strlen(message)`, saves some time calculating the word wrap . */
+ int len;
+ const char *typestr;
+ const char *message;
} Report;
/* saved in the wm, don't remove */
typedef struct ReportList {
- ListBase list;
- /** ReportType. */
- int printlevel;
- /** ReportType. */
- int storelevel;
- int flag;
- char _pad[4];
- struct wmTimer *reporttimer;
+ ListBase list;
+ /** ReportType. */
+ int printlevel;
+ /** ReportType. */
+ int storelevel;
+ int flag;
+ char _pad[4];
+ struct wmTimer *reporttimer;
} ReportList;
/* timer customdata to control reports display */
@@ -115,75 +116,74 @@ typedef struct ReportList {
#
#
typedef struct ReportTimerInfo {
- float col[4];
- float widthfac;
+ float col[4];
+ float widthfac;
} ReportTimerInfo;
/* reports need to be before wmWindowManager */
-
/* windowmanager is saved, tag WMAN */
typedef struct wmWindowManager {
- ID id;
+ ID id;
- /** Separate active from drawable. */
- struct wmWindow *windrawable, *winactive;
- ListBase windows;
+ /** Separate active from drawable. */
+ struct wmWindow *windrawable, *winactive;
+ ListBase windows;
- /** Set on file read. */
- int initialized;
- /** Indicator whether data was saved. */
- short file_saved;
- /** Operator stack depth to avoid nested undo pushes. */
- short op_undo_depth;
+ /** Set on file read. */
+ int initialized;
+ /** Indicator whether data was saved. */
+ short file_saved;
+ /** Operator stack depth to avoid nested undo pushes. */
+ short op_undo_depth;
- /** Operator registry. */
- ListBase operators;
+ /** Operator registry. */
+ ListBase operators;
- /** Refresh/redraw wmNotifier structs. */
- ListBase queue;
+ /** Refresh/redraw wmNotifier structs. */
+ ListBase queue;
- /** Information and error reports. */
- struct ReportList reports;
+ /** Information and error reports. */
+ struct ReportList reports;
- /** Threaded jobs manager. */
- ListBase jobs;
+ /** Threaded jobs manager. */
+ ListBase jobs;
- /** Extra overlay cursors to draw, like circles. */
- ListBase paintcursors;
+ /** Extra overlay cursors to draw, like circles. */
+ ListBase paintcursors;
- /** Active dragged items. */
- ListBase drags;
+ /** Active dragged items. */
+ ListBase drags;
- /** Known key configurations. */
- ListBase keyconfigs;
- /** Default configuration. */
- struct wmKeyConfig *defaultconf;
- /** Addon configuration. */
- struct wmKeyConfig *addonconf;
- /** User configuration. */
- struct wmKeyConfig *userconf;
+ /** Known key configurations. */
+ ListBase keyconfigs;
+ /** Default configuration. */
+ struct wmKeyConfig *defaultconf;
+ /** Addon configuration. */
+ struct wmKeyConfig *addonconf;
+ /** User configuration. */
+ struct wmKeyConfig *userconf;
- /** Active timers. */
- ListBase timers;
- /** Timer for auto save. */
- struct wmTimer *autosavetimer;
+ /** Active timers. */
+ ListBase timers;
+ /** Timer for auto save. */
+ struct wmTimer *autosavetimer;
- /** All undo history (runtime only). */
- struct UndoStack *undo_stack;
+ /** All undo history (runtime only). */
+ struct UndoStack *undo_stack;
- /** Indicates whether interface is locked for user interaction. */
- char is_interface_locked;
- char par[7];
+ /** Indicates whether interface is locked for user interaction. */
+ char is_interface_locked;
+ char par[7];
- struct wmMsgBus *message_bus;
+ struct wmMsgBus *message_bus;
} wmWindowManager;
/* wmWindowManager.initialized */
enum {
- WM_WINDOW_IS_INITIALIZED = (1 << 0),
- WM_KEYCONFIG_IS_INITIALIZED = (1 << 1),
+ WM_WINDOW_IS_INITIALIZED = (1 << 0),
+ WM_KEYCONFIG_IS_INITIALIZED = (1 << 1),
};
#define WM_KEYCONFIG_STR_DEFAULT "blender"
@@ -191,96 +191,96 @@ enum {
/* IME is win32 only! */
#if !defined(WIN32) && !defined(DNA_DEPRECATED)
# ifdef __GNUC__
-# define ime_data ime_data __attribute__ ((deprecated))
+# define ime_data ime_data __attribute__((deprecated))
# endif
#endif
/* the saveable part, rest of data is local in ghostwinlay */
typedef struct wmWindow {
- struct wmWindow *next, *prev;
-
- /** Don't want to include ghost.h stuff. */
- void *ghostwin;
- /** Don't want to include gpu stuff. */
- void *gpuctx;
-
- /** Parent window. */
- struct wmWindow *parent;
-
- /** Active scene displayed in this window. */
- struct Scene *scene;
- /** Temporary when switching. */
- struct Scene *new_scene;
- /** Active view layer displayed in this window. */
- char view_layer_name[64];
-
- struct WorkSpaceInstanceHook *workspace_hook;
-
- /** 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;
-
- struct bScreen *screen DNA_DEPRECATED;
-
- /** Window coords. */
- short posx, posy, sizex, sizey;
- /** Borderless, full. */
- short windowstate;
- /** Multiscreen... no idea how to store yet. */
- short monitor;
- /** Set to 1 if an active window, for quick rejects. */
- short active;
- /** Current mouse cursor type. */
- short cursor;
- /** Previous cursor when setting modal one. */
- short lastcursor;
- /** The current modal cursor. */
- short modalcursor;
- /** Cursor grab mode. */
- short grabcursor;
- /** Internal: tag this for extra mousemove event,
- * makes cursors/buttons active on UI switching. */
- short addmousemove;
-
- /** Winid also in screens, is for retrieving this window after read. */
- int winid;
-
- /** Internal, lock pie creation from this event until released. */
- short lock_pie_event;
- /**
- * 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 last_pie_event;
-
- /** Storage for event system. */
- struct wmEvent *eventstate;
-
- /** Internal for wm_operators.c. */
- struct wmGesture *tweak;
-
- /* Input Method Editor data - complex character input (esp. for asian character input)
- * Currently WIN32, runtime-only data */
- struct wmIMEData *ime_data;
-
- /** All events (ghost level events were handled). */
- ListBase queue;
- /** Window+screen handlers, handled last. */
- ListBase handlers;
- /** Priority handlers, handled first. */
- ListBase modalhandlers;
-
- /** Gesture stuff. */
- ListBase gesture;
-
- /** Properties for stereoscopic displays. */
- struct Stereo3dFormat *stereo3d_format;
-
- /* custom drawing callbacks */
- ListBase drawcalls;
-
- /* Private runtime info to show text in the status bar. */
- void *cursor_keymap_status;
+ struct wmWindow *next, *prev;
+
+ /** Don't want to include ghost.h stuff. */
+ void *ghostwin;
+ /** Don't want to include gpu stuff. */
+ void *gpuctx;
+
+ /** Parent window. */
+ struct wmWindow *parent;
+
+ /** Active scene displayed in this window. */
+ struct Scene *scene;
+ /** Temporary when switching. */
+ struct Scene *new_scene;
+ /** Active view layer displayed in this window. */
+ char view_layer_name[64];
+
+ struct WorkSpaceInstanceHook *workspace_hook;
+
+ /** 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;
+
+ struct bScreen *screen DNA_DEPRECATED;
+
+ /** Window coords. */
+ short posx, posy, sizex, sizey;
+ /** Borderless, full. */
+ short windowstate;
+ /** Multiscreen... no idea how to store yet. */
+ short monitor;
+ /** Set to 1 if an active window, for quick rejects. */
+ short active;
+ /** Current mouse cursor type. */
+ short cursor;
+ /** Previous cursor when setting modal one. */
+ short lastcursor;
+ /** The current modal cursor. */
+ short modalcursor;
+ /** Cursor grab mode. */
+ short grabcursor;
+ /** Internal: tag this for extra mousemove event,
+ * makes cursors/buttons active on UI switching. */
+ short addmousemove;
+
+ /** Winid also in screens, is for retrieving this window after read. */
+ int winid;
+
+ /** Internal, lock pie creation from this event until released. */
+ short lock_pie_event;
+ /**
+ * 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 last_pie_event;
+
+ /** Storage for event system. */
+ struct wmEvent *eventstate;
+
+ /** Internal for wm_operators.c. */
+ struct wmGesture *tweak;
+
+ /* Input Method Editor data - complex character input (esp. for asian character input)
+ * Currently WIN32, runtime-only data */
+ struct wmIMEData *ime_data;
+
+ /** All events (ghost level events were handled). */
+ ListBase queue;
+ /** Window+screen handlers, handled last. */
+ ListBase handlers;
+ /** Priority handlers, handled first. */
+ ListBase modalhandlers;
+
+ /** Gesture stuff. */
+ ListBase gesture;
+
+ /** Properties for stereoscopic displays. */
+ struct Stereo3dFormat *stereo3d_format;
+
+ /* custom drawing callbacks */
+ ListBase drawcalls;
+
+ /* Private runtime info to show text in the status bar. */
+ void *cursor_keymap_status;
} wmWindow;
#ifdef ime_data
@@ -293,121 +293,121 @@ typedef struct wmWindow {
#
#
typedef struct wmOperatorTypeMacro {
- struct wmOperatorTypeMacro *next, *prev;
-
- /* operator id */
- char idname[64];
- /* rna pointer to access properties, like keymap */
- /** Operator properties, assigned to ptr->data and can be written to a file. */
- struct IDProperty *properties;
- struct PointerRNA *ptr;
+ struct wmOperatorTypeMacro *next, *prev;
+
+ /* operator id */
+ char idname[64];
+ /* rna pointer to access properties, like keymap */
+ /** Operator properties, assigned to ptr->data and can be written to a file. */
+ struct IDProperty *properties;
+ struct PointerRNA *ptr;
} wmOperatorTypeMacro;
/* partial copy of the event, for matching by eventhandler */
typedef struct wmKeyMapItem {
- struct wmKeyMapItem *next, *prev;
-
- /* 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;
-
- /* modal */
- /** Runtime temporary storage for loading. */
- char propvalue_str[64];
- /** If used, the item is from modal map. */
- short propvalue;
-
- /* event */
- /** Event code itself. */
- short type;
- /** KM_ANY, KM_PRESS, KM_NOTHING etc. */
- short val;
- /** Oskey is apple or windowskey, value denotes order of pressed. */
- short shift, ctrl, alt, oskey;
- /** Rawkey modifier. */
- short keymodifier;
-
- /* flag: inactive, expanded */
- short flag;
-
- /* runtime */
- /** Keymap editor. */
- short maptype;
- /** Unique identifier. Positive for kmi that override builtins, negative otherwise. */
- short id;
- char _pad[2];
- /** Rna pointer to access properties. */
- struct PointerRNA *ptr;
+ struct wmKeyMapItem *next, *prev;
+
+ /* 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;
+
+ /* modal */
+ /** Runtime temporary storage for loading. */
+ char propvalue_str[64];
+ /** If used, the item is from modal map. */
+ short propvalue;
+
+ /* event */
+ /** Event code itself. */
+ short type;
+ /** KM_ANY, KM_PRESS, KM_NOTHING etc. */
+ short val;
+ /** Oskey is apple or windowskey, value denotes order of pressed. */
+ short shift, ctrl, alt, oskey;
+ /** Rawkey modifier. */
+ short keymodifier;
+
+ /* flag: inactive, expanded */
+ short flag;
+
+ /* runtime */
+ /** Keymap editor. */
+ short maptype;
+ /** Unique identifier. Positive for kmi that override builtins, negative otherwise. */
+ short id;
+ char _pad[2];
+ /** Rna pointer to access properties. */
+ struct PointerRNA *ptr;
} wmKeyMapItem;
/* used instead of wmKeyMapItem for diff keymaps */
typedef struct wmKeyMapDiffItem {
- struct wmKeyMapDiffItem *next, *prev;
+ struct wmKeyMapDiffItem *next, *prev;
- wmKeyMapItem *remove_item;
- wmKeyMapItem *add_item;
+ wmKeyMapItem *remove_item;
+ wmKeyMapItem *add_item;
} wmKeyMapDiffItem;
/* wmKeyMapItem.flag */
enum {
- KMI_INACTIVE = (1 << 0),
- KMI_EXPANDED = (1 << 1),
- KMI_USER_MODIFIED = (1 << 2),
- KMI_UPDATE = (1 << 3),
+ KMI_INACTIVE = (1 << 0),
+ KMI_EXPANDED = (1 << 1),
+ KMI_USER_MODIFIED = (1 << 2),
+ KMI_UPDATE = (1 << 3),
};
/* wmKeyMapItem.maptype */
enum {
- KMI_TYPE_KEYBOARD = 0,
- KMI_TYPE_MOUSE = 1,
- KMI_TYPE_TWEAK = 2,
- KMI_TYPE_TEXTINPUT = 3,
- KMI_TYPE_TIMER = 4,
- KMI_TYPE_NDOF = 5,
+ KMI_TYPE_KEYBOARD = 0,
+ KMI_TYPE_MOUSE = 1,
+ KMI_TYPE_TWEAK = 2,
+ KMI_TYPE_TEXTINPUT = 3,
+ KMI_TYPE_TIMER = 4,
+ KMI_TYPE_NDOF = 5,
};
/* stored in WM, the actively used keymaps */
typedef struct wmKeyMap {
- struct wmKeyMap *next, *prev;
-
- ListBase items;
- ListBase diff_items;
-
- /** Global editor keymaps, or for more per space/region. */
- char idname[64];
- /** Same IDs as in DNA_space_types.h. */
- short spaceid;
- /** See above. */
- short regionid;
- /** Optional, see: #wmOwnerID. */
- char owner_id[64];
-
- /** General flags. */
- short flag;
- /** Last kmi id. */
- short kmi_id;
-
- /* 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;
+ struct wmKeyMap *next, *prev;
+
+ ListBase items;
+ ListBase diff_items;
+
+ /** Global editor keymaps, or for more per space/region. */
+ char idname[64];
+ /** Same IDs as in DNA_space_types.h. */
+ short spaceid;
+ /** See above. */
+ short regionid;
+ /** Optional, see: #wmOwnerID. */
+ char owner_id[64];
+
+ /** General flags. */
+ short flag;
+ /** Last kmi id. */
+ short kmi_id;
+
+ /* 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;
} wmKeyMap;
/* wmKeyMap.flag */
enum {
- KEYMAP_MODAL = (1 << 0), /* modal map, not using operatornames */
- KEYMAP_USER = (1 << 1), /* user keymap */
- KEYMAP_EXPANDED = (1 << 2),
- KEYMAP_CHILDREN_EXPANDED = (1 << 3),
- KEYMAP_DIFF = (1 << 4), /* diff keymap for user preferences */
- KEYMAP_USER_MODIFIED = (1 << 5), /* keymap has user modifications */
- KEYMAP_UPDATE = (1 << 6),
- KEYMAP_TOOL = (1 << 7), /* keymap for active tool system */
+ KEYMAP_MODAL = (1 << 0), /* modal map, not using operatornames */
+ KEYMAP_USER = (1 << 1), /* user keymap */
+ KEYMAP_EXPANDED = (1 << 2),
+ KEYMAP_CHILDREN_EXPANDED = (1 << 3),
+ KEYMAP_DIFF = (1 << 4), /* diff keymap for user preferences */
+ KEYMAP_USER_MODIFIED = (1 << 5), /* keymap has user modifications */
+ KEYMAP_UPDATE = (1 << 6),
+ KEYMAP_TOOL = (1 << 7), /* keymap for active tool system */
};
/**
@@ -418,106 +418,102 @@ enum {
* #wmKeyConfigPrefType_Runtime has the RNA type.
*/
typedef struct wmKeyConfigPref {
- struct wmKeyConfigPref *next, *prev;
- /** Unique name. */
- char idname[64];
- IDProperty *prop;
+ struct wmKeyConfigPref *next, *prev;
+ /** Unique name. */
+ char idname[64];
+ IDProperty *prop;
} wmKeyConfigPref;
typedef struct wmKeyConfig {
- struct wmKeyConfig *next, *prev;
+ struct wmKeyConfig *next, *prev;
- /** Unique name. */
- char idname[64];
- /** Idname of configuration this is derives from, "" if none. */
- char basename[64];
+ /** Unique name. */
+ char idname[64];
+ /** Idname of configuration this is derives from, "" if none. */
+ char basename[64];
- ListBase keymaps;
- int actkeymap;
- short flag;
- char _pad0[2];
+ ListBase keymaps;
+ int actkeymap;
+ short flag;
+ char _pad0[2];
} wmKeyConfig;
/* wmKeyConfig.flag */
enum {
- KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
- KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
+ KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
+ KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
};
/* this one is the operator itself, stored in files for macros etc */
/* operator + operatortype should be able to redo entirely, but for different contextes */
typedef struct wmOperator {
- struct wmOperator *next, *prev;
-
- /* saved */
- /** Used to retrieve type pointer. */
- char idname[64];
- /** Saved, user-settable properties. */
- IDProperty *properties;
-
- /* runtime */
- /** Operator type definition from idname. */
- struct wmOperatorType *type;
- /** Custom storage, only while operator runs. */
- void *customdata;
- /** Python stores the class instance here. */
- void *py_instance;
-
- /** Rna pointer to access properties. */
- struct PointerRNA *ptr;
- /** Errors and warnings storage. */
- struct ReportList *reports;
-
- /** List of operators, can be a tree. */
- ListBase macro;
- /** Current running macro, not saved. */
- struct wmOperator *opm;
- /** Runtime for drawing. */
- struct uiLayout *layout;
- short flag;
- char _pad[6];
+ struct wmOperator *next, *prev;
+
+ /* saved */
+ /** Used to retrieve type pointer. */
+ char idname[64];
+ /** Saved, user-settable properties. */
+ IDProperty *properties;
+
+ /* runtime */
+ /** Operator type definition from idname. */
+ struct wmOperatorType *type;
+ /** Custom storage, only while operator runs. */
+ void *customdata;
+ /** Python stores the class instance here. */
+ void *py_instance;
+
+ /** Rna pointer to access properties. */
+ struct PointerRNA *ptr;
+ /** Errors and warnings storage. */
+ struct ReportList *reports;
+
+ /** List of operators, can be a tree. */
+ ListBase macro;
+ /** Current running macro, not saved. */
+ struct wmOperator *opm;
+ /** Runtime for drawing. */
+ struct uiLayout *layout;
+ short flag;
+ char _pad[6];
} wmOperator;
/* operator type return flags: exec(), invoke() modal(), return values */
enum {
- 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 fileselect */
- 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),
+ 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 fileselect */
+ 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),
};
-#define OPERATOR_FLAGS_ALL ( \
- OPERATOR_RUNNING_MODAL | \
- OPERATOR_CANCELLED | \
- OPERATOR_FINISHED | \
- OPERATOR_PASS_THROUGH | \
- OPERATOR_HANDLED | \
- OPERATOR_INTERFACE | \
- 0)
+#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) (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret)
+#define OPERATOR_RETVAL_CHECK(ret) \
+ (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret)
/* wmOperator flag */
enum {
- /** 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 from an interactive repeat. */
- OP_IS_REPEAT = (1 << 1),
-
- /** When the cursor is grabbed */
- OP_IS_MODAL_GRAB_CURSOR = (1 << 2),
-
- /** Allow modal operators to have the region under the cursor for their context
- * (the regiontype is maintained to prevent errors) */
- OP_IS_MODAL_CURSOR_REGION = (1 << 3),
+ /** 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 from an interactive repeat. */
+ OP_IS_REPEAT = (1 << 1),
+
+ /** When the cursor is grabbed */
+ OP_IS_MODAL_GRAB_CURSOR = (1 << 2),
+
+ /** Allow modal operators to have the region under the cursor for their context
+ * (the regiontype is maintained to prevent errors) */
+ OP_IS_MODAL_CURSOR_REGION = (1 << 3),
};
#endif /* __DNA_WINDOWMANAGER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
index 37277d7df8e..44526c93815 100644
--- a/source/blender/makesdna/DNA_workspace_types.h
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -31,51 +31,49 @@
#
#
typedef struct bToolRef_Runtime {
- int cursor;
+ int cursor;
- /** One of these 3 must be defined. */
- char keymap[64];
- char gizmo_group[64];
- char data_block[64];
+ /** One of these 3 must be defined. */
+ char keymap[64];
+ char gizmo_group[64];
+ char data_block[64];
- /** Use to infer primary operator to use when setting accelerator keys. */
- char op[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;
+ /** Index when a tool is a member of a group. */
+ int index;
} bToolRef_Runtime;
-
/* Stored per mode. */
typedef struct bToolRef {
- struct bToolRef *next, *prev;
- char idname[64];
-
- /** Use to avoid initializing the same tool multiple times. */
- short tag;
-
- /** #bToolKey (spacetype, mode), used in 'WM_api.h' */
- short space_type;
- /**
- * Value depends ont the 'space_type', object mode for 3D view, image editor has own mode too.
- * RNA needs to handle using item function.
- */
- int mode;
-
- /**
- * 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;
-
- /** Variables needed to operate the tool. */
- bToolRef_Runtime *runtime;
+ struct bToolRef *next, *prev;
+ char idname[64];
+
+ /** Use to avoid initializing the same tool multiple times. */
+ short tag;
+
+ /** #bToolKey (spacetype, mode), used in 'WM_api.h' */
+ short space_type;
+ /**
+ * Value depends ont the 'space_type', object mode for 3D view, image editor has own mode too.
+ * RNA needs to handle using item function.
+ */
+ int mode;
+
+ /**
+ * 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;
+
+ /** Variables needed to operate the tool. */
+ bToolRef_Runtime *runtime;
} bToolRef;
-
/**
* \brief Wrapper for bScreen.
*
@@ -84,59 +82,59 @@ typedef struct bToolRef {
* So we use this struct to wrap a bScreen pointer with another pair of next/prev pointers.
*/
typedef struct WorkSpaceLayout {
- struct WorkSpaceLayout *next, *prev;
+ struct WorkSpaceLayout *next, *prev;
- struct bScreen *screen;
- /* The name of this layout, we override the RNA name of the screen with this
- * (but not ID name itself) */
- /** MAX_NAME. */
- char name[64];
+ struct bScreen *screen;
+ /* The name of this layout, we override the RNA name of the screen with this
+ * (but not ID name itself) */
+ /** MAX_NAME. */
+ char name[64];
} WorkSpaceLayout;
/** Optional tags, which features to use, aligned with #bAddon names by convention. */
typedef struct wmOwnerID {
- struct wmOwnerID *next, *prev;
- /** MAX_NAME. */
- char name[64];
+ struct wmOwnerID *next, *prev;
+ /** MAX_NAME. */
+ char name[64];
} wmOwnerID;
typedef struct WorkSpace {
- ID id;
+ ID id;
- /** WorkSpaceLayout. */
- ListBase layouts;
- /* Store for each hook (so for each window) which layout has
- * been activated the last time this workspace was visible. */
- /** WorkSpaceDataRelation. */
- ListBase hook_layout_relations;
+ /** WorkSpaceLayout. */
+ ListBase layouts;
+ /* Store for each hook (so for each window) which layout has
+ * been activated the last time this workspace was visible. */
+ /** WorkSpaceDataRelation. */
+ ListBase hook_layout_relations;
- /* Feature tagging (use for addons) */
- /** #wmOwnerID. */
- ListBase owner_ids;
+ /* Feature tagging (use for addons) */
+ /** #wmOwnerID. */
+ ListBase owner_ids;
- /* should be: '#ifdef USE_WORKSPACE_TOOL'. */
+ /* should be: '#ifdef USE_WORKSPACE_TOOL'. */
- /** List of #bToolRef */
- ListBase tools;
+ /** List of #bToolRef */
+ ListBase tools;
- /**
- * BAD DESIGN WARNING:
- * This is a workaround for the topbar not knowing which tools spec. */
- char tools_space_type;
- /** Type is different for each space-type. */
- char tools_mode;
- char _pad[2];
+ /**
+ * BAD DESIGN WARNING:
+ * This is a workaround for the topbar not knowing which tools spec. */
+ char tools_space_type;
+ /** Type is different for each space-type. */
+ char tools_mode;
+ char _pad[2];
- int object_mode;
+ int object_mode;
- /** Enum eWorkSpaceFlags. */
- int flags;
+ /** Enum eWorkSpaceFlags. */
+ int flags;
- /* Number for workspace tab reordering in the UI. */
- int order;
+ /* Number for workspace tab reordering in the UI. */
+ int order;
- /* Info text from modal operators (runtime). */
- char *status_text;
+ /* Info text from modal operators (runtime). */
+ char *status_text;
} WorkSpace;
/**
@@ -163,13 +161,13 @@ typedef struct WorkSpace {
* the WorkSpaceDataRelation with the workspace-hook of the window set as parent.
*/
typedef struct WorkSpaceDataRelation {
- struct WorkSpaceDataRelation *next, *prev;
+ struct WorkSpaceDataRelation *next, *prev;
- /* the data used to identify the relation
- * (e.g. to find screen-layout (= value) from/for a hook) */
- void *parent;
- /* The value for this parent-data/workspace relation */
- void *value;
+ /* the data used to identify the relation
+ * (e.g. to find screen-layout (= value) from/for a hook) */
+ void *parent;
+ /* The value for this parent-data/workspace relation */
+ void *value;
} WorkSpaceDataRelation;
/**
@@ -177,17 +175,17 @@ typedef struct WorkSpaceDataRelation {
* It allows us to keep workspace and window data completely separate.
*/
typedef struct WorkSpaceInstanceHook {
- WorkSpace *active;
- struct WorkSpaceLayout *act_layout;
+ WorkSpace *active;
+ struct WorkSpaceLayout *act_layout;
- /* Needed because we can't change workspaces/layouts in running handler loop,
- * it would break context. */
- WorkSpace *temp_workspace_store;
- struct WorkSpaceLayout *temp_layout_store;
+ /* Needed because we can't change workspaces/layouts in running handler loop,
+ * it would break context. */
+ WorkSpace *temp_workspace_store;
+ struct WorkSpaceLayout *temp_layout_store;
} WorkSpaceInstanceHook;
typedef enum eWorkSpaceFlags {
- WORKSPACE_USE_FILTER_BY_ORIGIN = (1 << 1),
+ WORKSPACE_USE_FILTER_BY_ORIGIN = (1 << 1),
} eWorkSpaceFlags;
#endif /* __DNA_WORKSPACE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index ca7b22d5ec3..a1771693005 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -33,90 +33,89 @@ struct MTex;
struct bNodeTree;
#ifndef MAX_MTEX
-#define MAX_MTEX 18
+# define MAX_MTEX 18
#endif
-
/**
* World defines general modeling data such as a background fill,
* gravity, color model etc. It mixes rendering data and modeling data. */
typedef struct World {
- ID id;
- /** Animation data (must be immediately after id for utilities to use it). */
- struct AnimData *adt;
- /* runtime (must be immediately after id for utilities to use it). */
- DrawDataList drawdata;
-
- char _pad0[4];
- short texact, mistype;
-
- float horr, horg, horb;
-
- /**
- * Exposure= mult factor. unused now, but maybe back later. Kept in to be upward compat.
- * New is exp/range control. linfac & logfac are constants... don't belong in
- * file, but allocating 8 bytes for temp mem isn't useful either.
- */
- float exposure, exp, range;
- float linfac, logfac;
-
- /**
- * Some world modes
- * bit 0: Do mist
- */
- short mode;
- char _pad2[6];
-
- float misi, miststa, mistdist, misthi;
-
- /** Ambient occlusion. */
- float aodist, aoenergy;
-
- /** Assorted settings. */
- short flag;
- char _pad3[6];
-
- /** Old animation system, deprecated for 2.5. */
- struct Ipo *ipo DNA_DEPRECATED;
- short pr_texture, use_nodes;
- char _pad[4];
-
- /* previews */
- struct PreviewImage *preview;
-
- /* nodes */
- struct bNodeTree *nodetree;
-
- /** Runtime : miststa + mistdist, used for drawing camera. */
- float mistend;
- char _pad1[4];
- /** Runtime. */
- ListBase gpumaterial;
+ ID id;
+ /** Animation data (must be immediately after id for utilities to use it). */
+ struct AnimData *adt;
+ /* runtime (must be immediately after id for utilities to use it). */
+ DrawDataList drawdata;
+
+ char _pad0[4];
+ short texact, mistype;
+
+ float horr, horg, horb;
+
+ /**
+ * Exposure= mult factor. unused now, but maybe back later. Kept in to be upward compat.
+ * New is exp/range control. linfac & logfac are constants... don't belong in
+ * file, but allocating 8 bytes for temp mem isn't useful either.
+ */
+ float exposure, exp, range;
+ float linfac, logfac;
+
+ /**
+ * Some world modes
+ * bit 0: Do mist
+ */
+ short mode;
+ char _pad2[6];
+
+ float misi, miststa, mistdist, misthi;
+
+ /** Ambient occlusion. */
+ float aodist, aoenergy;
+
+ /** Assorted settings. */
+ short flag;
+ char _pad3[6];
+
+ /** Old animation system, deprecated for 2.5. */
+ struct Ipo *ipo DNA_DEPRECATED;
+ short pr_texture, use_nodes;
+ char _pad[4];
+
+ /* previews */
+ struct PreviewImage *preview;
+
+ /* nodes */
+ struct bNodeTree *nodetree;
+
+ /** Runtime : miststa + mistdist, used for drawing camera. */
+ float mistend;
+ char _pad1[4];
+ /** Runtime. */
+ ListBase gpumaterial;
} World;
/* **************** WORLD ********************* */
/* mode */
-#define WO_MIST (1 << 0)
-#define WO_MODE_UNUSED_1 (1 << 1) /* cleared */
-#define WO_MODE_UNUSED_2 (1 << 2) /* cleared */
-#define WO_MODE_UNUSED_3 (1 << 3) /* cleared */
-#define WO_MODE_UNUSED_4 (1 << 4) /* cleared */
-#define WO_MODE_UNUSED_5 (1 << 5) /* cleared */
-#define WO_AMB_OCC (1 << 6)
-#define WO_MODE_UNUSED_7 (1 << 7) /* cleared */
+#define WO_MIST (1 << 0)
+#define WO_MODE_UNUSED_1 (1 << 1) /* cleared */
+#define WO_MODE_UNUSED_2 (1 << 2) /* cleared */
+#define WO_MODE_UNUSED_3 (1 << 3) /* cleared */
+#define WO_MODE_UNUSED_4 (1 << 4) /* cleared */
+#define WO_MODE_UNUSED_5 (1 << 5) /* cleared */
+#define WO_AMB_OCC (1 << 6)
+#define WO_MODE_UNUSED_7 (1 << 7) /* cleared */
enum {
- WO_MIST_QUADRATIC = 0,
- WO_MIST_LINEAR = 1,
- WO_MIST_INVERSE_QUADRATIC = 2,
+ WO_MIST_QUADRATIC = 0,
+ WO_MIST_LINEAR = 1,
+ WO_MIST_INVERSE_QUADRATIC = 2,
};
/* flag */
-#define WO_DS_EXPAND (1 << 0)
- /* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
- * otherwise anim-editors will not read correctly
- */
-#define WO_DS_SHOW_TEXS (1 << 2)
+#define WO_DS_EXPAND (1 << 0)
+/* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
+ * otherwise anim-editors will not read correctly
+ */
+#define WO_DS_SHOW_TEXS (1 << 2)
#endif
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index 94caab26e29..a5a98386347 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -23,32 +23,32 @@
add_definitions(-DWITH_DNA_GHASH)
blender_include_dirs(
- ../../../../intern/guardedalloc
- ../../../../intern/atomic
- ../../blenlib
- ..
+ ../../../../intern/guardedalloc
+ ../../../../intern/atomic
+ ../../blenlib
+ ..
)
# -----------------------------------------------------------------------------
# Build makesdna executable
set(SRC
- dna_utils.c
- makesdna.c
- ../../blenlib/intern/BLI_ghash.c
- ../../blenlib/intern/BLI_ghash_utils.c
- ../../blenlib/intern/BLI_memarena.c
- ../../blenlib/intern/BLI_mempool.c
- ../../blenlib/intern/hash_mm2a.c # needed by 'BLI_ghash_utils.c', not used directly.
- ../../../../intern/guardedalloc/intern/mallocn.c
- ../../../../intern/guardedalloc/intern/mallocn_guarded_impl.c
- ../../../../intern/guardedalloc/intern/mallocn_lockfree_impl.c
+ dna_utils.c
+ makesdna.c
+ ../../blenlib/intern/BLI_ghash.c
+ ../../blenlib/intern/BLI_ghash_utils.c
+ ../../blenlib/intern/BLI_memarena.c
+ ../../blenlib/intern/BLI_mempool.c
+ ../../blenlib/intern/hash_mm2a.c # needed by 'BLI_ghash_utils.c', not used directly.
+ ../../../../intern/guardedalloc/intern/mallocn.c
+ ../../../../intern/guardedalloc/intern/mallocn_guarded_impl.c
+ ../../../../intern/guardedalloc/intern/mallocn_lockfree_impl.c
)
if(WIN32 AND NOT UNIX)
- list(APPEND SRC
- ../../../../intern/guardedalloc/intern/mmap_win.c
- )
+ list(APPEND SRC
+ ../../../../intern/guardedalloc/intern/mmap_win.c
+ )
endif()
# SRC_DNA_INC is defined in the parent dir
@@ -60,17 +60,17 @@ add_executable(makesdna ${SRC} ${SRC_DNA_INC})
# Output dna.c
add_custom_command(
- OUTPUT
- ${CMAKE_CURRENT_BINARY_DIR}/dna.c
- ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
- ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
- COMMAND
- "$<TARGET_FILE:makesdna>"
- ${CMAKE_CURRENT_BINARY_DIR}/dna.c
- ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
- ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
- ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
- DEPENDS makesdna
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/dna.c
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
+ COMMAND
+ "$<TARGET_FILE:makesdna>"
+ ${CMAKE_CURRENT_BINARY_DIR}/dna.c
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
+ ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
+ DEPENDS makesdna
)
@@ -85,23 +85,23 @@ set(INC_SYS
)
set(SRC
- dna_genfile.c
- dna_utils.c
- ${CMAKE_CURRENT_BINARY_DIR}/dna.c
- ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
- ${SRC_DNA_INC}
+ dna_genfile.c
+ dna_utils.c
+ ${CMAKE_CURRENT_BINARY_DIR}/dna.c
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
+ ${SRC_DNA_INC}
- dna_utils.h
+ dna_utils.h
)
set(LIB
)
set_source_files_properties(
- ${CMAKE_CURRENT_BINARY_DIR}/dna.c
- ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
- ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
- PROPERTIES GENERATED TRUE
+ ${CMAKE_CURRENT_BINARY_DIR}/dna.c
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
+ ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c
+ PROPERTIES GENERATED TRUE
)
blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
@@ -118,14 +118,14 @@ set(INC_SYS
)
set(SRC
- ../../blenlib/intern/BLI_ghash.c
- ../../blenlib/intern/BLI_ghash_utils.c
- ../../blenlib/intern/BLI_linklist.c
- ../../blenlib/intern/BLI_memarena.c
- ../../blenlib/intern/BLI_mempool.c
- ../../blenlib/intern/endian_switch.c
- ../../blenlib/intern/hash_mm2a.c
- ../../blenlib/intern/listbase.c
+ ../../blenlib/intern/BLI_ghash.c
+ ../../blenlib/intern/BLI_ghash_utils.c
+ ../../blenlib/intern/BLI_linklist.c
+ ../../blenlib/intern/BLI_memarena.c
+ ../../blenlib/intern/BLI_mempool.c
+ ../../blenlib/intern/endian_switch.c
+ ../../blenlib/intern/hash_mm2a.c
+ ../../blenlib/intern/listbase.c
)
set(LIB
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 863aebd86e8..e8af1cbf36e 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -27,13 +27,12 @@
* SDNA and the SDNA of the current (running) version of Blender.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
-#include "MEM_guardedalloc.h" // for MEM_freeN MEM_mallocN MEM_callocN
+#include "MEM_guardedalloc.h" // for MEM_freeN MEM_mallocN MEM_callocN
#include "BLI_utildefines.h"
#include "BLI_endian_switch.h"
@@ -45,7 +44,7 @@
#endif
#include "DNA_genfile.h"
-#include "DNA_sdna_types.h" // for SDNA ;-)
+#include "DNA_sdna_types.h" // for SDNA ;-)
/**
* \section dna_genfile Overview
@@ -128,7 +127,6 @@
* - the sdna functions have several error prints builtin, always check blender running from a console.
*/
-
#ifdef __BIG_ENDIAN__
/* Big Endian */
# define MAKE_ID(a, b, c, d) ((int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d))
@@ -141,29 +139,29 @@
void DNA_sdna_free(SDNA *sdna)
{
- if (sdna->data_alloc) {
- MEM_freeN((void *)sdna->data);
- }
+ if (sdna->data_alloc) {
+ MEM_freeN((void *)sdna->data);
+ }
- MEM_freeN((void *)sdna->names);
- MEM_freeN((void *)sdna->names_array_len);
- MEM_freeN((void *)sdna->types);
- MEM_freeN(sdna->structs);
+ MEM_freeN((void *)sdna->names);
+ MEM_freeN((void *)sdna->names_array_len);
+ MEM_freeN((void *)sdna->types);
+ MEM_freeN(sdna->structs);
#ifdef WITH_DNA_GHASH
- if (sdna->structs_map) {
- BLI_ghash_free(sdna->structs_map, NULL, NULL);
- }
+ if (sdna->structs_map) {
+ BLI_ghash_free(sdna->structs_map, NULL, NULL);
+ }
#endif
- if (sdna->mem_arena) {
- BLI_memarena_free(sdna->mem_arena);
- }
+ if (sdna->mem_arena) {
+ BLI_memarena_free(sdna->mem_arena);
+ }
- MEM_SAFE_FREE(sdna->alias.names);
- MEM_SAFE_FREE(sdna->alias.types);
+ MEM_SAFE_FREE(sdna->alias.names);
+ MEM_SAFE_FREE(sdna->alias.types);
- MEM_freeN(sdna);
+ MEM_freeN(sdna);
}
/**
@@ -171,8 +169,8 @@ void DNA_sdna_free(SDNA *sdna)
*/
static bool ispointer(const char *name)
{
- /* check if pointer or function pointer */
- return (name[0] == '*' || (name[0] == '(' && name[1] == '*'));
+ /* check if pointer or function pointer */
+ return (name[0] == '*' || (name[0] == '(' && name[1] == '*'));
}
/**
@@ -184,39 +182,39 @@ static bool ispointer(const char *name)
*/
static int elementsize(const SDNA *sdna, short type, short name)
{
- int len;
- const char *cp = sdna->names[name];
- len = 0;
-
- /* is it a pointer or function pointer? */
- if (ispointer(cp)) {
- /* has the name an extra length? (array) */
- len = sdna->pointer_size * sdna->names_array_len[name];
- }
- else if (sdna->types_size[type]) {
- /* has the name an extra length? (array) */
- len = (int)sdna->types_size[type] * sdna->names_array_len[name];
- }
-
- return len;
+ int len;
+ const char *cp = sdna->names[name];
+ len = 0;
+
+ /* is it a pointer or function pointer? */
+ if (ispointer(cp)) {
+ /* has the name an extra length? (array) */
+ len = sdna->pointer_size * sdna->names_array_len[name];
+ }
+ else if (sdna->types_size[type]) {
+ /* has the name an extra length? (array) */
+ len = (int)sdna->types_size[type] * sdna->names_array_len[name];
+ }
+
+ return len;
}
#if 0
static void printstruct(SDNA *sdna, short strnr)
{
- /* is for debug */
- int b, nr;
- short *sp;
+ /* is for debug */
+ int b, nr;
+ short *sp;
- sp = sdna->structs[strnr];
+ sp = sdna->structs[strnr];
- printf("struct %s\n", sdna->types[sp[0]]);
- nr = sp[1];
- sp += 2;
+ printf("struct %s\n", sdna->types[sp[0]]);
+ nr = sp[1];
+ sp += 2;
- for (b = 0; b < nr; b++, sp += 2) {
- printf(" %s %s\n", sdna->types[sp[0]], sdna->names[sp[1]]);
- }
+ for (b = 0; b < nr; b++, sp += 2) {
+ printf(" %s %s\n", sdna->types[sp[0]], sdna->names[sp[1]]);
+ }
}
#endif
@@ -225,53 +223,53 @@ static void printstruct(SDNA *sdna, short strnr)
*/
int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index_last)
{
- const short *sp = NULL;
+ const short *sp = NULL;
- if (*index_last < sdna->nr_structs) {
- sp = sdna->structs[*index_last];
- if (strcmp(sdna->types[sp[0]], str) == 0) {
- return *index_last;
- }
- }
+ if (*index_last < sdna->nr_structs) {
+ sp = sdna->structs[*index_last];
+ if (strcmp(sdna->types[sp[0]], str) == 0) {
+ return *index_last;
+ }
+ }
#ifdef WITH_DNA_GHASH
- {
- void **index_p;
- int a;
-
- index_p = BLI_ghash_lookup_p(sdna->structs_map, str);
-
- if (index_p) {
- a = POINTER_AS_INT(*index_p);
- *index_last = a;
- }
- else {
- a = -1;
- }
- return a;
- }
+ {
+ void **index_p;
+ int a;
+
+ index_p = BLI_ghash_lookup_p(sdna->structs_map, str);
+
+ if (index_p) {
+ a = POINTER_AS_INT(*index_p);
+ *index_last = a;
+ }
+ else {
+ a = -1;
+ }
+ return a;
+ }
#else
- {
- int a;
+ {
+ int a;
- for (a = 0; a < sdna->nr_structs; a++) {
+ for (a = 0; a < sdna->nr_structs; a++) {
- sp = sdna->structs[a];
+ sp = sdna->structs[a];
- if (strcmp(sdna->types[sp[0]], str) == 0) {
- *index_last = a;
- return a;
- }
- }
- }
- return -1;
+ if (strcmp(sdna->types[sp[0]], str) == 0) {
+ *index_last = a;
+ return a;
+ }
+ }
+ }
+ return -1;
#endif
}
int DNA_struct_find_nr(const SDNA *sdna, const char *str)
{
- unsigned int index_last_dummy = UINT_MAX;
- return DNA_struct_find_nr_ex(sdna, str, &index_last_dummy);
+ unsigned int index_last_dummy = UINT_MAX;
+ return DNA_struct_find_nr_ex(sdna, str, &index_last_dummy);
}
/* ************************* END DIV ********************** */
@@ -280,270 +278,268 @@ int DNA_struct_find_nr(const SDNA *sdna, const char *str)
BLI_INLINE const char *pad_up_4(const char *ptr)
{
- return (const char *)((((uintptr_t)ptr) + 3) & ~3);
+ return (const char *)((((uintptr_t)ptr) + 3) & ~3);
}
/**
* In sdna->data the data, now we convert that to something understandable
*/
-static bool init_structDNA(
- SDNA *sdna, bool do_endian_swap,
- const char **r_error_message)
+static bool init_structDNA(SDNA *sdna, bool do_endian_swap, const char **r_error_message)
{
- int *data, gravity_fix = -1;
- short *sp;
+ int *data, gravity_fix = -1;
+ short *sp;
- data = (int *)sdna->data;
+ data = (int *)sdna->data;
- /* clear pointers incase of error */
- sdna->names = NULL;
- sdna->types = NULL;
- sdna->structs = NULL;
+ /* clear pointers incase of error */
+ sdna->names = NULL;
+ sdna->types = NULL;
+ sdna->structs = NULL;
#ifdef WITH_DNA_GHASH
- sdna->structs_map = NULL;
+ sdna->structs_map = NULL;
#endif
- sdna->mem_arena = NULL;
-
- /* Lazy initialize. */
- memset(&sdna->alias, 0, sizeof(sdna->alias));
-
- /* Struct DNA ('SDNA') */
- if (*data != MAKE_ID('S', 'D', 'N', 'A')) {
- *r_error_message = "SDNA error in SDNA file";
- return false;
- }
- else {
- const char *cp;
-
- data++;
- /* Names array ('NAME') */
- if (*data == MAKE_ID('N', 'A', 'M', 'E')) {
- data++;
-
- sdna->nr_names = *data;
- if (do_endian_swap) {
- BLI_endian_switch_int32(&sdna->nr_names);
- }
- sdna->nr_names_alloc = sdna->nr_names;
-
- data++;
- sdna->names = MEM_callocN(sizeof(void *) * sdna->nr_names, "sdnanames");
- }
- else {
- *r_error_message = "NAME error in SDNA file";
- return false;
- }
-
- cp = (char *)data;
- for (int nr = 0; nr < sdna->nr_names; nr++) {
- sdna->names[nr] = cp;
-
- /* "float gravity [3]" was parsed wrong giving both "gravity" and
- * "[3]" members. we rename "[3]", and later set the type of
- * "gravity" to "void" so the offsets work out correct */
- if (*cp == '[' && strcmp(cp, "[3]") == 0) {
- if (nr && strcmp(sdna->names[nr - 1], "Cvi") == 0) {
- sdna->names[nr] = "gravity[3]";
- gravity_fix = nr;
- }
- }
- while (*cp) {
- cp++;
- }
- cp++;
- }
-
- cp = pad_up_4(cp);
-
- /* Type names array ('TYPE') */
- data = (int *)cp;
- if (*data == MAKE_ID('T', 'Y', 'P', 'E')) {
- data++;
-
- sdna->nr_types = *data;
- if (do_endian_swap) {
- BLI_endian_switch_int32(&sdna->nr_types);
- }
-
- data++;
- sdna->types = MEM_callocN(sizeof(void *) * sdna->nr_types, "sdnatypes");
- }
- else {
- *r_error_message = "TYPE error in SDNA file";
- return false;
- }
-
- cp = (char *)data;
- for (int nr = 0; nr < sdna->nr_types; nr++) {
- /* WARNING! See: DNA_struct_rename_legacy_hack_static_from_alias docs. */
- sdna->types[nr] = DNA_struct_rename_legacy_hack_static_from_alias(cp);
- while (*cp) {
- cp++;
- }
- cp++;
- }
-
- cp = pad_up_4(cp);
-
- /* Type lengths array ('TLEN') */
- data = (int *)cp;
- if (*data == MAKE_ID('T', 'L', 'E', 'N')) {
- data++;
- sp = (short *)data;
- sdna->types_size = sp;
-
- if (do_endian_swap) {
- BLI_endian_switch_int16_array(sp, sdna->nr_types);
- }
-
- sp += sdna->nr_types;
- }
- else {
- *r_error_message = "TLEN error in SDNA file";
- return false;
- }
- /* prevent BUS error */
- if (sdna->nr_types & 1) {
- sp++;
- }
-
- /* Struct array ('STRC') */
- data = (int *)sp;
- if (*data == MAKE_ID('S', 'T', 'R', 'C')) {
- data++;
-
- sdna->nr_structs = *data;
- if (do_endian_swap) {
- BLI_endian_switch_int32(&sdna->nr_structs);
- }
-
- data++;
- sdna->structs = MEM_callocN(sizeof(void *) * sdna->nr_structs, "sdnastrcs");
- }
- else {
- *r_error_message = "STRC error in SDNA file";
- return false;
- }
-
- sp = (short *)data;
- for (int nr = 0; nr < sdna->nr_structs; nr++) {
- sdna->structs[nr] = sp;
-
- if (do_endian_swap) {
- short a;
-
- BLI_endian_switch_int16(&sp[0]);
- BLI_endian_switch_int16(&sp[1]);
-
- a = sp[1];
- sp += 2;
- while (a--) {
- BLI_endian_switch_int16(&sp[0]);
- BLI_endian_switch_int16(&sp[1]);
- sp += 2;
- }
- }
- else {
- sp += 2 * sp[1] + 2;
- }
- }
- }
-
- {
- /* second part of gravity problem, setting "gravity" type to void */
- if (gravity_fix > -1) {
- for (int nr = 0; nr < sdna->nr_structs; nr++) {
- sp = sdna->structs[nr];
- if (strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0) {
- sp[10] = SDNA_TYPE_VOID;
- }
- }
- }
- }
+ sdna->mem_arena = NULL;
+
+ /* Lazy initialize. */
+ memset(&sdna->alias, 0, sizeof(sdna->alias));
+
+ /* Struct DNA ('SDNA') */
+ if (*data != MAKE_ID('S', 'D', 'N', 'A')) {
+ *r_error_message = "SDNA error in SDNA file";
+ return false;
+ }
+ else {
+ const char *cp;
+
+ data++;
+ /* Names array ('NAME') */
+ if (*data == MAKE_ID('N', 'A', 'M', 'E')) {
+ data++;
+
+ sdna->nr_names = *data;
+ if (do_endian_swap) {
+ BLI_endian_switch_int32(&sdna->nr_names);
+ }
+ sdna->nr_names_alloc = sdna->nr_names;
+
+ data++;
+ sdna->names = MEM_callocN(sizeof(void *) * sdna->nr_names, "sdnanames");
+ }
+ else {
+ *r_error_message = "NAME error in SDNA file";
+ return false;
+ }
+
+ cp = (char *)data;
+ for (int nr = 0; nr < sdna->nr_names; nr++) {
+ sdna->names[nr] = cp;
+
+ /* "float gravity [3]" was parsed wrong giving both "gravity" and
+ * "[3]" members. we rename "[3]", and later set the type of
+ * "gravity" to "void" so the offsets work out correct */
+ if (*cp == '[' && strcmp(cp, "[3]") == 0) {
+ if (nr && strcmp(sdna->names[nr - 1], "Cvi") == 0) {
+ sdna->names[nr] = "gravity[3]";
+ gravity_fix = nr;
+ }
+ }
+ while (*cp) {
+ cp++;
+ }
+ cp++;
+ }
+
+ cp = pad_up_4(cp);
+
+ /* Type names array ('TYPE') */
+ data = (int *)cp;
+ if (*data == MAKE_ID('T', 'Y', 'P', 'E')) {
+ data++;
+
+ sdna->nr_types = *data;
+ if (do_endian_swap) {
+ BLI_endian_switch_int32(&sdna->nr_types);
+ }
+
+ data++;
+ sdna->types = MEM_callocN(sizeof(void *) * sdna->nr_types, "sdnatypes");
+ }
+ else {
+ *r_error_message = "TYPE error in SDNA file";
+ return false;
+ }
+
+ cp = (char *)data;
+ for (int nr = 0; nr < sdna->nr_types; nr++) {
+ /* WARNING! See: DNA_struct_rename_legacy_hack_static_from_alias docs. */
+ sdna->types[nr] = DNA_struct_rename_legacy_hack_static_from_alias(cp);
+ while (*cp) {
+ cp++;
+ }
+ cp++;
+ }
+
+ cp = pad_up_4(cp);
+
+ /* Type lengths array ('TLEN') */
+ data = (int *)cp;
+ if (*data == MAKE_ID('T', 'L', 'E', 'N')) {
+ data++;
+ sp = (short *)data;
+ sdna->types_size = sp;
+
+ if (do_endian_swap) {
+ BLI_endian_switch_int16_array(sp, sdna->nr_types);
+ }
+
+ sp += sdna->nr_types;
+ }
+ else {
+ *r_error_message = "TLEN error in SDNA file";
+ return false;
+ }
+ /* prevent BUS error */
+ if (sdna->nr_types & 1) {
+ sp++;
+ }
+
+ /* Struct array ('STRC') */
+ data = (int *)sp;
+ if (*data == MAKE_ID('S', 'T', 'R', 'C')) {
+ data++;
+
+ sdna->nr_structs = *data;
+ if (do_endian_swap) {
+ BLI_endian_switch_int32(&sdna->nr_structs);
+ }
+
+ data++;
+ sdna->structs = MEM_callocN(sizeof(void *) * sdna->nr_structs, "sdnastrcs");
+ }
+ else {
+ *r_error_message = "STRC error in SDNA file";
+ return false;
+ }
+
+ sp = (short *)data;
+ for (int nr = 0; nr < sdna->nr_structs; nr++) {
+ sdna->structs[nr] = sp;
+
+ if (do_endian_swap) {
+ short a;
+
+ BLI_endian_switch_int16(&sp[0]);
+ BLI_endian_switch_int16(&sp[1]);
+
+ a = sp[1];
+ sp += 2;
+ while (a--) {
+ BLI_endian_switch_int16(&sp[0]);
+ BLI_endian_switch_int16(&sp[1]);
+ sp += 2;
+ }
+ }
+ else {
+ sp += 2 * sp[1] + 2;
+ }
+ }
+ }
+
+ {
+ /* second part of gravity problem, setting "gravity" type to void */
+ if (gravity_fix > -1) {
+ for (int nr = 0; nr < sdna->nr_structs; nr++) {
+ sp = sdna->structs[nr];
+ if (strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0) {
+ sp[10] = SDNA_TYPE_VOID;
+ }
+ }
+ }
+ }
#ifdef WITH_DNA_GHASH
- {
- /* create a ghash lookup to speed up */
- sdna->structs_map = BLI_ghash_str_new_ex("init_structDNA gh", sdna->nr_structs);
-
- for (intptr_t nr = 0; nr < sdna->nr_structs; nr++) {
- sp = sdna->structs[nr];
- BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], POINTER_FROM_INT(nr));
- }
- }
+ {
+ /* create a ghash lookup to speed up */
+ sdna->structs_map = BLI_ghash_str_new_ex("init_structDNA gh", sdna->nr_structs);
+
+ for (intptr_t nr = 0; nr < sdna->nr_structs; nr++) {
+ sp = sdna->structs[nr];
+ BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], POINTER_FROM_INT(nr));
+ }
+ }
#endif
- /* Calculate 'sdna->pointer_size' */
- {
- const int nr = DNA_struct_find_nr(sdna, "ListBase");
-
- /* should never happen, only with corrupt file for example */
- if (UNLIKELY(nr == -1)) {
- *r_error_message = "ListBase struct error! Not found.";
- return false;
- }
-
- /* finally pointer_size: use struct ListBase to test it, never change the size of it! */
- sp = sdna->structs[nr];
- /* weird; i have no memory of that... I think I used sizeof(void *) before... (ton) */
-
- sdna->pointer_size = sdna->types_size[sp[0]] / 2;
-
- if (sp[1] != 2 || (sdna->pointer_size != 4 && sdna->pointer_size != 8)) {
- *r_error_message = "ListBase struct error! Needs it to calculate pointerize.";
- /* well, at least sizeof(ListBase) is error proof! (ton) */
- return false;
- }
- }
-
- /* Cache name size. */
- {
- short *names_array_len = MEM_mallocN(sizeof(*names_array_len) * sdna->nr_names, __func__);
- for (int i = 0; i < sdna->nr_names; i++) {
- names_array_len[i] = DNA_elem_array_size(sdna->names[i]);
- }
- sdna->names_array_len = names_array_len;
- }
-
- return true;
+ /* Calculate 'sdna->pointer_size' */
+ {
+ const int nr = DNA_struct_find_nr(sdna, "ListBase");
+
+ /* should never happen, only with corrupt file for example */
+ if (UNLIKELY(nr == -1)) {
+ *r_error_message = "ListBase struct error! Not found.";
+ return false;
+ }
+
+ /* finally pointer_size: use struct ListBase to test it, never change the size of it! */
+ sp = sdna->structs[nr];
+ /* weird; i have no memory of that... I think I used sizeof(void *) before... (ton) */
+
+ sdna->pointer_size = sdna->types_size[sp[0]] / 2;
+
+ if (sp[1] != 2 || (sdna->pointer_size != 4 && sdna->pointer_size != 8)) {
+ *r_error_message = "ListBase struct error! Needs it to calculate pointerize.";
+ /* well, at least sizeof(ListBase) is error proof! (ton) */
+ return false;
+ }
+ }
+
+ /* Cache name size. */
+ {
+ short *names_array_len = MEM_mallocN(sizeof(*names_array_len) * sdna->nr_names, __func__);
+ for (int i = 0; i < sdna->nr_names; i++) {
+ names_array_len[i] = DNA_elem_array_size(sdna->names[i]);
+ }
+ sdna->names_array_len = names_array_len;
+ }
+
+ return true;
}
/**
* Constructs and returns a decoded SDNA structure from the given encoded SDNA data block.
*/
-SDNA *DNA_sdna_from_data(
- const void *data, const int data_len,
- bool do_endian_swap, bool data_alloc,
- const char **r_error_message)
+SDNA *DNA_sdna_from_data(const void *data,
+ const int data_len,
+ bool do_endian_swap,
+ bool data_alloc,
+ const char **r_error_message)
{
- SDNA *sdna = MEM_mallocN(sizeof(*sdna), "sdna");
- const char *error_message = NULL;
-
- sdna->data_len = data_len;
- if (data_alloc) {
- char *data_copy = MEM_mallocN(data_len, "sdna_data");
- memcpy(data_copy, data, data_len);
- sdna->data = data_copy;
- }
- else {
- sdna->data = data;
- }
- sdna->data_alloc = data_alloc;
-
-
- if (init_structDNA(sdna, do_endian_swap, &error_message)) {
- return sdna;
- }
- else {
- if (r_error_message == NULL) {
- fprintf(stderr, "Error decoding blend file SDNA: %s\n", error_message);
- }
- else {
- *r_error_message = error_message;
- }
- DNA_sdna_free(sdna);
- return NULL;
- }
+ SDNA *sdna = MEM_mallocN(sizeof(*sdna), "sdna");
+ const char *error_message = NULL;
+
+ sdna->data_len = data_len;
+ if (data_alloc) {
+ char *data_copy = MEM_mallocN(data_len, "sdna_data");
+ memcpy(data_copy, data, data_len);
+ sdna->data = data_copy;
+ }
+ else {
+ sdna->data = data;
+ }
+ sdna->data_alloc = data_alloc;
+
+ if (init_structDNA(sdna, do_endian_swap, &error_message)) {
+ return sdna;
+ }
+ else {
+ if (r_error_message == NULL) {
+ fprintf(stderr, "Error decoding blend file SDNA: %s\n", error_message);
+ }
+ else {
+ *r_error_message = error_message;
+ }
+ DNA_sdna_free(sdna);
+ return NULL;
+ }
}
/**
@@ -555,19 +551,19 @@ static SDNA *g_sdna = NULL;
void DNA_sdna_current_init(void)
{
- g_sdna = DNA_sdna_from_data(DNAstr, DNAlen, false, false, NULL);
+ g_sdna = DNA_sdna_from_data(DNAstr, DNAlen, false, false, NULL);
}
const struct SDNA *DNA_sdna_current_get(void)
{
- BLI_assert(g_sdna != NULL);
- return g_sdna;
+ BLI_assert(g_sdna != NULL);
+ return g_sdna;
}
void DNA_sdna_current_free(void)
{
- DNA_sdna_free(g_sdna);
- g_sdna = NULL;
+ DNA_sdna_free(g_sdna);
+ g_sdna = NULL;
}
/* ******************** END READ DNA ********************** */
@@ -580,138 +576,135 @@ void DNA_sdna_current_free(void)
*/
static void recurs_test_compflags(const SDNA *sdna, char *compflags, int structnr)
{
- int a, b, typenr, elems;
- const short *sp;
- const char *cp;
-
- /* check all structs, test if it's inside another struct */
- sp = sdna->structs[structnr];
- typenr = sp[0];
-
- for (a = 0; a < sdna->nr_structs; a++) {
- if ((a != structnr) && (compflags[a] == SDNA_CMP_EQUAL)) {
- sp = sdna->structs[a];
- elems = sp[1];
- sp += 2;
- for (b = 0; b < elems; b++, sp += 2) {
- if (sp[0] == typenr) {
- cp = sdna->names[sp[1]];
- if (!ispointer(cp)) {
- compflags[a] = SDNA_CMP_NOT_EQUAL;
- recurs_test_compflags(sdna, compflags, a);
- }
- }
- }
- }
- }
-
+ int a, b, typenr, elems;
+ const short *sp;
+ const char *cp;
+
+ /* check all structs, test if it's inside another struct */
+ sp = sdna->structs[structnr];
+ typenr = sp[0];
+
+ for (a = 0; a < sdna->nr_structs; a++) {
+ if ((a != structnr) && (compflags[a] == SDNA_CMP_EQUAL)) {
+ sp = sdna->structs[a];
+ elems = sp[1];
+ sp += 2;
+ for (b = 0; b < elems; b++, sp += 2) {
+ if (sp[0] == typenr) {
+ cp = sdna->names[sp[1]];
+ if (!ispointer(cp)) {
+ compflags[a] = SDNA_CMP_NOT_EQUAL;
+ recurs_test_compflags(sdna, compflags, a);
+ }
+ }
+ }
+ }
+ }
}
-
/**
* 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 SDNA *oldsdna, const SDNA *newsdna)
{
- int a, b;
- const short *sp_old, *sp_new;
- const char *str1, *str2;
- char *compflags;
-
- if (oldsdna->nr_structs == 0) {
- printf("error: file without SDNA\n");
- return NULL;
- }
-
- compflags = MEM_callocN(oldsdna->nr_structs, "compflags");
-
- /* we check all structs in 'oldsdna' and compare them with
- * the structs in 'newsdna'
- */
- unsigned int newsdna_index_last = 0;
-
- for (a = 0; a < oldsdna->nr_structs; a++) {
- sp_old = oldsdna->structs[a];
-
- /* search for type in cur */
- int sp_new_index = DNA_struct_find_nr_ex(newsdna, oldsdna->types[sp_old[0]], &newsdna_index_last);
-
- /* The next indices will almost always match */
- newsdna_index_last++;
-
- if (sp_new_index != -1) {
- sp_new = newsdna->structs[sp_new_index];
- /* initial assumption */
- compflags[a] = SDNA_CMP_NOT_EQUAL;
-
- /* compare length and amount of elems */
- if (sp_new[1] == sp_old[1]) {
- if (newsdna->types_size[sp_new[0]] == oldsdna->types_size[sp_old[0]]) {
-
- /* same length, same amount of elems, now per type and name */
- b = sp_old[1];
- sp_old += 2;
- sp_new += 2;
- while (b > 0) {
- str1 = newsdna->types[sp_new[0]];
- str2 = oldsdna->types[sp_old[0]];
- if (strcmp(str1, str2) != 0) {
- break;
- }
-
- str1 = newsdna->names[sp_new[1]];
- str2 = oldsdna->names[sp_old[1]];
- if (strcmp(str1, str2) != 0) {
- break;
- }
-
- /* same type and same name, now pointersize */
- if (ispointer(str1)) {
- if (oldsdna->pointer_size != newsdna->pointer_size) {
- break;
- }
- }
-
- b--;
- sp_old += 2;
- sp_new += 2;
- }
- if (b == 0) {
- /* no differences found */
- compflags[a] = SDNA_CMP_EQUAL;
- }
-
- }
- }
-
- }
- }
-
- /* first struct in util.h is struct Link, this is skipped in compflags (als # 0).
- * was a bug, and this way dirty patched! Solve this later....
- */
- compflags[0] = SDNA_CMP_EQUAL;
-
- /* Because structs can be inside structs, we recursively
- * set flags when a struct is altered
- */
- for (a = 0; a < oldsdna->nr_structs; a++) {
- if (compflags[a] == SDNA_CMP_NOT_EQUAL) {
- recurs_test_compflags(oldsdna, compflags, a);
- }
- }
+ int a, b;
+ const short *sp_old, *sp_new;
+ const char *str1, *str2;
+ char *compflags;
+
+ if (oldsdna->nr_structs == 0) {
+ printf("error: file without SDNA\n");
+ return NULL;
+ }
+
+ compflags = MEM_callocN(oldsdna->nr_structs, "compflags");
+
+ /* we check all structs in 'oldsdna' and compare them with
+ * the structs in 'newsdna'
+ */
+ unsigned int newsdna_index_last = 0;
+
+ for (a = 0; a < oldsdna->nr_structs; a++) {
+ sp_old = oldsdna->structs[a];
+
+ /* search for type in cur */
+ int sp_new_index = DNA_struct_find_nr_ex(
+ newsdna, oldsdna->types[sp_old[0]], &newsdna_index_last);
+
+ /* The next indices will almost always match */
+ newsdna_index_last++;
+
+ if (sp_new_index != -1) {
+ sp_new = newsdna->structs[sp_new_index];
+ /* initial assumption */
+ compflags[a] = SDNA_CMP_NOT_EQUAL;
+
+ /* compare length and amount of elems */
+ if (sp_new[1] == sp_old[1]) {
+ if (newsdna->types_size[sp_new[0]] == oldsdna->types_size[sp_old[0]]) {
+
+ /* same length, same amount of elems, now per type and name */
+ b = sp_old[1];
+ sp_old += 2;
+ sp_new += 2;
+ while (b > 0) {
+ str1 = newsdna->types[sp_new[0]];
+ str2 = oldsdna->types[sp_old[0]];
+ if (strcmp(str1, str2) != 0) {
+ break;
+ }
+
+ str1 = newsdna->names[sp_new[1]];
+ str2 = oldsdna->names[sp_old[1]];
+ if (strcmp(str1, str2) != 0) {
+ break;
+ }
+
+ /* same type and same name, now pointersize */
+ if (ispointer(str1)) {
+ if (oldsdna->pointer_size != newsdna->pointer_size) {
+ break;
+ }
+ }
+
+ b--;
+ sp_old += 2;
+ sp_new += 2;
+ }
+ if (b == 0) {
+ /* no differences found */
+ compflags[a] = SDNA_CMP_EQUAL;
+ }
+ }
+ }
+ }
+ }
+
+ /* first struct in util.h is struct Link, this is skipped in compflags (als # 0).
+ * was a bug, and this way dirty patched! Solve this later....
+ */
+ compflags[0] = SDNA_CMP_EQUAL;
+
+ /* Because structs can be inside structs, we recursively
+ * set flags when a struct is altered
+ */
+ for (a = 0; a < oldsdna->nr_structs; a++) {
+ if (compflags[a] == SDNA_CMP_NOT_EQUAL) {
+ recurs_test_compflags(oldsdna, compflags, a);
+ }
+ }
#if 0
- for (a = 0; a < oldsdna->nr_structs; a++) {
- if (compflags[a] == SDNA_CMP_NOT_EQUAL) {
- spold = oldsdna->structs[a];
- printf("changed: %s\n", oldsdna->types[spold[0]]);
- }
- }
+ for (a = 0; a < oldsdna->nr_structs; a++) {
+ if (compflags[a] == SDNA_CMP_NOT_EQUAL) {
+ spold = oldsdna->structs[a];
+ printf("changed: %s\n", oldsdna->types[spold[0]]);
+ }
+ }
#endif
- return compflags;
+ return compflags;
}
/**
@@ -719,17 +712,37 @@ const char *DNA_struct_get_compareflags(const SDNA *oldsdna, const SDNA *newsdna
*/
static eSDNA_Type sdna_type_nr(const char *dna_type)
{
- if (STR_ELEM(dna_type, "char", "const char")) { return SDNA_TYPE_CHAR; }
- else if (STR_ELEM(dna_type, "uchar", "unsigned char")) { return SDNA_TYPE_UCHAR; }
- else if (STR_ELEM(dna_type, "short")) { return SDNA_TYPE_SHORT; }
- else if (STR_ELEM(dna_type, "ushort", "unsigned short")) { return SDNA_TYPE_USHORT; }
- else if (STR_ELEM(dna_type, "int")) { return SDNA_TYPE_INT; }
- else if (STR_ELEM(dna_type, "float")) { return SDNA_TYPE_FLOAT; }
- else if (STR_ELEM(dna_type, "double")) { return SDNA_TYPE_DOUBLE; }
- else if (STR_ELEM(dna_type, "int64_t")) { return SDNA_TYPE_INT64; }
- else if (STR_ELEM(dna_type, "uint64_t")) { return SDNA_TYPE_UINT64; }
- /* invalid! */
- else { return -1; }
+ if (STR_ELEM(dna_type, "char", "const char")) {
+ return SDNA_TYPE_CHAR;
+ }
+ else if (STR_ELEM(dna_type, "uchar", "unsigned char")) {
+ return SDNA_TYPE_UCHAR;
+ }
+ else if (STR_ELEM(dna_type, "short")) {
+ return SDNA_TYPE_SHORT;
+ }
+ else if (STR_ELEM(dna_type, "ushort", "unsigned short")) {
+ return SDNA_TYPE_USHORT;
+ }
+ else if (STR_ELEM(dna_type, "int")) {
+ return SDNA_TYPE_INT;
+ }
+ else if (STR_ELEM(dna_type, "float")) {
+ return SDNA_TYPE_FLOAT;
+ }
+ else if (STR_ELEM(dna_type, "double")) {
+ return SDNA_TYPE_DOUBLE;
+ }
+ else if (STR_ELEM(dna_type, "int64_t")) {
+ return SDNA_TYPE_INT64;
+ }
+ else if (STR_ELEM(dna_type, "uint64_t")) {
+ return SDNA_TYPE_UINT64;
+ }
+ /* invalid! */
+ else {
+ return -1;
+ }
}
/**
@@ -744,77 +757,92 @@ static eSDNA_Type sdna_type_nr(const char *dna_type)
* \param olddata: Data of type otype to convert
*/
static void cast_elem(
- const char *ctype, const char *otype, int name_array_len,
- char *curdata, const char *olddata)
+ const char *ctype, const char *otype, int name_array_len, char *curdata, const char *olddata)
{
- double val = 0.0;
- int curlen = 1, oldlen = 1;
-
- eSDNA_Type ctypenr, otypenr;
-
- if ( (otypenr = sdna_type_nr(otype)) == -1 ||
- (ctypenr = sdna_type_nr(ctype)) == -1)
- {
- return;
- }
-
- /* define lengths */
- oldlen = DNA_elem_type_size(otypenr);
- curlen = DNA_elem_type_size(ctypenr);
-
- while (name_array_len > 0) {
- switch (otypenr) {
- case SDNA_TYPE_CHAR:
- val = *olddata; break;
- case SDNA_TYPE_UCHAR:
- val = *( (unsigned char *)olddata); break;
- case SDNA_TYPE_SHORT:
- val = *( (short *)olddata); break;
- case SDNA_TYPE_USHORT:
- val = *( (unsigned short *)olddata); break;
- case SDNA_TYPE_INT:
- val = *( (int *)olddata); break;
- case SDNA_TYPE_FLOAT:
- val = *( (float *)olddata); break;
- case SDNA_TYPE_DOUBLE:
- val = *( (double *)olddata); break;
- case SDNA_TYPE_INT64:
- val = *( (int64_t *)olddata); break;
- case SDNA_TYPE_UINT64:
- val = *( (uint64_t *)olddata); break;
- }
-
- switch (ctypenr) {
- case SDNA_TYPE_CHAR:
- *curdata = val; break;
- case SDNA_TYPE_UCHAR:
- *( (unsigned char *)curdata) = val; break;
- case SDNA_TYPE_SHORT:
- *( (short *)curdata) = val; break;
- case SDNA_TYPE_USHORT:
- *( (unsigned short *)curdata) = val; break;
- case SDNA_TYPE_INT:
- *( (int *)curdata) = val; break;
- case SDNA_TYPE_FLOAT:
- if (otypenr < 2) {
- val /= 255;
- }
- *( (float *)curdata) = val; break;
- case SDNA_TYPE_DOUBLE:
- if (otypenr < 2) {
- val /= 255;
- }
- *( (double *)curdata) = val; break;
- case SDNA_TYPE_INT64:
- *( (int64_t *)curdata) = val; break;
- case SDNA_TYPE_UINT64:
- *( (uint64_t *)curdata) = val; break;
- }
-
- olddata += oldlen;
- curdata += curlen;
- name_array_len--;
- }
+ double val = 0.0;
+ int curlen = 1, oldlen = 1;
+
+ eSDNA_Type ctypenr, otypenr;
+
+ if ((otypenr = sdna_type_nr(otype)) == -1 || (ctypenr = sdna_type_nr(ctype)) == -1) {
+ return;
+ }
+
+ /* define lengths */
+ oldlen = DNA_elem_type_size(otypenr);
+ curlen = DNA_elem_type_size(ctypenr);
+
+ while (name_array_len > 0) {
+ switch (otypenr) {
+ case SDNA_TYPE_CHAR:
+ val = *olddata;
+ break;
+ case SDNA_TYPE_UCHAR:
+ val = *((unsigned char *)olddata);
+ break;
+ case SDNA_TYPE_SHORT:
+ val = *((short *)olddata);
+ break;
+ case SDNA_TYPE_USHORT:
+ val = *((unsigned short *)olddata);
+ break;
+ case SDNA_TYPE_INT:
+ val = *((int *)olddata);
+ break;
+ case SDNA_TYPE_FLOAT:
+ val = *((float *)olddata);
+ break;
+ case SDNA_TYPE_DOUBLE:
+ val = *((double *)olddata);
+ break;
+ case SDNA_TYPE_INT64:
+ val = *((int64_t *)olddata);
+ break;
+ case SDNA_TYPE_UINT64:
+ val = *((uint64_t *)olddata);
+ break;
+ }
+
+ switch (ctypenr) {
+ case SDNA_TYPE_CHAR:
+ *curdata = val;
+ break;
+ case SDNA_TYPE_UCHAR:
+ *((unsigned char *)curdata) = val;
+ break;
+ case SDNA_TYPE_SHORT:
+ *((short *)curdata) = val;
+ break;
+ case SDNA_TYPE_USHORT:
+ *((unsigned short *)curdata) = val;
+ break;
+ case SDNA_TYPE_INT:
+ *((int *)curdata) = val;
+ break;
+ case SDNA_TYPE_FLOAT:
+ if (otypenr < 2) {
+ val /= 255;
+ }
+ *((float *)curdata) = val;
+ break;
+ case SDNA_TYPE_DOUBLE:
+ if (otypenr < 2) {
+ val /= 255;
+ }
+ *((double *)curdata) = val;
+ break;
+ case SDNA_TYPE_INT64:
+ *((int64_t *)curdata) = val;
+ break;
+ case SDNA_TYPE_UINT64:
+ *((uint64_t *)curdata) = val;
+ break;
+ }
+
+ olddata += oldlen;
+ curdata += curlen;
+ name_array_len--;
+ }
}
/**
@@ -828,36 +856,36 @@ static void cast_elem(
* \param curdata: Where to put converted data
* \param olddata: Data to convert
*/
-static void cast_pointer(int curlen, int oldlen, int name_array_len, char *curdata, const char *olddata)
+static void cast_pointer(
+ int curlen, int oldlen, int name_array_len, char *curdata, const char *olddata)
{
- int64_t lval;
-
- while (name_array_len > 0) {
-
- if (curlen == oldlen) {
- memcpy(curdata, olddata, curlen);
- }
- else if (curlen == 4 && oldlen == 8) {
- lval = *((int64_t *)olddata);
-
- /* WARNING: 32-bit Blender trying to load file saved by 64-bit Blender,
- * pointers may lose uniqueness on truncation! (Hopefully this wont
- * happen unless/until we ever get to multi-gigabyte .blend files...) */
- *((int *)curdata) = lval >> 3;
- }
- else if (curlen == 8 && oldlen == 4) {
- *((int64_t *)curdata) = *((int *)olddata);
- }
- else {
- /* for debug */
- printf("errpr: illegal pointersize!\n");
- }
-
- olddata += oldlen;
- curdata += curlen;
- name_array_len--;
-
- }
+ int64_t lval;
+
+ while (name_array_len > 0) {
+
+ if (curlen == oldlen) {
+ memcpy(curdata, olddata, curlen);
+ }
+ else if (curlen == 4 && oldlen == 8) {
+ lval = *((int64_t *)olddata);
+
+ /* WARNING: 32-bit Blender trying to load file saved by 64-bit Blender,
+ * pointers may lose uniqueness on truncation! (Hopefully this wont
+ * happen unless/until we ever get to multi-gigabyte .blend files...) */
+ *((int *)curdata) = lval >> 3;
+ }
+ else if (curlen == 8 && oldlen == 4) {
+ *((int64_t *)curdata) = *((int *)olddata);
+ }
+ else {
+ /* for debug */
+ printf("errpr: illegal pointersize!\n");
+ }
+
+ olddata += oldlen;
+ curdata += curlen;
+ name_array_len--;
+ }
}
/**
@@ -865,21 +893,21 @@ static void cast_pointer(int curlen, int oldlen, int name_array_len, char *curda
*/
static int elem_strcmp(const char *name, const char *oname)
{
- int a = 0;
-
- while (1) {
- if (name[a] != oname[a]) {
- return 1;
- }
- if (name[a] == '[' || oname[a] == '[') {
- break;
- }
- if (name[a] == 0 || oname[a] == 0) {
- break;
- }
- a++;
- }
- return 0;
+ int a = 0;
+
+ while (1) {
+ if (name[a] != oname[a]) {
+ return 1;
+ }
+ if (name[a] == '[' || oname[a] == '[') {
+ break;
+ }
+ if (name[a] == 0 || oname[a] == 0) {
+ break;
+ }
+ a++;
+ }
+ return 0;
}
/**
@@ -892,27 +920,23 @@ static int elem_strcmp(const char *name, const char *oname)
* \param old: Pointer to struct information in sdna
* \return true when existing, false otherwise.
*/
-static bool elem_exists(
- const SDNA *sdna,
- const char *type,
- const char *name,
- const short *old)
+static bool elem_exists(const SDNA *sdna, const char *type, const char *name, const short *old)
{
- int a, elemcount;
- const char *otype, *oname;
-
- /* in old is the old struct */
- elemcount = old[1];
- old += 2;
- for (a = 0; a < elemcount; a++, old += 2) {
- otype = sdna->types[old[0]];
- oname = sdna->names[old[1]];
-
- if (elem_strcmp(name, oname) == 0) { /* name equal */
- return strcmp(type, otype) == 0; /* type equal */
- }
- }
- return false;
+ int a, elemcount;
+ const char *otype, *oname;
+
+ /* in old is the old struct */
+ elemcount = old[1];
+ old += 2;
+ for (a = 0; a < elemcount; a++, old += 2) {
+ otype = sdna->types[old[0]];
+ oname = sdna->names[old[1]];
+
+ if (elem_strcmp(name, oname) == 0) { /* name equal */
+ return strcmp(type, otype) == 0; /* type equal */
+ }
+ }
+ return false;
}
/**
@@ -932,43 +956,42 @@ static bool elem_exists(
* \param sppo: Optional place to return pointer to field info in sdna
* \return Data address.
*/
-static const char *find_elem(
- const SDNA *sdna,
- const char *type,
- const char *name,
- const short *old,
- const char *olddata,
- const short **sppo)
+static const char *find_elem(const SDNA *sdna,
+ const char *type,
+ const char *name,
+ const short *old,
+ const char *olddata,
+ const short **sppo)
{
- int a, elemcount, len;
- const char *otype, *oname;
+ int a, elemcount, len;
+ const char *otype, *oname;
- /* without arraypart, so names can differ: return old namenr and type */
+ /* without arraypart, so names can differ: return old namenr and type */
- /* in old is the old struct */
- elemcount = old[1];
- old += 2;
- for (a = 0; a < elemcount; a++, old += 2) {
+ /* in old is the old struct */
+ elemcount = old[1];
+ old += 2;
+ for (a = 0; a < elemcount; a++, old += 2) {
- otype = sdna->types[old[0]];
- oname = sdna->names[old[1]];
+ otype = sdna->types[old[0]];
+ oname = sdna->names[old[1]];
- len = elementsize(sdna, old[0], old[1]);
+ len = elementsize(sdna, old[0], old[1]);
- if (elem_strcmp(name, oname) == 0) { /* name equal */
- if (strcmp(type, otype) == 0) { /* type equal */
- if (sppo) {
- *sppo = old;
- }
- return olddata;
- }
+ if (elem_strcmp(name, oname) == 0) { /* name equal */
+ if (strcmp(type, otype) == 0) { /* type equal */
+ if (sppo) {
+ *sppo = old;
+ }
+ return olddata;
+ }
- return NULL;
- }
+ return NULL;
+ }
- olddata += len;
- }
- return NULL;
+ olddata += len;
+ }
+ return NULL;
}
/**
@@ -983,100 +1006,97 @@ static const char *find_elem(
* \param old: pointer to struct info in oldsdna
* \param olddata: struct contents laid out according to oldsdna
*/
-static void reconstruct_elem(
- const SDNA *newsdna,
- const SDNA *oldsdna,
- const char *type,
- const int new_name_nr,
- char *curdata,
- const short *old,
- const char *olddata)
+static void reconstruct_elem(const SDNA *newsdna,
+ const SDNA *oldsdna,
+ const char *type,
+ const int new_name_nr,
+ char *curdata,
+ const short *old,
+ const char *olddata)
{
- /* rules: test for NAME:
- * - name equal:
- * - cast type
- * - name partially equal (array differs)
- * - type equal: memcpy
- * - types casten
- * (nzc 2-4-2001 I want the 'unsigned' bit to be parsed as well. Where
- * can I force this?)
- */
- int a, elemcount, len, countpos, mul;
- const char *otype, *oname, *cp;
-
- /* is 'name' an array? */
- const char *name = newsdna->names[new_name_nr];
- cp = name;
- countpos = 0;
- while (*cp && *cp != '[') {
- cp++; countpos++;
- }
- if (*cp != '[') {
- countpos = 0;
- }
-
- /* in old is the old struct */
- elemcount = old[1];
- old += 2;
- for (a = 0; a < elemcount; a++, old += 2) {
- const int old_name_nr = old[1];
- otype = oldsdna->types[old[0]];
- oname = oldsdna->names[old[1]];
- len = elementsize(oldsdna, old[0], old[1]);
-
- if (strcmp(name, oname) == 0) { /* name equal */
-
- if (ispointer(name)) { /* pointer of functionpointer afhandelen */
- cast_pointer(newsdna->pointer_size, oldsdna->pointer_size,
- newsdna->names_array_len[new_name_nr],
- curdata, olddata);
- }
- else if (strcmp(type, otype) == 0) { /* type equal */
- memcpy(curdata, olddata, len);
- }
- else {
- cast_elem(type, otype,
- newsdna->names_array_len[new_name_nr],
- curdata, olddata);
- }
-
- return;
- }
- else if (countpos != 0) { /* name is an array */
-
- if (oname[countpos] == '[' && strncmp(name, oname, countpos) == 0) { /* basis equal */
- const int new_name_array_len = newsdna->names_array_len[new_name_nr];
- const int old_name_array_len = oldsdna->names_array_len[old_name_nr];
- const int min_name_array_len = MIN2(new_name_array_len, old_name_array_len);
-
- if (ispointer(name)) { /* handle pointer or functionpointer */
- cast_pointer(newsdna->pointer_size, oldsdna->pointer_size,
- min_name_array_len,
- curdata, olddata);
- }
- else if (strcmp(type, otype) == 0) { /* type equal */
- /* size of single old array element */
- mul = len / old_name_array_len;
- /* smaller of sizes of old and new arrays */
- mul *= min_name_array_len;
-
- memcpy(curdata, olddata, mul);
-
- if (old_name_array_len > new_name_array_len && strcmp(type, "char") == 0) {
- /* string had to be truncated, ensure it's still null-terminated */
- curdata[mul - 1] = '\0';
- }
- }
- else {
- cast_elem(type, otype,
- min_name_array_len,
- curdata, olddata);
- }
- return;
- }
- }
- olddata += len;
- }
+ /* rules: test for NAME:
+ * - name equal:
+ * - cast type
+ * - name partially equal (array differs)
+ * - type equal: memcpy
+ * - types casten
+ * (nzc 2-4-2001 I want the 'unsigned' bit to be parsed as well. Where
+ * can I force this?)
+ */
+ int a, elemcount, len, countpos, mul;
+ const char *otype, *oname, *cp;
+
+ /* is 'name' an array? */
+ const char *name = newsdna->names[new_name_nr];
+ cp = name;
+ countpos = 0;
+ while (*cp && *cp != '[') {
+ cp++;
+ countpos++;
+ }
+ if (*cp != '[') {
+ countpos = 0;
+ }
+
+ /* in old is the old struct */
+ elemcount = old[1];
+ old += 2;
+ for (a = 0; a < elemcount; a++, old += 2) {
+ const int old_name_nr = old[1];
+ otype = oldsdna->types[old[0]];
+ oname = oldsdna->names[old[1]];
+ len = elementsize(oldsdna, old[0], old[1]);
+
+ if (strcmp(name, oname) == 0) { /* name equal */
+
+ if (ispointer(name)) { /* pointer of functionpointer afhandelen */
+ cast_pointer(newsdna->pointer_size,
+ oldsdna->pointer_size,
+ newsdna->names_array_len[new_name_nr],
+ curdata,
+ olddata);
+ }
+ else if (strcmp(type, otype) == 0) { /* type equal */
+ memcpy(curdata, olddata, len);
+ }
+ else {
+ cast_elem(type, otype, newsdna->names_array_len[new_name_nr], curdata, olddata);
+ }
+
+ return;
+ }
+ else if (countpos != 0) { /* name is an array */
+
+ if (oname[countpos] == '[' && strncmp(name, oname, countpos) == 0) { /* basis equal */
+ const int new_name_array_len = newsdna->names_array_len[new_name_nr];
+ const int old_name_array_len = oldsdna->names_array_len[old_name_nr];
+ const int min_name_array_len = MIN2(new_name_array_len, old_name_array_len);
+
+ if (ispointer(name)) { /* handle pointer or functionpointer */
+ cast_pointer(
+ newsdna->pointer_size, oldsdna->pointer_size, min_name_array_len, curdata, olddata);
+ }
+ else if (strcmp(type, otype) == 0) { /* type equal */
+ /* size of single old array element */
+ mul = len / old_name_array_len;
+ /* smaller of sizes of old and new arrays */
+ mul *= min_name_array_len;
+
+ memcpy(curdata, olddata, mul);
+
+ if (old_name_array_len > new_name_array_len && strcmp(type, "char") == 0) {
+ /* string had to be truncated, ensure it's still null-terminated */
+ curdata[mul - 1] = '\0';
+ }
+ }
+ else {
+ cast_elem(type, otype, min_name_array_len, curdata, olddata);
+ }
+ return;
+ }
+ }
+ olddata += len;
+ }
}
/**
@@ -1092,109 +1112,107 @@ static void reconstruct_elem(
* \param curSDNAnr: Index of current struct definition in newsdna
* \param cur: Where to put converted struct contents
*/
-static void reconstruct_struct(
- const SDNA *newsdna,
- const SDNA *oldsdna,
- const char *compflags,
-
- int oldSDNAnr,
- const char *data,
- int curSDNAnr,
- char *cur)
+static void reconstruct_struct(const SDNA *newsdna,
+ const SDNA *oldsdna,
+ const char *compflags,
+
+ int oldSDNAnr,
+ const char *data,
+ int curSDNAnr,
+ char *cur)
{
- /* Recursive!
- * Per element from cur_struct, read data from old_struct.
- * If element is a struct, call recursive.
- */
- int a, elemcount, elen, eleno, mul, mulo, firststructtypenr;
- const short *spo, *spc, *sppo;
- const char *type;
- const char *cpo;
- char *cpc;
- const char *name;
-
- unsigned int oldsdna_index_last = UINT_MAX;
- unsigned int cursdna_index_last = UINT_MAX;
-
-
- if (oldSDNAnr == -1) {
- return;
- }
- if (curSDNAnr == -1) {
- return;
- }
-
- if (compflags[oldSDNAnr] == SDNA_CMP_EQUAL) {
- /* if recursive: test for equal */
- spo = oldsdna->structs[oldSDNAnr];
- elen = oldsdna->types_size[spo[0]];
- memcpy(cur, data, elen);
-
- return;
- }
-
- firststructtypenr = *(newsdna->structs[0]);
-
- spo = oldsdna->structs[oldSDNAnr];
- spc = newsdna->structs[curSDNAnr];
-
- elemcount = spc[1];
-
- spc += 2;
- cpc = cur;
- for (a = 0; a < elemcount; a++, spc += 2) { /* convert each field */
- type = newsdna->types[spc[0]];
- name = newsdna->names[spc[1]];
-
- elen = elementsize(newsdna, spc[0], spc[1]);
-
- /* Skip pad bytes which must start with '_pad', see makesdna.c 'is_name_legal'.
- * for exact rules. Note that if we fail to skip a pad byte it's harmless,
- * this just avoids unnecessary reconstruction. */
- if (name[0] == '_' || (name[0] == '*' && name[1] == '_')) {
- cpc += elen;
- }
- else if (spc[0] >= firststructtypenr && !ispointer(name)) {
- /* struct field type */
-
- /* where does the old struct data start (and is there an old one?) */
- cpo = (char *)find_elem(oldsdna, type, name, spo, data, &sppo);
-
- if (cpo) {
- oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last);
- curSDNAnr = DNA_struct_find_nr_ex(newsdna, type, &cursdna_index_last);
-
- /* array! */
- mul = newsdna->names_array_len[spc[1]];
- mulo = oldsdna->names_array_len[sppo[1]];
-
- eleno = elementsize(oldsdna, sppo[0], sppo[1]);
-
- elen /= mul;
- eleno /= mulo;
-
- while (mul--) {
- reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc);
- cpo += eleno;
- cpc += elen;
-
- /* new struct array larger than old */
- mulo--;
- if (mulo <= 0) {
- break;
- }
- }
- }
- else {
- cpc += elen; /* skip field no longer present */
- }
- }
- else {
- /* non-struct field type */
- reconstruct_elem(newsdna, oldsdna, type, spc[1], cpc, spo, data);
- cpc += elen;
- }
- }
+ /* Recursive!
+ * Per element from cur_struct, read data from old_struct.
+ * If element is a struct, call recursive.
+ */
+ int a, elemcount, elen, eleno, mul, mulo, firststructtypenr;
+ const short *spo, *spc, *sppo;
+ const char *type;
+ const char *cpo;
+ char *cpc;
+ const char *name;
+
+ unsigned int oldsdna_index_last = UINT_MAX;
+ unsigned int cursdna_index_last = UINT_MAX;
+
+ if (oldSDNAnr == -1) {
+ return;
+ }
+ if (curSDNAnr == -1) {
+ return;
+ }
+
+ if (compflags[oldSDNAnr] == SDNA_CMP_EQUAL) {
+ /* if recursive: test for equal */
+ spo = oldsdna->structs[oldSDNAnr];
+ elen = oldsdna->types_size[spo[0]];
+ memcpy(cur, data, elen);
+
+ return;
+ }
+
+ firststructtypenr = *(newsdna->structs[0]);
+
+ spo = oldsdna->structs[oldSDNAnr];
+ spc = newsdna->structs[curSDNAnr];
+
+ elemcount = spc[1];
+
+ spc += 2;
+ cpc = cur;
+ for (a = 0; a < elemcount; a++, spc += 2) { /* convert each field */
+ type = newsdna->types[spc[0]];
+ name = newsdna->names[spc[1]];
+
+ elen = elementsize(newsdna, spc[0], spc[1]);
+
+ /* Skip pad bytes which must start with '_pad', see makesdna.c 'is_name_legal'.
+ * for exact rules. Note that if we fail to skip a pad byte it's harmless,
+ * this just avoids unnecessary reconstruction. */
+ if (name[0] == '_' || (name[0] == '*' && name[1] == '_')) {
+ cpc += elen;
+ }
+ else if (spc[0] >= firststructtypenr && !ispointer(name)) {
+ /* struct field type */
+
+ /* where does the old struct data start (and is there an old one?) */
+ cpo = (char *)find_elem(oldsdna, type, name, spo, data, &sppo);
+
+ if (cpo) {
+ oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last);
+ curSDNAnr = DNA_struct_find_nr_ex(newsdna, type, &cursdna_index_last);
+
+ /* array! */
+ mul = newsdna->names_array_len[spc[1]];
+ mulo = oldsdna->names_array_len[sppo[1]];
+
+ eleno = elementsize(oldsdna, sppo[0], sppo[1]);
+
+ elen /= mul;
+ eleno /= mulo;
+
+ while (mul--) {
+ reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc);
+ cpo += eleno;
+ cpc += elen;
+
+ /* new struct array larger than old */
+ mulo--;
+ if (mulo <= 0) {
+ break;
+ }
+ }
+ }
+ else {
+ cpc += elen; /* skip field no longer present */
+ }
+ }
+ else {
+ /* non-struct field type */
+ reconstruct_elem(newsdna, oldsdna, type, spc[1], cpc, spo, data);
+ cpc += elen;
+ }
+ }
}
/**
@@ -1206,88 +1224,88 @@ static void reconstruct_struct(
*/
void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data)
{
- /* Recursive!
- * If element is a struct, call recursive.
- */
- int a, mul, elemcount, elen, elena, firststructtypenr;
- const short *spo, *spc;
- char *cur;
- const char *type, *name;
- unsigned int oldsdna_index_last = UINT_MAX;
-
- if (oldSDNAnr == -1) {
- return;
- }
- firststructtypenr = *(oldsdna->structs[0]);
-
- spo = spc = oldsdna->structs[oldSDNAnr];
-
- elemcount = spo[1];
-
- spc += 2;
- cur = data;
-
- for (a = 0; a < elemcount; a++, spc += 2) {
- type = oldsdna->types[spc[0]];
- name = oldsdna->names[spc[1]];
- const int old_name_array_len = oldsdna->names_array_len[spc[1]];
-
- /* elementsize = including arraysize */
- elen = elementsize(oldsdna, spc[0], spc[1]);
-
- /* test: is type a struct? */
- if (spc[0] >= firststructtypenr && !ispointer(name)) {
- /* struct field type */
- /* where does the old data start (is there one?) */
- char *cpo = (char *)find_elem(oldsdna, type, name, spo, data, NULL);
- if (cpo) {
- oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last);
-
- mul = old_name_array_len;
- elena = elen / mul;
-
- while (mul--) {
- DNA_struct_switch_endian(oldsdna, oldSDNAnr, cpo);
- cpo += elena;
- }
- }
- }
- else {
- /* non-struct field type */
- if (ispointer(name)) {
- if (oldsdna->pointer_size == 8) {
- BLI_endian_switch_int64_array((int64_t *)cur, old_name_array_len);
- }
- }
- else {
- if (ELEM(spc[0], SDNA_TYPE_SHORT, SDNA_TYPE_USHORT)) {
-
- /* exception: variable called blocktype: derived from ID_ */
- bool skip = false;
- if (name[0] == 'b' && name[1] == 'l') {
- if (strcmp(name, "blocktype") == 0) {
- skip = true;
- }
- }
-
- if (skip == false) {
- BLI_endian_switch_int16_array((int16_t *)cur, old_name_array_len);
- }
- }
- else if (ELEM(spc[0], SDNA_TYPE_INT, SDNA_TYPE_FLOAT)) {
- /* note, intentionally ignore long/ulong here these could be 4 or 8 bits,
- * but turns out we only used for runtime vars and
- * only once for a struct type that's no longer used. */
-
- BLI_endian_switch_int32_array((int32_t *)cur, old_name_array_len);
- }
- else if (ELEM(spc[0], SDNA_TYPE_INT64, SDNA_TYPE_UINT64, SDNA_TYPE_DOUBLE)) {
- BLI_endian_switch_int64_array((int64_t *)cur, old_name_array_len);
- }
- }
- }
- cur += elen;
- }
+ /* Recursive!
+ * If element is a struct, call recursive.
+ */
+ int a, mul, elemcount, elen, elena, firststructtypenr;
+ const short *spo, *spc;
+ char *cur;
+ const char *type, *name;
+ unsigned int oldsdna_index_last = UINT_MAX;
+
+ if (oldSDNAnr == -1) {
+ return;
+ }
+ firststructtypenr = *(oldsdna->structs[0]);
+
+ spo = spc = oldsdna->structs[oldSDNAnr];
+
+ elemcount = spo[1];
+
+ spc += 2;
+ cur = data;
+
+ for (a = 0; a < elemcount; a++, spc += 2) {
+ type = oldsdna->types[spc[0]];
+ name = oldsdna->names[spc[1]];
+ const int old_name_array_len = oldsdna->names_array_len[spc[1]];
+
+ /* elementsize = including arraysize */
+ elen = elementsize(oldsdna, spc[0], spc[1]);
+
+ /* test: is type a struct? */
+ if (spc[0] >= firststructtypenr && !ispointer(name)) {
+ /* struct field type */
+ /* where does the old data start (is there one?) */
+ char *cpo = (char *)find_elem(oldsdna, type, name, spo, data, NULL);
+ if (cpo) {
+ oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last);
+
+ mul = old_name_array_len;
+ elena = elen / mul;
+
+ while (mul--) {
+ DNA_struct_switch_endian(oldsdna, oldSDNAnr, cpo);
+ cpo += elena;
+ }
+ }
+ }
+ else {
+ /* non-struct field type */
+ if (ispointer(name)) {
+ if (oldsdna->pointer_size == 8) {
+ BLI_endian_switch_int64_array((int64_t *)cur, old_name_array_len);
+ }
+ }
+ else {
+ if (ELEM(spc[0], SDNA_TYPE_SHORT, SDNA_TYPE_USHORT)) {
+
+ /* exception: variable called blocktype: derived from ID_ */
+ bool skip = false;
+ if (name[0] == 'b' && name[1] == 'l') {
+ if (strcmp(name, "blocktype") == 0) {
+ skip = true;
+ }
+ }
+
+ if (skip == false) {
+ BLI_endian_switch_int16_array((int16_t *)cur, old_name_array_len);
+ }
+ }
+ else if (ELEM(spc[0], SDNA_TYPE_INT, SDNA_TYPE_FLOAT)) {
+ /* note, intentionally ignore long/ulong here these could be 4 or 8 bits,
+ * but turns out we only used for runtime vars and
+ * only once for a struct type that's no longer used. */
+
+ BLI_endian_switch_int32_array((int32_t *)cur, old_name_array_len);
+ }
+ else if (ELEM(spc[0], SDNA_TYPE_INT64, SDNA_TYPE_UINT64, SDNA_TYPE_DOUBLE)) {
+ BLI_endian_switch_int64_array((int64_t *)cur, old_name_array_len);
+ }
+ }
+ }
+ cur += elen;
+ }
}
/**
@@ -1301,41 +1319,44 @@ void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data)
* \param data: Array of struct data
* \return An allocated reconstructed struct
*/
-void *DNA_struct_reconstruct(
- const SDNA *newsdna, const SDNA *oldsdna,
- const char *compflags, int oldSDNAnr, int blocks, const void *data)
+void *DNA_struct_reconstruct(const SDNA *newsdna,
+ const SDNA *oldsdna,
+ const char *compflags,
+ int oldSDNAnr,
+ int blocks,
+ const void *data)
{
- int a, curSDNAnr, curlen = 0, oldlen;
- const short *spo, *spc;
- char *cur, *cpc;
- const char *cpo;
- const char *type;
-
- /* oldSDNAnr == structnr, we're looking for the corresponding 'cur' number */
- spo = oldsdna->structs[oldSDNAnr];
- type = oldsdna->types[spo[0]];
- oldlen = oldsdna->types_size[spo[0]];
- curSDNAnr = DNA_struct_find_nr(newsdna, type);
-
- /* init data and alloc */
- if (curSDNAnr != -1) {
- spc = newsdna->structs[curSDNAnr];
- curlen = newsdna->types_size[spc[0]];
- }
- if (curlen == 0) {
- return NULL;
- }
-
- cur = MEM_callocN(blocks * curlen, "reconstruct");
- cpc = cur;
- cpo = data;
- for (a = 0; a < blocks; a++) {
- reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc);
- cpc += curlen;
- cpo += oldlen;
- }
-
- return cur;
+ int a, curSDNAnr, curlen = 0, oldlen;
+ const short *spo, *spc;
+ char *cur, *cpc;
+ const char *cpo;
+ const char *type;
+
+ /* oldSDNAnr == structnr, we're looking for the corresponding 'cur' number */
+ spo = oldsdna->structs[oldSDNAnr];
+ type = oldsdna->types[spo[0]];
+ oldlen = oldsdna->types_size[spo[0]];
+ curSDNAnr = DNA_struct_find_nr(newsdna, type);
+
+ /* init data and alloc */
+ if (curSDNAnr != -1) {
+ spc = newsdna->structs[curSDNAnr];
+ curlen = newsdna->types_size[spc[0]];
+ }
+ if (curlen == 0) {
+ return NULL;
+ }
+
+ cur = MEM_callocN(blocks * curlen, "reconstruct");
+ cpc = cur;
+ cpo = data;
+ for (a = 0; a < blocks; a++) {
+ reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc);
+ cpc += curlen;
+ cpo += oldlen;
+ }
+
+ return cur;
}
/**
@@ -1344,149 +1365,156 @@ void *DNA_struct_reconstruct(
*/
int DNA_elem_offset(SDNA *sdna, const char *stype, const char *vartype, const char *name)
{
- const int SDNAnr = DNA_struct_find_nr(sdna, stype);
- const short * const spo = sdna->structs[SDNAnr];
- const char * const cp = find_elem(sdna, vartype, name, spo, NULL, NULL);
- BLI_assert(SDNAnr != -1);
- return (int)((intptr_t)cp);
+ const int SDNAnr = DNA_struct_find_nr(sdna, stype);
+ const short *const spo = sdna->structs[SDNAnr];
+ const char *const cp = find_elem(sdna, vartype, name, spo, NULL, NULL);
+ BLI_assert(SDNAnr != -1);
+ return (int)((intptr_t)cp);
}
bool DNA_struct_find(const SDNA *sdna, const char *stype)
{
- return DNA_struct_find_nr(sdna, stype) != -1;
+ return DNA_struct_find_nr(sdna, stype) != -1;
}
-bool DNA_struct_elem_find(const SDNA *sdna, const char *stype, const char *vartype, const char *name)
+bool DNA_struct_elem_find(const SDNA *sdna,
+ const char *stype,
+ const char *vartype,
+ const char *name)
{
- const int SDNAnr = DNA_struct_find_nr(sdna, stype);
+ const int SDNAnr = DNA_struct_find_nr(sdna, stype);
- if (SDNAnr != -1) {
- const short * const spo = sdna->structs[SDNAnr];
- const bool found = elem_exists(sdna, vartype, name, spo);
+ if (SDNAnr != -1) {
+ const short *const spo = sdna->structs[SDNAnr];
+ const bool found = elem_exists(sdna, vartype, name, spo);
- if (found) {
- return true;
- }
- }
- return false;
+ if (found) {
+ return true;
+ }
+ }
+ return false;
}
-
/**
* Returns the size in bytes of a primitive type.
*/
int DNA_elem_type_size(const eSDNA_Type elem_nr)
{
- /* should contain all enum types */
- switch (elem_nr) {
- case SDNA_TYPE_CHAR:
- case SDNA_TYPE_UCHAR:
- return 1;
- case SDNA_TYPE_SHORT:
- case SDNA_TYPE_USHORT:
- return 2;
- case SDNA_TYPE_INT:
- case SDNA_TYPE_FLOAT:
- return 4;
- case SDNA_TYPE_DOUBLE:
- case SDNA_TYPE_INT64:
- case SDNA_TYPE_UINT64:
- return 8;
- }
-
- /* weak */
- return 8;
+ /* should contain all enum types */
+ switch (elem_nr) {
+ case SDNA_TYPE_CHAR:
+ case SDNA_TYPE_UCHAR:
+ return 1;
+ case SDNA_TYPE_SHORT:
+ case SDNA_TYPE_USHORT:
+ return 2;
+ case SDNA_TYPE_INT:
+ case SDNA_TYPE_FLOAT:
+ return 4;
+ case SDNA_TYPE_DOUBLE:
+ case SDNA_TYPE_INT64:
+ case SDNA_TYPE_UINT64:
+ return 8;
+ }
+
+ /* weak */
+ return 8;
}
/* -------------------------------------------------------------------- */
/** \name Version Patch DNA
* \{ */
-static bool DNA_sdna_patch_struct_nr(
- SDNA *sdna, const int struct_name_old_nr, const char *struct_name_new)
+static bool DNA_sdna_patch_struct_nr(SDNA *sdna,
+ const int struct_name_old_nr,
+ const char *struct_name_new)
{
- BLI_assert(DNA_struct_find_nr(DNA_sdna_current_get(), struct_name_new) != -1);
- const short *sp = sdna->structs[struct_name_old_nr];
+ BLI_assert(DNA_struct_find_nr(DNA_sdna_current_get(), struct_name_new) != -1);
+ const short *sp = sdna->structs[struct_name_old_nr];
#ifdef WITH_DNA_GHASH
- BLI_ghash_remove(sdna->structs_map, (void *)sdna->types[sp[0]], NULL, NULL);
- BLI_ghash_insert(sdna->structs_map, (void *)struct_name_new, POINTER_FROM_INT(struct_name_old_nr));
+ BLI_ghash_remove(sdna->structs_map, (void *)sdna->types[sp[0]], NULL, NULL);
+ BLI_ghash_insert(
+ sdna->structs_map, (void *)struct_name_new, POINTER_FROM_INT(struct_name_old_nr));
#endif
- sdna->types[sp[0]] = struct_name_new;
- return true;
+ sdna->types[sp[0]] = struct_name_new;
+ return true;
}
/**
* Rename a struct
*/
-bool DNA_sdna_patch_struct(
- SDNA *sdna, const char *struct_name_old, const char *struct_name_new)
+bool DNA_sdna_patch_struct(SDNA *sdna, const char *struct_name_old, const char *struct_name_new)
{
- const int struct_name_old_nr = DNA_struct_find_nr(sdna, struct_name_old);
- if (struct_name_old_nr != -1) {
- return DNA_sdna_patch_struct_nr(sdna, struct_name_old_nr, struct_name_new);
- }
- return false;
+ const int struct_name_old_nr = DNA_struct_find_nr(sdna, struct_name_old);
+ if (struct_name_old_nr != -1) {
+ return DNA_sdna_patch_struct_nr(sdna, struct_name_old_nr, struct_name_new);
+ }
+ return false;
}
/* Make public if called often with same struct (avoid duplicate look-ups). */
-static bool DNA_sdna_patch_struct_member_nr(
- SDNA *sdna, const int struct_name_nr, const char *elem_old, const char *elem_new)
+static bool DNA_sdna_patch_struct_member_nr(SDNA *sdna,
+ const int struct_name_nr,
+ const char *elem_old,
+ const char *elem_new)
{
- /* These names aren't handled here (it's not used).
- * Ensure they are never used or we get out of sync arrays. */
- BLI_assert(sdna->alias.names == NULL);
- const int elem_old_len = strlen(elem_old);
- const int elem_new_len = strlen(elem_new);
- BLI_assert(elem_new != NULL);
- short *sp = sdna->structs[struct_name_nr];
- for (int elem_index = sp[1]; elem_index > 0; elem_index--, sp += 2) {
- const char *elem_old_full = sdna->names[sp[1]];
- /* Start & end offsets in 'elem_old_full'. */
- uint elem_old_full_offset_start;
- if (DNA_elem_id_match(elem_old, elem_old_len, elem_old_full, &elem_old_full_offset_start)) {
- if (sdna->mem_arena == NULL) {
- sdna->mem_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
- }
- const char *elem_new_full = DNA_elem_id_rename(
- sdna->mem_arena,
- elem_old, elem_old_len,
- elem_new, elem_new_len,
- elem_old_full, strlen(elem_old_full),
- elem_old_full_offset_start);
-
- if (sdna->nr_names == sdna->nr_names_alloc) {
- sdna->nr_names_alloc += 64;
- sdna->names = MEM_recallocN(
- sdna->names, sizeof(*sdna->names) * sdna->nr_names_alloc);
- sdna->names_array_len = MEM_recallocN(
- (void *)sdna->names_array_len, sizeof(*sdna->names_array_len) * sdna->nr_names_alloc);
- }
- const short name_nr_prev = sp[1];
- sp[1] = sdna->nr_names++;
- sdna->names[sp[1]] = elem_new_full;
- sdna->names_array_len[sp[1]] = sdna->names_array_len[name_nr_prev];
-
- return true;
- }
- }
- return false;
+ /* These names aren't handled here (it's not used).
+ * Ensure they are never used or we get out of sync arrays. */
+ BLI_assert(sdna->alias.names == NULL);
+ const int elem_old_len = strlen(elem_old);
+ const int elem_new_len = strlen(elem_new);
+ BLI_assert(elem_new != NULL);
+ short *sp = sdna->structs[struct_name_nr];
+ for (int elem_index = sp[1]; elem_index > 0; elem_index--, sp += 2) {
+ const char *elem_old_full = sdna->names[sp[1]];
+ /* Start & end offsets in 'elem_old_full'. */
+ uint elem_old_full_offset_start;
+ if (DNA_elem_id_match(elem_old, elem_old_len, elem_old_full, &elem_old_full_offset_start)) {
+ if (sdna->mem_arena == NULL) {
+ sdna->mem_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
+ }
+ const char *elem_new_full = DNA_elem_id_rename(sdna->mem_arena,
+ elem_old,
+ elem_old_len,
+ elem_new,
+ elem_new_len,
+ elem_old_full,
+ strlen(elem_old_full),
+ elem_old_full_offset_start);
+
+ if (sdna->nr_names == sdna->nr_names_alloc) {
+ sdna->nr_names_alloc += 64;
+ sdna->names = MEM_recallocN(sdna->names, sizeof(*sdna->names) * sdna->nr_names_alloc);
+ sdna->names_array_len = MEM_recallocN(
+ (void *)sdna->names_array_len, sizeof(*sdna->names_array_len) * sdna->nr_names_alloc);
+ }
+ const short name_nr_prev = sp[1];
+ sp[1] = sdna->nr_names++;
+ sdna->names[sp[1]] = elem_new_full;
+ sdna->names_array_len[sp[1]] = sdna->names_array_len[name_nr_prev];
+
+ return true;
+ }
+ }
+ return false;
}
/**
* Replace \a elem_old with \a elem_new for struct \a struct_name
* handles search & replace, maintaining surrounding non-identifier characters such as pointer & array size.
*/
-bool DNA_sdna_patch_struct_member(
- SDNA *sdna, const char *struct_name, const char *elem_old, const char *elem_new)
+bool DNA_sdna_patch_struct_member(SDNA *sdna,
+ const char *struct_name,
+ const char *elem_old,
+ const char *elem_new)
{
- const int struct_name_nr = DNA_struct_find_nr(sdna, struct_name);
- if (struct_name_nr != -1) {
- return DNA_sdna_patch_struct_member_nr(sdna, struct_name_nr, elem_old, elem_new);
- }
- return false;
+ const int struct_name_nr = DNA_struct_find_nr(sdna, struct_name);
+ if (struct_name_nr != -1) {
+ return DNA_sdna_patch_struct_member_nr(sdna, struct_name_nr, elem_old, elem_new);
+ }
+ return false;
}
/** \} */
-
/* -------------------------------------------------------------------- */
/** \name Versioning (Forward Compatible)
*
@@ -1501,114 +1529,114 @@ bool DNA_sdna_patch_struct_member(
*/
static void sdna_expand_names(SDNA *sdna)
{
- int names_expand_len = 0;
- for (int struct_nr = 0; struct_nr < sdna->nr_structs; struct_nr++) {
- const short *sp = sdna->structs[struct_nr];
- names_expand_len += sp[1];
- }
- const char **names_expand = MEM_mallocN(sizeof(*names_expand) * names_expand_len, __func__);
-
- int names_expand_index = 0;
- for (int struct_nr = 0; struct_nr < sdna->nr_structs; struct_nr++) {
- /* We can't edit this memory 'sdna->structs' points to (readonly datatoc file). */
- const short *sp = sdna->structs[struct_nr];
- short *sp_expand = BLI_memarena_alloc(sdna->mem_arena, sizeof(short[2]) * (1 + sp[1]));
- memcpy(sp_expand, sp, sizeof(short[2]) * (1 + sp[1]));
- sdna->structs[struct_nr] = sp_expand;
- const int names_len = sp[1];
- sp += 2;
- sp_expand += 2;
- for (int i = 0; i < names_len; i++, sp += 2, sp_expand += 2) {
- names_expand[names_expand_index] = sdna->names[sp[1]];
- BLI_assert(names_expand_index < SHRT_MAX);
- sp_expand[1] = names_expand_index;
- names_expand_index++;
- }
- }
- MEM_freeN((void *)sdna->names);
- sdna->names = names_expand;
- sdna->nr_names = names_expand_len;
+ int names_expand_len = 0;
+ for (int struct_nr = 0; struct_nr < sdna->nr_structs; struct_nr++) {
+ const short *sp = sdna->structs[struct_nr];
+ names_expand_len += sp[1];
+ }
+ const char **names_expand = MEM_mallocN(sizeof(*names_expand) * names_expand_len, __func__);
+
+ int names_expand_index = 0;
+ for (int struct_nr = 0; struct_nr < sdna->nr_structs; struct_nr++) {
+ /* We can't edit this memory 'sdna->structs' points to (readonly datatoc file). */
+ const short *sp = sdna->structs[struct_nr];
+ short *sp_expand = BLI_memarena_alloc(sdna->mem_arena, sizeof(short[2]) * (1 + sp[1]));
+ memcpy(sp_expand, sp, sizeof(short[2]) * (1 + sp[1]));
+ sdna->structs[struct_nr] = sp_expand;
+ const int names_len = sp[1];
+ sp += 2;
+ sp_expand += 2;
+ for (int i = 0; i < names_len; i++, sp += 2, sp_expand += 2) {
+ names_expand[names_expand_index] = sdna->names[sp[1]];
+ BLI_assert(names_expand_index < SHRT_MAX);
+ sp_expand[1] = names_expand_index;
+ names_expand_index++;
+ }
+ }
+ MEM_freeN((void *)sdna->names);
+ sdna->names = names_expand;
+ sdna->nr_names = names_expand_len;
}
-static const char *dna_sdna_alias_alias_from_static_elem_full(
- SDNA *sdna, GHash *elem_map_alias_from_static,
- const char *struct_name_static, const char *elem_static_full)
+static const char *dna_sdna_alias_alias_from_static_elem_full(SDNA *sdna,
+ GHash *elem_map_alias_from_static,
+ const char *struct_name_static,
+ const char *elem_static_full)
{
- const int elem_static_full_len = strlen(elem_static_full);
- char *elem_static = alloca(elem_static_full_len + 1);
- const int elem_static_len = DNA_elem_id_strip_copy(elem_static, elem_static_full);
- const char *str_pair[2] = {struct_name_static, elem_static};
- const char *elem_alias = BLI_ghash_lookup(elem_map_alias_from_static, str_pair);
- if (elem_alias) {
- return DNA_elem_id_rename(
- sdna->mem_arena,
- elem_static, elem_static_len,
- elem_alias, strlen(elem_alias),
- elem_static_full, elem_static_full_len,
- DNA_elem_id_offset_start(elem_static_full));
- }
- return NULL;
+ const int elem_static_full_len = strlen(elem_static_full);
+ char *elem_static = alloca(elem_static_full_len + 1);
+ const int elem_static_len = DNA_elem_id_strip_copy(elem_static, elem_static_full);
+ const char *str_pair[2] = {struct_name_static, elem_static};
+ const char *elem_alias = BLI_ghash_lookup(elem_map_alias_from_static, str_pair);
+ if (elem_alias) {
+ return DNA_elem_id_rename(sdna->mem_arena,
+ elem_static,
+ elem_static_len,
+ elem_alias,
+ strlen(elem_alias),
+ elem_static_full,
+ elem_static_full_len,
+ DNA_elem_id_offset_start(elem_static_full));
+ }
+ return NULL;
}
void DNA_sdna_alias_data_ensure(SDNA *sdna)
{
- /* We may want this to be optional later. */
- const bool use_legacy_hack = true;
-
- if (sdna->mem_arena == NULL) {
- sdna->mem_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
- }
-
- GHash *struct_map_alias_from_static;
- GHash *elem_map_alias_from_static;
-
- DNA_alias_maps(
- DNA_RENAME_ALIAS_FROM_STATIC,
- &struct_map_alias_from_static,
- &elem_map_alias_from_static);
-
-
- if (sdna->alias.types == NULL) {
- sdna->alias.types = MEM_mallocN(sizeof(*sdna->alias.types) * sdna->nr_types, __func__);
- for (int type_nr = 0; type_nr < sdna->nr_types; type_nr++) {
- const char *struct_name_static = sdna->types[type_nr];
-
- if (use_legacy_hack) {
- struct_name_static = DNA_struct_rename_legacy_hack_alias_from_static(struct_name_static);
- }
-
- sdna->alias.types[type_nr] = BLI_ghash_lookup_default(
- struct_map_alias_from_static, struct_name_static, (void *)struct_name_static);
- }
- }
-
- if (sdna->alias.names == NULL) {
- sdna_expand_names(sdna);
- sdna->alias.names = MEM_mallocN(sizeof(*sdna->alias.names) * sdna->nr_names, __func__);
- for (int struct_nr = 0; struct_nr < sdna->nr_structs; struct_nr++) {
- const short *sp = sdna->structs[struct_nr];
- const char *struct_name_static = sdna->types[sp[0]];
-
- if (use_legacy_hack) {
- struct_name_static = DNA_struct_rename_legacy_hack_alias_from_static(struct_name_static);
- }
-
- const int dna_struct_names_len = sp[1];
- sp += 2;
- for (int a = 0; a < dna_struct_names_len; a++, sp += 2) {
- const char *elem_alias_full = dna_sdna_alias_alias_from_static_elem_full(
- sdna, elem_map_alias_from_static, struct_name_static, sdna->names[sp[1]]);
- if (elem_alias_full != NULL) {
- sdna->alias.names[sp[1]] = elem_alias_full;
- }
- else {
- sdna->alias.names[sp[1]] = sdna->names[sp[1]];
- }
- }
- }
- }
- BLI_ghash_free(struct_map_alias_from_static, NULL, NULL);
- BLI_ghash_free(elem_map_alias_from_static, MEM_freeN, NULL);
+ /* We may want this to be optional later. */
+ const bool use_legacy_hack = true;
+
+ if (sdna->mem_arena == NULL) {
+ sdna->mem_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
+ }
+
+ GHash *struct_map_alias_from_static;
+ GHash *elem_map_alias_from_static;
+
+ DNA_alias_maps(
+ DNA_RENAME_ALIAS_FROM_STATIC, &struct_map_alias_from_static, &elem_map_alias_from_static);
+
+ if (sdna->alias.types == NULL) {
+ sdna->alias.types = MEM_mallocN(sizeof(*sdna->alias.types) * sdna->nr_types, __func__);
+ for (int type_nr = 0; type_nr < sdna->nr_types; type_nr++) {
+ const char *struct_name_static = sdna->types[type_nr];
+
+ if (use_legacy_hack) {
+ struct_name_static = DNA_struct_rename_legacy_hack_alias_from_static(struct_name_static);
+ }
+
+ sdna->alias.types[type_nr] = BLI_ghash_lookup_default(
+ struct_map_alias_from_static, struct_name_static, (void *)struct_name_static);
+ }
+ }
+
+ if (sdna->alias.names == NULL) {
+ sdna_expand_names(sdna);
+ sdna->alias.names = MEM_mallocN(sizeof(*sdna->alias.names) * sdna->nr_names, __func__);
+ for (int struct_nr = 0; struct_nr < sdna->nr_structs; struct_nr++) {
+ const short *sp = sdna->structs[struct_nr];
+ const char *struct_name_static = sdna->types[sp[0]];
+
+ if (use_legacy_hack) {
+ struct_name_static = DNA_struct_rename_legacy_hack_alias_from_static(struct_name_static);
+ }
+
+ const int dna_struct_names_len = sp[1];
+ sp += 2;
+ for (int a = 0; a < dna_struct_names_len; a++, sp += 2) {
+ const char *elem_alias_full = dna_sdna_alias_alias_from_static_elem_full(
+ sdna, elem_map_alias_from_static, struct_name_static, sdna->names[sp[1]]);
+ if (elem_alias_full != NULL) {
+ sdna->alias.names[sp[1]] = elem_alias_full;
+ }
+ else {
+ sdna->alias.names[sp[1]] = sdna->names[sp[1]];
+ }
+ }
+ }
+ }
+ BLI_ghash_free(struct_map_alias_from_static, NULL, NULL);
+ BLI_ghash_free(elem_map_alias_from_static, MEM_freeN, NULL);
}
/** \} */
diff --git a/source/blender/makesdna/intern/dna_utils.c b/source/blender/makesdna/intern/dna_utils.c
index 30c82367a37..425deaf121f 100644
--- a/source/blender/makesdna/intern/dna_utils.c
+++ b/source/blender/makesdna/intern/dna_utils.c
@@ -45,35 +45,35 @@
*/
int DNA_elem_array_size(const char *str)
{
- int result = 1;
- int current = 0;
- while (true) {
- char c = *str++;
- switch (c) {
- case '\0':
- return result;
- case '[':
- current = 0;
- break;
- case ']':
- result *= current;
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- current = current * 10 + (c - '0');
- break;
- default:
- break;
- }
- }
+ int result = 1;
+ int current = 0;
+ while (true) {
+ char c = *str++;
+ switch (c) {
+ case '\0':
+ return result;
+ case '[':
+ current = 0;
+ break;
+ case ']':
+ result *= current;
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ current = current * 10 + (c - '0');
+ break;
+ default:
+ break;
+ }
+ }
}
/** \} */
@@ -84,28 +84,26 @@ int DNA_elem_array_size(const char *str)
static bool is_identifier(const char c)
{
- return ((c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') ||
- (c >= '0' && c <= '9') ||
- (c == '_'));
+ return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') ||
+ (c == '_'));
}
uint DNA_elem_id_offset_start(const char *elem_full)
{
- uint elem_full_offset = 0;
- while (!is_identifier(elem_full[elem_full_offset])) {
- elem_full_offset++;
- }
- return elem_full_offset;
+ uint elem_full_offset = 0;
+ while (!is_identifier(elem_full[elem_full_offset])) {
+ elem_full_offset++;
+ }
+ return elem_full_offset;
}
uint DNA_elem_id_offset_end(const char *elem_full)
{
- uint elem_full_offset = 0;
- while (is_identifier(elem_full[elem_full_offset])) {
- elem_full_offset++;
- }
- return elem_full_offset;
+ uint elem_full_offset = 0;
+ while (is_identifier(elem_full[elem_full_offset])) {
+ elem_full_offset++;
+ }
+ return elem_full_offset;
}
/**
@@ -113,79 +111,81 @@ uint DNA_elem_id_offset_end(const char *elem_full)
*/
uint DNA_elem_id_strip_copy(char *elem_dst, const char *elem_src)
{
- const uint elem_src_offset = DNA_elem_id_offset_start(elem_src);
- const char *elem_src_trim = elem_src + elem_src_offset;
- const uint elem_src_trim_len = DNA_elem_id_offset_end(elem_src_trim);
- memcpy(elem_dst, elem_src_trim, elem_src_trim_len);
- elem_dst[elem_src_trim_len] = '\0';
- return elem_src_trim_len;
+ const uint elem_src_offset = DNA_elem_id_offset_start(elem_src);
+ const char *elem_src_trim = elem_src + elem_src_offset;
+ const uint elem_src_trim_len = DNA_elem_id_offset_end(elem_src_trim);
+ memcpy(elem_dst, elem_src_trim, elem_src_trim_len);
+ elem_dst[elem_src_trim_len] = '\0';
+ return elem_src_trim_len;
}
uint DNA_elem_id_strip(char *elem)
{
- const uint elem_offset = DNA_elem_id_offset_start(elem);
- const char *elem_trim = elem + elem_offset;
- const uint elem_trim_len = DNA_elem_id_offset_end(elem_trim);
- memmove(elem, elem_trim, elem_trim_len);
- elem[elem_trim_len] = '\0';
- return elem_trim_len;
+ const uint elem_offset = DNA_elem_id_offset_start(elem);
+ const char *elem_trim = elem + elem_offset;
+ const uint elem_trim_len = DNA_elem_id_offset_end(elem_trim);
+ memmove(elem, elem_trim, elem_trim_len);
+ elem[elem_trim_len] = '\0';
+ return elem_trim_len;
}
/**
* Check if 'var' matches '*var[3]' for eg,
* return true if it does, with start/end offsets.
*/
-bool DNA_elem_id_match(
- const char *elem_search, const int elem_search_len,
- const char *elem_full,
- uint *r_elem_full_offset)
+bool DNA_elem_id_match(const char *elem_search,
+ const int elem_search_len,
+ const char *elem_full,
+ uint *r_elem_full_offset)
{
- BLI_assert(strlen(elem_search) == elem_search_len);
- const uint elem_full_offset = DNA_elem_id_offset_start(elem_full);
- const char *elem_full_trim = elem_full + elem_full_offset;
- if (strncmp(elem_search, elem_full_trim, elem_search_len) == 0) {
- const char c = elem_full_trim[elem_search_len];
- if (c == '\0' || !is_identifier(c)) {
- *r_elem_full_offset = elem_full_offset;
- return true;
- }
- }
- return false;
+ BLI_assert(strlen(elem_search) == elem_search_len);
+ const uint elem_full_offset = DNA_elem_id_offset_start(elem_full);
+ const char *elem_full_trim = elem_full + elem_full_offset;
+ if (strncmp(elem_search, elem_full_trim, elem_search_len) == 0) {
+ const char c = elem_full_trim[elem_search_len];
+ if (c == '\0' || !is_identifier(c)) {
+ *r_elem_full_offset = elem_full_offset;
+ return true;
+ }
+ }
+ return false;
}
/**
* Return a renamed dna name, allocated from \a mem_arena.
*/
-char *DNA_elem_id_rename(
- struct MemArena *mem_arena,
- const char *elem_src, const int elem_src_len,
- const char *elem_dst, const int elem_dst_len,
- const char *elem_src_full, const int elem_src_full_len,
- const uint elem_src_full_offset_len)
+char *DNA_elem_id_rename(struct MemArena *mem_arena,
+ const char *elem_src,
+ const int elem_src_len,
+ const char *elem_dst,
+ const int elem_dst_len,
+ const char *elem_src_full,
+ const int elem_src_full_len,
+ const uint elem_src_full_offset_len)
{
- BLI_assert(strlen(elem_src) == elem_src_len);
- BLI_assert(strlen(elem_dst) == elem_dst_len);
- BLI_assert(strlen(elem_src_full) == elem_src_full_len);
- BLI_assert(DNA_elem_id_offset_start(elem_src_full) == elem_src_full_offset_len);
- UNUSED_VARS_NDEBUG(elem_src);
-
- const int elem_final_len = (elem_src_full_len - elem_src_len) + elem_dst_len;
- char *elem_dst_full = BLI_memarena_alloc(mem_arena, elem_final_len + 1);
- uint i = 0;
- if (elem_src_full_offset_len != 0) {
- memcpy(elem_dst_full, elem_src_full, elem_src_full_offset_len);
- i = elem_src_full_offset_len;
- }
- memcpy(&elem_dst_full[i], elem_dst, elem_dst_len + 1);
- i += elem_dst_len;
- uint elem_src_full_offset_end = elem_src_full_offset_len + elem_src_len;
- if (elem_src_full[elem_src_full_offset_end] != '\0') {
- const int elem_full_tail_len = (elem_src_full_len - elem_src_full_offset_end);
- memcpy(&elem_dst_full[i], &elem_src_full[elem_src_full_offset_end], elem_full_tail_len + 1);
- i += elem_full_tail_len;
- }
- BLI_assert((strlen(elem_dst_full) == elem_final_len) && (i == elem_final_len));
- return elem_dst_full;
+ BLI_assert(strlen(elem_src) == elem_src_len);
+ BLI_assert(strlen(elem_dst) == elem_dst_len);
+ BLI_assert(strlen(elem_src_full) == elem_src_full_len);
+ BLI_assert(DNA_elem_id_offset_start(elem_src_full) == elem_src_full_offset_len);
+ UNUSED_VARS_NDEBUG(elem_src);
+
+ const int elem_final_len = (elem_src_full_len - elem_src_len) + elem_dst_len;
+ char *elem_dst_full = BLI_memarena_alloc(mem_arena, elem_final_len + 1);
+ uint i = 0;
+ if (elem_src_full_offset_len != 0) {
+ memcpy(elem_dst_full, elem_src_full, elem_src_full_offset_len);
+ i = elem_src_full_offset_len;
+ }
+ memcpy(&elem_dst_full[i], elem_dst, elem_dst_len + 1);
+ i += elem_dst_len;
+ uint elem_src_full_offset_end = elem_src_full_offset_len + elem_src_len;
+ if (elem_src_full[elem_src_full_offset_end] != '\0') {
+ const int elem_full_tail_len = (elem_src_full_len - elem_src_full_offset_end);
+ memcpy(&elem_dst_full[i], &elem_src_full[elem_src_full_offset_end], elem_full_tail_len + 1);
+ i += elem_full_tail_len;
+ }
+ BLI_assert((strlen(elem_dst_full) == elem_final_len) && (i == elem_final_len));
+ return elem_dst_full;
}
/** \} */
@@ -196,86 +196,83 @@ char *DNA_elem_id_rename(
static uint strhash_pair_p(const void *ptr)
{
- const char * const *pair = ptr;
- return (BLI_ghashutil_strhash_p(pair[0]) ^
- BLI_ghashutil_strhash_p(pair[1]));
+ const char *const *pair = ptr;
+ return (BLI_ghashutil_strhash_p(pair[0]) ^ BLI_ghashutil_strhash_p(pair[1]));
}
static bool strhash_pair_cmp(const void *a, const void *b)
{
- const char * const *pair_a = a;
- const char * const *pair_b = b;
- return (STREQ(pair_a[0], pair_b[0]) &&
- STREQ(pair_a[1], pair_b[1])) ? false : true;
+ const char *const *pair_a = a;
+ const char *const *pair_b = b;
+ return (STREQ(pair_a[0], pair_b[0]) && STREQ(pair_a[1], pair_b[1])) ? false : true;
}
-void DNA_alias_maps(
- enum eDNA_RenameDir version_dir,
- GHash **r_struct_map, GHash **r_elem_map)
+void DNA_alias_maps(enum eDNA_RenameDir version_dir, GHash **r_struct_map, GHash **r_elem_map)
{
- GHash *struct_map_local = NULL;
- if (r_struct_map) {
- const char *data[][2] = {
+ GHash *struct_map_local = NULL;
+ if (r_struct_map) {
+ const char *data[][2] = {
#define DNA_STRUCT_RENAME(old, new) {#old, #new},
#define DNA_STRUCT_RENAME_ELEM(struct_name, old, new)
#include "dna_rename_defs.h"
#undef DNA_STRUCT_RENAME
#undef DNA_STRUCT_RENAME_ELEM
- };
-
- int elem_key, elem_val;
- if (version_dir == DNA_RENAME_ALIAS_FROM_STATIC) {
- elem_key = 0;
- elem_val = 1;
- }
- else {
- elem_key = 1;
- elem_val = 0;
- }
- GHash *struct_map = BLI_ghash_str_new_ex(__func__, ARRAY_SIZE(data));
- for (int i = 0; i < ARRAY_SIZE(data); i++) {
- BLI_ghash_insert(struct_map, (void *)data[i][elem_key], (void *)data[i][elem_val]);
- }
- *r_struct_map = struct_map;
-
- /* We know the direction of this, for local use. */
- struct_map_local = BLI_ghash_str_new_ex(__func__, ARRAY_SIZE(data));
- for (int i = 0; i < ARRAY_SIZE(data); i++) {
- BLI_ghash_insert(struct_map_local, (void *)data[i][1], (void *)data[i][0]);
- }
- }
-
- if (r_elem_map != NULL) {
- const char *data[][3] = {
+ };
+
+ int elem_key, elem_val;
+ if (version_dir == DNA_RENAME_ALIAS_FROM_STATIC) {
+ elem_key = 0;
+ elem_val = 1;
+ }
+ else {
+ elem_key = 1;
+ elem_val = 0;
+ }
+ GHash *struct_map = BLI_ghash_str_new_ex(__func__, ARRAY_SIZE(data));
+ for (int i = 0; i < ARRAY_SIZE(data); i++) {
+ BLI_ghash_insert(struct_map, (void *)data[i][elem_key], (void *)data[i][elem_val]);
+ }
+ *r_struct_map = struct_map;
+
+ /* We know the direction of this, for local use. */
+ struct_map_local = BLI_ghash_str_new_ex(__func__, ARRAY_SIZE(data));
+ for (int i = 0; i < ARRAY_SIZE(data); i++) {
+ BLI_ghash_insert(struct_map_local, (void *)data[i][1], (void *)data[i][0]);
+ }
+ }
+
+ if (r_elem_map != NULL) {
+ const char *data[][3] = {
#define DNA_STRUCT_RENAME(old, new)
#define DNA_STRUCT_RENAME_ELEM(struct_name, old, new) {#struct_name, #old, #new},
#include "dna_rename_defs.h"
#undef DNA_STRUCT_RENAME
#undef DNA_STRUCT_RENAME_ELEM
- };
-
- int elem_key, elem_val;
- if (version_dir == DNA_RENAME_ALIAS_FROM_STATIC) {
- elem_key = 1;
- elem_val = 2;
- }
- else {
- elem_key = 2;
- elem_val = 1;
- }
- GHash *elem_map = BLI_ghash_new_ex(strhash_pair_p, strhash_pair_cmp, __func__, ARRAY_SIZE(data));
- for (int i = 0; i < ARRAY_SIZE(data); i++) {
- const char **str_pair = MEM_mallocN(sizeof(char *) * 2, __func__);
- str_pair[0] = BLI_ghash_lookup_default(struct_map_local, data[i][0], (void *)data[i][0]);
- str_pair[1] = data[i][elem_key];
- BLI_ghash_insert(elem_map, str_pair, (void *)data[i][elem_val]);
- }
- *r_elem_map = elem_map;
- }
-
- if (struct_map_local) {
- BLI_ghash_free(struct_map_local, NULL, NULL);
- }
+ };
+
+ int elem_key, elem_val;
+ if (version_dir == DNA_RENAME_ALIAS_FROM_STATIC) {
+ elem_key = 1;
+ elem_val = 2;
+ }
+ else {
+ elem_key = 2;
+ elem_val = 1;
+ }
+ GHash *elem_map = BLI_ghash_new_ex(
+ strhash_pair_p, strhash_pair_cmp, __func__, ARRAY_SIZE(data));
+ for (int i = 0; i < ARRAY_SIZE(data); i++) {
+ const char **str_pair = MEM_mallocN(sizeof(char *) * 2, __func__);
+ str_pair[0] = BLI_ghash_lookup_default(struct_map_local, data[i][0], (void *)data[i][0]);
+ str_pair[1] = data[i][elem_key];
+ BLI_ghash_insert(elem_map, str_pair, (void *)data[i][elem_val]);
+ }
+ *r_elem_map = elem_map;
+ }
+
+ if (struct_map_local) {
+ BLI_ghash_free(struct_map_local, NULL, NULL);
+ }
}
#undef DNA_MAKESDNA
@@ -299,34 +296,34 @@ void DNA_alias_maps(
*/
const char *DNA_struct_rename_legacy_hack_static_from_alias(const char *name)
{
- /* 'bScreen' replaces the old IrisGL 'Screen' struct */
- if (STREQ("bScreen", name)) {
- return "Screen";
- }
- /* Groups renamed to collections in 2.8 */
- if (STREQ("Collection", name)) {
- return "Group";
- }
- if (STREQ("CollectionObject", name)) {
- return "GroupObject";
- }
- return name;
+ /* 'bScreen' replaces the old IrisGL 'Screen' struct */
+ if (STREQ("bScreen", name)) {
+ return "Screen";
+ }
+ /* Groups renamed to collections in 2.8 */
+ if (STREQ("Collection", name)) {
+ return "Group";
+ }
+ if (STREQ("CollectionObject", name)) {
+ return "GroupObject";
+ }
+ return name;
}
const char *DNA_struct_rename_legacy_hack_alias_from_static(const char *name)
{
- /* 'bScreen' replaces the old IrisGL 'Screen' struct */
- if (STREQ("Screen", name)) {
- return "bScreen";
- }
- /* Groups renamed to collections in 2.8 */
- if (STREQ("Group", name)) {
- return "Collection";
- }
- if (STREQ("GroupObject", name)) {
- return "CollectionObject";
- }
- return name;
+ /* 'bScreen' replaces the old IrisGL 'Screen' struct */
+ if (STREQ("Screen", name)) {
+ return "bScreen";
+ }
+ /* Groups renamed to collections in 2.8 */
+ if (STREQ("Group", name)) {
+ return "Collection";
+ }
+ if (STREQ("GroupObject", name)) {
+ return "CollectionObject";
+ }
+ return name;
}
/** \} */
diff --git a/source/blender/makesdna/intern/dna_utils.h b/source/blender/makesdna/intern/dna_utils.h
index 6e96cf43622..123dd30a2b9 100644
--- a/source/blender/makesdna/intern/dna_utils.h
+++ b/source/blender/makesdna/intern/dna_utils.h
@@ -30,25 +30,27 @@ uint DNA_elem_id_offset_start(const char *elem_full);
uint DNA_elem_id_offset_end(const char *elem_full);
uint DNA_elem_id_strip_copy(char *elem_dst, const char *elem_src);
uint DNA_elem_id_strip(char *elem);
-bool DNA_elem_id_match(
- const char *elem_search, const int elem_search_len,
- const char *elem_full,
- uint *r_elem_full_offset);
-char *DNA_elem_id_rename(
- struct MemArena *mem_arena,
- const char *elem_src, const int elem_src_len,
- const char *elem_dst, const int elem_dst_len,
- const char *elem_full_src, const int elem_full_src_len,
- const uint elem_full_offset_start);
+bool DNA_elem_id_match(const char *elem_search,
+ const int elem_search_len,
+ const char *elem_full,
+ uint *r_elem_full_offset);
+char *DNA_elem_id_rename(struct MemArena *mem_arena,
+ const char *elem_src,
+ const int elem_src_len,
+ const char *elem_dst,
+ const int elem_dst_len,
+ const char *elem_full_src,
+ const int elem_full_src_len,
+ const uint elem_full_offset_start);
/* When requesting version info, support both directions. */
enum eDNA_RenameDir {
- DNA_RENAME_STATIC_FROM_ALIAS = -1,
- DNA_RENAME_ALIAS_FROM_STATIC = 1,
+ DNA_RENAME_STATIC_FROM_ALIAS = -1,
+ DNA_RENAME_ALIAS_FROM_STATIC = 1,
};
-void DNA_alias_maps(
- enum eDNA_RenameDir version_dir,
- struct GHash **r_struct_map, struct GHash **r_elem_map);
+void DNA_alias_maps(enum eDNA_RenameDir version_dir,
+ struct GHash **r_struct_map,
+ struct GHash **r_elem_map);
const char *DNA_struct_rename_legacy_hack_alias_from_static(const char *name);
const char *DNA_struct_rename_legacy_hack_static_from_alias(const char *name);
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index cc5abadd0e8..fa7ead3cd96 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -52,7 +52,7 @@
#include "BLI_alloca.h"
#include "BLI_ghash.h"
#include "BLI_memarena.h"
-#include "BLI_sys_types.h" /* for intptr_t support */
+#include "BLI_sys_types.h" /* for intptr_t support */
#include "dna_utils.h"
@@ -62,79 +62,79 @@
/* headers around with more freedom. */
static const char *includefiles[] = {
- /* if you add files here, please add them at the end
- * of makesdna.c (this file) as well */
- "DNA_listBase.h",
- "DNA_vec_types.h",
- "DNA_ID.h",
- "DNA_ipo_types.h",
- "DNA_key_types.h",
- "DNA_text_types.h",
- "DNA_packedFile_types.h",
- "DNA_gpu_types.h",
- "DNA_camera_types.h",
- "DNA_image_types.h",
- "DNA_texture_types.h",
- "DNA_light_types.h",
- "DNA_material_types.h",
- "DNA_vfont_types.h",
- "DNA_meta_types.h",
- "DNA_curve_types.h",
- "DNA_mesh_types.h",
- "DNA_meshdata_types.h",
- "DNA_modifier_types.h",
- "DNA_lattice_types.h",
- "DNA_object_types.h",
- "DNA_object_force_types.h",
- "DNA_object_fluidsim_types.h",
- "DNA_world_types.h",
- "DNA_scene_types.h",
- "DNA_view3d_types.h",
- "DNA_view2d_types.h",
- "DNA_space_types.h",
- "DNA_userdef_types.h",
- "DNA_screen_types.h",
- "DNA_sdna_types.h",
- "DNA_fileglobal_types.h",
- "DNA_sequence_types.h",
- "DNA_effect_types.h",
- "DNA_outliner_types.h",
- "DNA_sound_types.h",
- "DNA_collection_types.h",
- "DNA_armature_types.h",
- "DNA_action_types.h",
- "DNA_constraint_types.h",
- "DNA_nla_types.h",
- "DNA_node_types.h",
- "DNA_color_types.h",
- "DNA_brush_types.h",
- "DNA_customdata_types.h",
- "DNA_particle_types.h",
- "DNA_cloth_types.h",
- "DNA_gpencil_types.h",
- "DNA_gpencil_modifier_types.h",
- "DNA_shader_fx_types.h",
- "DNA_windowmanager_types.h",
- "DNA_anim_types.h",
- "DNA_boid_types.h",
- "DNA_smoke_types.h",
- "DNA_speaker_types.h",
- "DNA_movieclip_types.h",
- "DNA_tracking_types.h",
- "DNA_dynamicpaint_types.h",
- "DNA_mask_types.h",
- "DNA_rigidbody_types.h",
- "DNA_freestyle_types.h",
- "DNA_linestyle_types.h",
- "DNA_cachefile_types.h",
- "DNA_layer_types.h",
- "DNA_workspace_types.h",
- "DNA_lightprobe_types.h",
-
- /* see comment above before editing! */
-
- /* empty string to indicate end of includefiles */
- "",
+ /* if you add files here, please add them at the end
+ * of makesdna.c (this file) as well */
+ "DNA_listBase.h",
+ "DNA_vec_types.h",
+ "DNA_ID.h",
+ "DNA_ipo_types.h",
+ "DNA_key_types.h",
+ "DNA_text_types.h",
+ "DNA_packedFile_types.h",
+ "DNA_gpu_types.h",
+ "DNA_camera_types.h",
+ "DNA_image_types.h",
+ "DNA_texture_types.h",
+ "DNA_light_types.h",
+ "DNA_material_types.h",
+ "DNA_vfont_types.h",
+ "DNA_meta_types.h",
+ "DNA_curve_types.h",
+ "DNA_mesh_types.h",
+ "DNA_meshdata_types.h",
+ "DNA_modifier_types.h",
+ "DNA_lattice_types.h",
+ "DNA_object_types.h",
+ "DNA_object_force_types.h",
+ "DNA_object_fluidsim_types.h",
+ "DNA_world_types.h",
+ "DNA_scene_types.h",
+ "DNA_view3d_types.h",
+ "DNA_view2d_types.h",
+ "DNA_space_types.h",
+ "DNA_userdef_types.h",
+ "DNA_screen_types.h",
+ "DNA_sdna_types.h",
+ "DNA_fileglobal_types.h",
+ "DNA_sequence_types.h",
+ "DNA_effect_types.h",
+ "DNA_outliner_types.h",
+ "DNA_sound_types.h",
+ "DNA_collection_types.h",
+ "DNA_armature_types.h",
+ "DNA_action_types.h",
+ "DNA_constraint_types.h",
+ "DNA_nla_types.h",
+ "DNA_node_types.h",
+ "DNA_color_types.h",
+ "DNA_brush_types.h",
+ "DNA_customdata_types.h",
+ "DNA_particle_types.h",
+ "DNA_cloth_types.h",
+ "DNA_gpencil_types.h",
+ "DNA_gpencil_modifier_types.h",
+ "DNA_shader_fx_types.h",
+ "DNA_windowmanager_types.h",
+ "DNA_anim_types.h",
+ "DNA_boid_types.h",
+ "DNA_smoke_types.h",
+ "DNA_speaker_types.h",
+ "DNA_movieclip_types.h",
+ "DNA_tracking_types.h",
+ "DNA_dynamicpaint_types.h",
+ "DNA_mask_types.h",
+ "DNA_rigidbody_types.h",
+ "DNA_freestyle_types.h",
+ "DNA_linestyle_types.h",
+ "DNA_cachefile_types.h",
+ "DNA_layer_types.h",
+ "DNA_workspace_types.h",
+ "DNA_lightprobe_types.h",
+
+ /* see comment above before editing! */
+
+ /* empty string to indicate end of includefiles */
+ "",
};
/* -------------------------------------------------------------------- */
@@ -166,10 +166,10 @@ static short **structs, *structdata;
/** Versioning data */
static struct {
- GHash *struct_map_alias_from_static;
- GHash *struct_map_static_from_alias;
- GHash *elem_map_alias_from_static;
- GHash *elem_map_static_from_alias;
+ GHash *struct_map_alias_from_static;
+ GHash *struct_map_static_from_alias;
+ GHash *elem_map_alias_from_static;
+ GHash *elem_map_static_from_alias;
} g_version_data = {NULL};
/**
@@ -184,14 +184,18 @@ static int debugSDNA = 0;
static int additional_slen_offset;
#define DEBUG_PRINTF(debug_level, ...) \
- { if (debugSDNA > debug_level) { printf(__VA_ARGS__); } } ((void)0)
-
+ { \
+ if (debugSDNA > debug_level) { \
+ printf(__VA_ARGS__); \
+ } \
+ } \
+ ((void)0)
/* stub for BLI_abort() */
#ifndef NDEBUG
void BLI_system_backtrace(FILE *fp)
{
- (void)fp;
+ (void)fp;
}
#endif
@@ -256,42 +260,42 @@ void print_struct_sizes(void);
* Make DNA string (write to file).
* \{ */
-
static const char *version_struct_static_from_alias(const char *str)
{
- const char *str_test = BLI_ghash_lookup(g_version_data.struct_map_static_from_alias, str);
- if (str_test != NULL) {
- return str_test;
- }
- return str;
+ const char *str_test = BLI_ghash_lookup(g_version_data.struct_map_static_from_alias, str);
+ if (str_test != NULL) {
+ return str_test;
+ }
+ return str;
}
static const char *version_struct_alias_from_static(const char *str)
{
- const char *str_test = BLI_ghash_lookup(g_version_data.struct_map_alias_from_static, str);
- if (str_test != NULL) {
- return str_test;
- }
- return str;
+ const char *str_test = BLI_ghash_lookup(g_version_data.struct_map_alias_from_static, str);
+ if (str_test != NULL) {
+ return str_test;
+ }
+ return str;
}
-static const char *version_elem_static_from_alias(
- const int strct, const char *elem_alias_full)
+static const char *version_elem_static_from_alias(const int strct, const char *elem_alias_full)
{
- const uint elem_alias_full_len = strlen(elem_alias_full);
- char *elem_alias = alloca(elem_alias_full_len + 1);
- const int elem_alias_len = DNA_elem_id_strip_copy(elem_alias, elem_alias_full);
- const char *str_pair[2] = {types[strct], elem_alias};
- const char *elem_static = BLI_ghash_lookup(g_version_data.elem_map_static_from_alias, str_pair);
- if (elem_static != NULL) {
- return DNA_elem_id_rename(
- mem_arena,
- elem_alias, elem_alias_len,
- elem_static, strlen(elem_static),
- elem_alias_full, elem_alias_full_len,
- DNA_elem_id_offset_start(elem_alias_full));
- }
- return elem_alias_full;
+ const uint elem_alias_full_len = strlen(elem_alias_full);
+ char *elem_alias = alloca(elem_alias_full_len + 1);
+ const int elem_alias_len = DNA_elem_id_strip_copy(elem_alias, elem_alias_full);
+ const char *str_pair[2] = {types[strct], elem_alias};
+ const char *elem_static = BLI_ghash_lookup(g_version_data.elem_map_static_from_alias, str_pair);
+ if (elem_static != NULL) {
+ return DNA_elem_id_rename(mem_arena,
+ elem_alias,
+ elem_alias_len,
+ elem_static,
+ strlen(elem_static),
+ elem_alias_full,
+ elem_alias_full_len,
+ DNA_elem_id_offset_start(elem_alias_full));
+ }
+ return elem_alias_full;
}
/**
@@ -300,90 +304,90 @@ static const char *version_elem_static_from_alias(
*/
static bool is_name_legal(const char *name)
{
- const int name_size = strlen(name) + 1;
- char *name_strip = alloca(name_size);
- DNA_elem_id_strip_copy(name_strip, name);
-
- const char prefix[] = {'p', 'a', 'd'};
-
- if (name[0] == '_') {
- if (strncmp(&name_strip[1], prefix, sizeof(prefix)) != 0) {
- fprintf(stderr, "Error: only '_pad' variables can start with an underscore, found '%s'\n", name);
- return false;
- }
- }
- else if (strncmp(name_strip, prefix, sizeof(prefix)) == 0) {
- int i = sizeof(prefix);
- if (name_strip[i] >= 'a' && name_strip[i] <= 'z') {
- /* may be part of a word, allow that. */
- return true;
- }
- bool has_only_digit_or_none = true;
- for (; name_strip[i]; i++) {
- const char c = name_strip[i];
- if (!((c >= '0' && c <= '9') || c == '_')) {
- has_only_digit_or_none = false;
- break;
- }
- }
- if (has_only_digit_or_none) {
- /* found 'pad' or 'pad123'. */
- fprintf(stderr, "Error: padding variables must be formatted '_pad[number]', found '%s'\n", name);
- return false;
- }
- }
- return true;
+ const int name_size = strlen(name) + 1;
+ char *name_strip = alloca(name_size);
+ DNA_elem_id_strip_copy(name_strip, name);
+
+ const char prefix[] = {'p', 'a', 'd'};
+
+ if (name[0] == '_') {
+ if (strncmp(&name_strip[1], prefix, sizeof(prefix)) != 0) {
+ fprintf(
+ stderr, "Error: only '_pad' variables can start with an underscore, found '%s'\n", name);
+ return false;
+ }
+ }
+ else if (strncmp(name_strip, prefix, sizeof(prefix)) == 0) {
+ int i = sizeof(prefix);
+ if (name_strip[i] >= 'a' && name_strip[i] <= 'z') {
+ /* may be part of a word, allow that. */
+ return true;
+ }
+ bool has_only_digit_or_none = true;
+ for (; name_strip[i]; i++) {
+ const char c = name_strip[i];
+ if (!((c >= '0' && c <= '9') || c == '_')) {
+ has_only_digit_or_none = false;
+ break;
+ }
+ }
+ if (has_only_digit_or_none) {
+ /* found 'pad' or 'pad123'. */
+ fprintf(
+ stderr, "Error: padding variables must be formatted '_pad[number]', found '%s'\n", name);
+ return false;
+ }
+ }
+ return true;
}
-
static int add_type(const char *str, int size)
{
- int nr;
- char *cp;
-
- /* first do validity check */
- if (str[0] == 0) {
- return -1;
- }
- else if (strchr(str, '*')) {
- /* note: this is valid C syntax but we can't parse, complain!
- * 'struct SomeStruct* somevar;' <-- correct but we cant handle right now. */
- return -1;
- }
-
- str = version_struct_static_from_alias(str);
-
- /* search through type array */
- for (nr = 0; nr < nr_types; nr++) {
- if (strcmp(str, types[nr]) == 0) {
- if (size) {
- types_size_native[nr] = size;
- types_size_32[nr] = size;
- types_size_64[nr] = size;
- }
- return nr;
- }
- }
-
- /* append new type */
- const int str_size = strlen(str) + 1;
- cp = BLI_memarena_alloc(mem_arena, str_size);
- memcpy(cp, str, str_size);
- types[nr_types] = cp;
- types_size_native[nr_types] = size;
- types_size_32[nr_types] = size;
- types_size_64[nr_types] = size;
-
- if (nr_types >= maxnr) {
- printf("too many types\n");
- return nr_types - 1;
- }
- nr_types++;
-
- return nr_types - 1;
+ int nr;
+ char *cp;
+
+ /* first do validity check */
+ if (str[0] == 0) {
+ return -1;
+ }
+ else if (strchr(str, '*')) {
+ /* note: this is valid C syntax but we can't parse, complain!
+ * 'struct SomeStruct* somevar;' <-- correct but we cant handle right now. */
+ return -1;
+ }
+
+ str = version_struct_static_from_alias(str);
+
+ /* search through type array */
+ for (nr = 0; nr < nr_types; nr++) {
+ if (strcmp(str, types[nr]) == 0) {
+ if (size) {
+ types_size_native[nr] = size;
+ types_size_32[nr] = size;
+ types_size_64[nr] = size;
+ }
+ return nr;
+ }
+ }
+
+ /* append new type */
+ const int str_size = strlen(str) + 1;
+ cp = BLI_memarena_alloc(mem_arena, str_size);
+ memcpy(cp, str, str_size);
+ types[nr_types] = cp;
+ types_size_native[nr_types] = size;
+ types_size_32[nr_types] = size;
+ types_size_64[nr_types] = size;
+
+ if (nr_types >= maxnr) {
+ printf("too many types\n");
+ return nr_types - 1;
+ }
+ nr_types++;
+
+ return nr_types - 1;
}
-
/**
*
* Because of the weird way of tokenizing, we have to 'cast' function
@@ -394,968 +398,1019 @@ static int add_type(const char *str, int size)
* */
static int add_name(const char *str)
{
- int nr, i, j, k;
- char *cp;
- char buf[255]; /* stupid limit, change it :) */
- const char *name;
-
- additional_slen_offset = 0;
-
- if (str[0] == 0 /* || (str[1] == 0) */) {
- return -1;
- }
-
- if (str[0] == '(' && str[1] == '*') {
- /* we handle function pointer and special array cases here, e.g.
- * void (*function)(...) and float (*array)[..]. the array case
- * name is still converted to (array *)() though because it is that
- * way in old dna too, and works correct with elementsize() */
- int isfuncptr = (strchr(str + 1, '(')) != NULL;
-
- DEBUG_PRINTF(3, "\t\t\t\t*** Function pointer or multidim array pointer found\n");
- /* functionpointer: transform the type (sometimes) */
- i = 0;
-
- while (str[i] != ')') {
- buf[i] = str[i];
- i++;
- }
-
- /* Another number we need is the extra slen offset. This extra
- * offset is the overshoot after a space. If there is no
- * space, no overshoot should be calculated. */
- j = i; /* j at first closing brace */
-
- DEBUG_PRINTF(3, "first brace after offset %d\n", i);
-
- j++; /* j beyond closing brace ? */
- while ((str[j] != 0) && (str[j] != ')')) {
- DEBUG_PRINTF(3, "seen %c (%d)\n", str[j], str[j]);
- j++;
- }
- DEBUG_PRINTF(3, "seen %c (%d)\n" "special after offset%d\n", str[j], str[j], j);
-
- if (!isfuncptr) {
- /* multidimensional array pointer case */
- if (str[j] == 0) {
- DEBUG_PRINTF(3, "offsetting for multidim array pointer\n");
- }
- else {
- printf("Error during tokening multidim array pointer\n");
- }
- }
- else if (str[j] == 0) {
- DEBUG_PRINTF(3, "offsetting for space\n");
- /* get additional offset */
- k = 0;
- while (str[j] != ')') {
- j++;
- k++;
- }
- DEBUG_PRINTF(3, "extra offset %d\n", k);
- additional_slen_offset = k;
- }
- else if (str[j] == ')') {
- DEBUG_PRINTF(3, "offsetting for brace\n");
- ; /* don't get extra offset */
- }
- else {
- printf("Error during tokening function pointer argument list\n");
- }
-
- /*
- * Put )(void) at the end? Maybe )(). Should check this with
- * old sdna. Actually, sometimes )(), sometimes )(void...)
- * Alas.. such is the nature of brain-damage :(
- *
- * Sorted it out: always do )(), except for headdraw and
- * windraw, part of ScrArea. This is important, because some
- * linkers will treat different fp's differently when called
- * !!! This has to do with interference in byte-alignment and
- * the way args are pushed on the stack.
- *
- * */
- buf[i] = 0;
- DEBUG_PRINTF(3, "Name before chomping: %s\n", buf);
- if ((strncmp(buf, "(*headdraw", 10) == 0) ||
- (strncmp(buf, "(*windraw", 9) == 0) )
- {
- buf[i] = ')';
- buf[i + 1] = '(';
- buf[i + 2] = 'v';
- buf[i + 3] = 'o';
- buf[i + 4] = 'i';
- buf[i + 5] = 'd';
- buf[i + 6] = ')';
- buf[i + 7] = 0;
- }
- else {
- buf[i] = ')';
- buf[i + 1] = '(';
- buf[i + 2] = ')';
- buf[i + 3] = 0;
- }
- /* now precede with buf*/
- DEBUG_PRINTF(3, "\t\t\t\t\tProposing fp name %s\n", buf);
- name = buf;
- }
- else {
- /* normal field: old code */
- name = str;
- }
-
- /* search name array */
- for (nr = 0; nr < nr_names; nr++) {
- if (strcmp(name, names[nr]) == 0) {
- return nr;
- }
- }
-
- /* Sanity check the name. */
- if (!is_name_legal(name)) {
- return -1;
- }
-
- /* Append new name. */
- const int name_size = strlen(name) + 1;
- cp = BLI_memarena_alloc(mem_arena, name_size);
- memcpy(cp, name, name_size);
- names[nr_names] = cp;
-
- if (nr_names >= maxnr) {
- printf("too many names\n");
- return nr_names - 1;
- }
- nr_names++;
-
- return nr_names - 1;
+ int nr, i, j, k;
+ char *cp;
+ char buf[255]; /* stupid limit, change it :) */
+ const char *name;
+
+ additional_slen_offset = 0;
+
+ if (str[0] == 0 /* || (str[1] == 0) */) {
+ return -1;
+ }
+
+ if (str[0] == '(' && str[1] == '*') {
+ /* we handle function pointer and special array cases here, e.g.
+ * void (*function)(...) and float (*array)[..]. the array case
+ * name is still converted to (array *)() though because it is that
+ * way in old dna too, and works correct with elementsize() */
+ int isfuncptr = (strchr(str + 1, '(')) != NULL;
+
+ DEBUG_PRINTF(3, "\t\t\t\t*** Function pointer or multidim array pointer found\n");
+ /* functionpointer: transform the type (sometimes) */
+ i = 0;
+
+ while (str[i] != ')') {
+ buf[i] = str[i];
+ i++;
+ }
+
+ /* Another number we need is the extra slen offset. This extra
+ * offset is the overshoot after a space. If there is no
+ * space, no overshoot should be calculated. */
+ j = i; /* j at first closing brace */
+
+ DEBUG_PRINTF(3, "first brace after offset %d\n", i);
+
+ j++; /* j beyond closing brace ? */
+ while ((str[j] != 0) && (str[j] != ')')) {
+ DEBUG_PRINTF(3, "seen %c (%d)\n", str[j], str[j]);
+ j++;
+ }
+ DEBUG_PRINTF(3,
+ "seen %c (%d)\n"
+ "special after offset%d\n",
+ str[j],
+ str[j],
+ j);
+
+ if (!isfuncptr) {
+ /* multidimensional array pointer case */
+ if (str[j] == 0) {
+ DEBUG_PRINTF(3, "offsetting for multidim array pointer\n");
+ }
+ else {
+ printf("Error during tokening multidim array pointer\n");
+ }
+ }
+ else if (str[j] == 0) {
+ DEBUG_PRINTF(3, "offsetting for space\n");
+ /* get additional offset */
+ k = 0;
+ while (str[j] != ')') {
+ j++;
+ k++;
+ }
+ DEBUG_PRINTF(3, "extra offset %d\n", k);
+ additional_slen_offset = k;
+ }
+ else if (str[j] == ')') {
+ DEBUG_PRINTF(3, "offsetting for brace\n");
+ ; /* don't get extra offset */
+ }
+ else {
+ printf("Error during tokening function pointer argument list\n");
+ }
+
+ /*
+ * Put )(void) at the end? Maybe )(). Should check this with
+ * old sdna. Actually, sometimes )(), sometimes )(void...)
+ * Alas.. such is the nature of brain-damage :(
+ *
+ * Sorted it out: always do )(), except for headdraw and
+ * windraw, part of ScrArea. This is important, because some
+ * linkers will treat different fp's differently when called
+ * !!! This has to do with interference in byte-alignment and
+ * the way args are pushed on the stack.
+ *
+ * */
+ buf[i] = 0;
+ DEBUG_PRINTF(3, "Name before chomping: %s\n", buf);
+ if ((strncmp(buf, "(*headdraw", 10) == 0) || (strncmp(buf, "(*windraw", 9) == 0)) {
+ buf[i] = ')';
+ buf[i + 1] = '(';
+ buf[i + 2] = 'v';
+ buf[i + 3] = 'o';
+ buf[i + 4] = 'i';
+ buf[i + 5] = 'd';
+ buf[i + 6] = ')';
+ buf[i + 7] = 0;
+ }
+ else {
+ buf[i] = ')';
+ buf[i + 1] = '(';
+ buf[i + 2] = ')';
+ buf[i + 3] = 0;
+ }
+ /* now precede with buf*/
+ DEBUG_PRINTF(3, "\t\t\t\t\tProposing fp name %s\n", buf);
+ name = buf;
+ }
+ else {
+ /* normal field: old code */
+ name = str;
+ }
+
+ /* search name array */
+ for (nr = 0; nr < nr_names; nr++) {
+ if (strcmp(name, names[nr]) == 0) {
+ return nr;
+ }
+ }
+
+ /* Sanity check the name. */
+ if (!is_name_legal(name)) {
+ return -1;
+ }
+
+ /* Append new name. */
+ const int name_size = strlen(name) + 1;
+ cp = BLI_memarena_alloc(mem_arena, name_size);
+ memcpy(cp, name, name_size);
+ names[nr_names] = cp;
+
+ if (nr_names >= maxnr) {
+ printf("too many names\n");
+ return nr_names - 1;
+ }
+ nr_names++;
+
+ return nr_names - 1;
}
static short *add_struct(int namecode)
{
- int len;
- short *sp;
-
- if (nr_structs == 0) {
- structs[0] = structdata;
- }
- else {
- sp = structs[nr_structs - 1];
- len = sp[1];
- structs[nr_structs] = sp + 2 * len + 2;
- }
-
- sp = structs[nr_structs];
- sp[0] = namecode;
-
- if (nr_structs >= maxnr) {
- printf("too many structs\n");
- return sp;
- }
- nr_structs++;
-
- return sp;
+ int len;
+ short *sp;
+
+ if (nr_structs == 0) {
+ structs[0] = structdata;
+ }
+ else {
+ sp = structs[nr_structs - 1];
+ len = sp[1];
+ structs[nr_structs] = sp + 2 * len + 2;
+ }
+
+ sp = structs[nr_structs];
+ sp[0] = namecode;
+
+ if (nr_structs >= maxnr) {
+ printf("too many structs\n");
+ return sp;
+ }
+ nr_structs++;
+
+ return sp;
}
static int preprocess_include(char *maindata, const int maindata_len)
{
- int a, newlen, comment = 0;
- char *cp, *temp, *md;
-
- /* note: len + 1, last character is a dummy to prevent
- * comparisons using uninitialized memory */
- temp = MEM_mallocN(maindata_len + 1, "preprocess_include");
- temp[maindata_len] = ' ';
-
- memcpy(temp, maindata, maindata_len);
-
- /* remove all c++ comments */
- /* replace all enters/tabs/etc with spaces */
- cp = temp;
- a = maindata_len;
- comment = 0;
- while (a--) {
- if (cp[0] == '/' && cp[1] == '/') {
- comment = 1;
- }
- else if (*cp == '\n') {
- comment = 0;
- }
- if (comment || *cp < 32 || *cp > 128) *cp = 32;
- cp++;
- }
-
-
- /* data from temp copy to maindata, remove comments and double spaces */
- cp = temp;
- md = maindata;
- newlen = 0;
- comment = 0;
- a = maindata_len;
- while (a--) {
-
- if (cp[0] == '/' && cp[1] == '*') {
- comment = 1;
- cp[0] = cp[1] = 32;
- }
- if (cp[0] == '*' && cp[1] == '/') {
- comment = 0;
- cp[0] = cp[1] = 32;
- }
-
- /* do not copy when: */
- if (comment) {
- /* pass */
- }
- else if (cp[0] == ' ' && cp[1] == ' ') {
- /* pass */
- }
- else if (cp[-1] == '*' && cp[0] == ' ') {
- /* pointers with a space */
- } /* skip special keywords */
- else if (strncmp("DNA_DEPRECATED", cp, 14) == 0) {
- /* single values are skipped already, so decrement 1 less */
- a -= 13;
- cp += 13;
- }
- else {
- md[0] = cp[0];
- md++;
- newlen++;
- }
- cp++;
- }
-
- MEM_freeN(temp);
- return newlen;
+ int a, newlen, comment = 0;
+ char *cp, *temp, *md;
+
+ /* note: len + 1, last character is a dummy to prevent
+ * comparisons using uninitialized memory */
+ temp = MEM_mallocN(maindata_len + 1, "preprocess_include");
+ temp[maindata_len] = ' ';
+
+ memcpy(temp, maindata, maindata_len);
+
+ /* remove all c++ comments */
+ /* replace all enters/tabs/etc with spaces */
+ cp = temp;
+ a = maindata_len;
+ comment = 0;
+ while (a--) {
+ if (cp[0] == '/' && cp[1] == '/') {
+ comment = 1;
+ }
+ else if (*cp == '\n') {
+ comment = 0;
+ }
+ if (comment || *cp < 32 || *cp > 128)
+ *cp = 32;
+ cp++;
+ }
+
+ /* data from temp copy to maindata, remove comments and double spaces */
+ cp = temp;
+ md = maindata;
+ newlen = 0;
+ comment = 0;
+ a = maindata_len;
+ while (a--) {
+
+ if (cp[0] == '/' && cp[1] == '*') {
+ comment = 1;
+ cp[0] = cp[1] = 32;
+ }
+ if (cp[0] == '*' && cp[1] == '/') {
+ comment = 0;
+ cp[0] = cp[1] = 32;
+ }
+
+ /* do not copy when: */
+ if (comment) {
+ /* pass */
+ }
+ else if (cp[0] == ' ' && cp[1] == ' ') {
+ /* pass */
+ }
+ else if (cp[-1] == '*' && cp[0] == ' ') {
+ /* pointers with a space */
+ } /* skip special keywords */
+ else if (strncmp("DNA_DEPRECATED", cp, 14) == 0) {
+ /* single values are skipped already, so decrement 1 less */
+ a -= 13;
+ cp += 13;
+ }
+ else {
+ md[0] = cp[0];
+ md++;
+ newlen++;
+ }
+ cp++;
+ }
+
+ MEM_freeN(temp);
+ return newlen;
}
static void *read_file_data(const char *filename, int *r_len)
{
#ifdef WIN32
- FILE *fp = fopen(filename, "rb");
+ FILE *fp = fopen(filename, "rb");
#else
- FILE *fp = fopen(filename, "r");
+ FILE *fp = fopen(filename, "r");
#endif
- void *data;
-
- if (!fp) {
- *r_len = -1;
- return NULL;
- }
-
- fseek(fp, 0L, SEEK_END);
- *r_len = ftell(fp);
- fseek(fp, 0L, SEEK_SET);
-
- if (*r_len == -1) {
- fclose(fp);
- return NULL;
- }
-
- data = MEM_mallocN(*r_len, "read_file_data");
- if (!data) {
- *r_len = -1;
- fclose(fp);
- return NULL;
- }
-
- if (fread(data, *r_len, 1, fp) != 1) {
- *r_len = -1;
- MEM_freeN(data);
- fclose(fp);
- return NULL;
- }
-
- fclose(fp);
- return data;
+ void *data;
+
+ if (!fp) {
+ *r_len = -1;
+ return NULL;
+ }
+
+ fseek(fp, 0L, SEEK_END);
+ *r_len = ftell(fp);
+ fseek(fp, 0L, SEEK_SET);
+
+ if (*r_len == -1) {
+ fclose(fp);
+ return NULL;
+ }
+
+ data = MEM_mallocN(*r_len, "read_file_data");
+ if (!data) {
+ *r_len = -1;
+ fclose(fp);
+ return NULL;
+ }
+
+ if (fread(data, *r_len, 1, fp) != 1) {
+ *r_len = -1;
+ MEM_freeN(data);
+ fclose(fp);
+ return NULL;
+ }
+
+ fclose(fp);
+ return data;
}
static int convert_include(const char *filename)
{
- /* read include file, skip structs with a '#' before it.
- * store all data in temporal arrays.
- */
- int maindata_len, count, slen, type, name, strct;
- short *structpoin, *sp;
- char *maindata, *mainend, *md, *md1;
- bool skip_struct;
-
- md = maindata = read_file_data(filename, &maindata_len);
- if (maindata_len == -1) {
- fprintf(stderr, "Can't read file %s\n", filename);
- return 1;
- }
-
- maindata_len = preprocess_include(maindata, maindata_len);
- mainend = maindata + maindata_len - 1;
-
- /* we look for '{' and then back to 'struct' */
- count = 0;
- skip_struct = false;
- while (count < maindata_len) {
-
- /* code for skipping a struct: two hashes on 2 lines. (preprocess added a space) */
- if (md[0] == '#' && md[1] == ' ' && md[2] == '#') {
- skip_struct = true;
- }
-
- if (md[0] == '{') {
- md[0] = 0;
- if (skip_struct) {
- skip_struct = false;
- }
- else {
- if (md[-1] == ' ') {
- md[-1] = 0;
- }
- md1 = md - 2;
- while (*md1 != 32) {
- /* to beginning of word */
- md1--;
- }
- md1++;
-
- /* we've got a struct name when... */
- if (strncmp(md1 - 7, "struct", 6) == 0) {
-
- strct = add_type(md1, 0);
- if (strct == -1) {
- fprintf(stderr, "File '%s' contains struct we cant parse \"%s\"\n", filename, md1);
- return 1;
- }
-
- structpoin = add_struct(strct);
- sp = structpoin + 2;
-
- DEBUG_PRINTF(1, "\t|\t|-- detected struct %s\n", types[strct]);
-
- /* first lets make it all nice strings */
- md1 = md + 1;
- while (*md1 != '}') {
- if (md1 > mainend) {
- break;
- }
-
- if (*md1 == ',' || *md1 == ' ') {
- *md1 = 0;
- }
- md1++;
- }
-
- /* read types and names until first character that is not '}' */
- md1 = md + 1;
- while (*md1 != '}') {
- if (md1 > mainend) {
- break;
- }
-
- /* skip when it says 'struct' or 'unsigned' or 'const' */
- if (*md1) {
- if (strncmp(md1, "struct", 6) == 0) { md1 += 7; }
- if (strncmp(md1, "unsigned", 8) == 0) { md1 += 9; }
- if (strncmp(md1, "const", 5) == 0) { md1 += 6; }
-
- /* we've got a type! */
- type = add_type(md1, 0);
- if (type == -1) {
- fprintf(stderr, "File '%s' contains struct we can't parse \"%s\"\n", filename, md1);
- return 1;
- }
-
- DEBUG_PRINTF(1, "\t|\t|\tfound type %s (", md1);
-
- md1 += strlen(md1);
-
-
- /* read until ';' */
- while (*md1 != ';') {
- if (md1 > mainend) {
- break;
- }
-
- if (*md1) {
- /* We've got a name. slen needs
- * correction for function
- * pointers! */
- slen = (int) strlen(md1);
- if (md1[slen - 1] == ';') {
- md1[slen - 1] = 0;
-
- name = add_name(version_elem_static_from_alias(strct, md1));
- if (name == -1) {
- fprintf(stderr, "File '%s' contains struct with name that can't be added \"%s\"\n", filename, md1);
- return 1;
- }
- slen += additional_slen_offset;
- sp[0] = type;
- sp[1] = name;
-
- if (names[name] != NULL) {
- DEBUG_PRINTF(1, "%s |", names[name]);
- }
-
- structpoin[1]++;
- sp += 2;
-
- md1 += slen;
- break;
- }
-
- name = add_name(version_elem_static_from_alias(strct, md1));
- if (name == -1) {
- fprintf(stderr, "File '%s' contains struct with name that can't be added \"%s\"\n", filename, md1);
- return 1;
- }
- slen += additional_slen_offset;
-
- sp[0] = type;
- sp[1] = name;
- if (names[name] != NULL) {
- DEBUG_PRINTF(1, "%s ||", names[name]);
- }
-
- structpoin[1]++;
- sp += 2;
-
- md1 += slen;
- }
- md1++;
- }
-
- DEBUG_PRINTF(1, ")\n");
-
- }
- md1++;
- }
- }
- }
- }
- count++;
- md++;
- }
-
- MEM_freeN(maindata);
-
- return 0;
+ /* read include file, skip structs with a '#' before it.
+ * store all data in temporal arrays.
+ */
+ int maindata_len, count, slen, type, name, strct;
+ short *structpoin, *sp;
+ char *maindata, *mainend, *md, *md1;
+ bool skip_struct;
+
+ md = maindata = read_file_data(filename, &maindata_len);
+ if (maindata_len == -1) {
+ fprintf(stderr, "Can't read file %s\n", filename);
+ return 1;
+ }
+
+ maindata_len = preprocess_include(maindata, maindata_len);
+ mainend = maindata + maindata_len - 1;
+
+ /* we look for '{' and then back to 'struct' */
+ count = 0;
+ skip_struct = false;
+ while (count < maindata_len) {
+
+ /* code for skipping a struct: two hashes on 2 lines. (preprocess added a space) */
+ if (md[0] == '#' && md[1] == ' ' && md[2] == '#') {
+ skip_struct = true;
+ }
+
+ if (md[0] == '{') {
+ md[0] = 0;
+ if (skip_struct) {
+ skip_struct = false;
+ }
+ else {
+ if (md[-1] == ' ') {
+ md[-1] = 0;
+ }
+ md1 = md - 2;
+ while (*md1 != 32) {
+ /* to beginning of word */
+ md1--;
+ }
+ md1++;
+
+ /* we've got a struct name when... */
+ if (strncmp(md1 - 7, "struct", 6) == 0) {
+
+ strct = add_type(md1, 0);
+ if (strct == -1) {
+ fprintf(stderr, "File '%s' contains struct we cant parse \"%s\"\n", filename, md1);
+ return 1;
+ }
+
+ structpoin = add_struct(strct);
+ sp = structpoin + 2;
+
+ DEBUG_PRINTF(1, "\t|\t|-- detected struct %s\n", types[strct]);
+
+ /* first lets make it all nice strings */
+ md1 = md + 1;
+ while (*md1 != '}') {
+ if (md1 > mainend) {
+ break;
+ }
+
+ if (*md1 == ',' || *md1 == ' ') {
+ *md1 = 0;
+ }
+ md1++;
+ }
+
+ /* read types and names until first character that is not '}' */
+ md1 = md + 1;
+ while (*md1 != '}') {
+ if (md1 > mainend) {
+ break;
+ }
+
+ /* skip when it says 'struct' or 'unsigned' or 'const' */
+ if (*md1) {
+ if (strncmp(md1, "struct", 6) == 0) {
+ md1 += 7;
+ }
+ if (strncmp(md1, "unsigned", 8) == 0) {
+ md1 += 9;
+ }
+ if (strncmp(md1, "const", 5) == 0) {
+ md1 += 6;
+ }
+
+ /* we've got a type! */
+ type = add_type(md1, 0);
+ if (type == -1) {
+ fprintf(
+ stderr, "File '%s' contains struct we can't parse \"%s\"\n", filename, md1);
+ return 1;
+ }
+
+ DEBUG_PRINTF(1, "\t|\t|\tfound type %s (", md1);
+
+ md1 += strlen(md1);
+
+ /* read until ';' */
+ while (*md1 != ';') {
+ if (md1 > mainend) {
+ break;
+ }
+
+ if (*md1) {
+ /* We've got a name. slen needs
+ * correction for function
+ * pointers! */
+ slen = (int)strlen(md1);
+ if (md1[slen - 1] == ';') {
+ md1[slen - 1] = 0;
+
+ name = add_name(version_elem_static_from_alias(strct, md1));
+ if (name == -1) {
+ fprintf(stderr,
+ "File '%s' contains struct with name that can't be added \"%s\"\n",
+ filename,
+ md1);
+ return 1;
+ }
+ slen += additional_slen_offset;
+ sp[0] = type;
+ sp[1] = name;
+
+ if (names[name] != NULL) {
+ DEBUG_PRINTF(1, "%s |", names[name]);
+ }
+
+ structpoin[1]++;
+ sp += 2;
+
+ md1 += slen;
+ break;
+ }
+
+ name = add_name(version_elem_static_from_alias(strct, md1));
+ if (name == -1) {
+ fprintf(stderr,
+ "File '%s' contains struct with name that can't be added \"%s\"\n",
+ filename,
+ md1);
+ return 1;
+ }
+ slen += additional_slen_offset;
+
+ sp[0] = type;
+ sp[1] = name;
+ if (names[name] != NULL) {
+ DEBUG_PRINTF(1, "%s ||", names[name]);
+ }
+
+ structpoin[1]++;
+ sp += 2;
+
+ md1 += slen;
+ }
+ md1++;
+ }
+
+ DEBUG_PRINTF(1, ")\n");
+ }
+ md1++;
+ }
+ }
+ }
+ }
+ count++;
+ md++;
+ }
+
+ MEM_freeN(maindata);
+
+ return 0;
}
-static bool check_field_alignment(int firststruct, int structtype, int type, int len,
- const char *name, const char *detail)
+static bool check_field_alignment(
+ int firststruct, int structtype, int type, int len, const char *name, const char *detail)
{
- bool result = true;
- if (type < firststruct && types_size_native[type] > 4 && (len % 8)) {
- fprintf(stderr, "Align 8 error (%s) in struct: %s %s (add %d padding bytes)\n",
- detail, types[structtype], name, len % 8);
- result = false;
- }
- if (types_size_native[type] > 3 && (len % 4) ) {
- fprintf(stderr, "Align 4 error (%s) in struct: %s %s (add %d padding bytes)\n",
- detail, types[structtype], name, len % 4);
- result = false;
- }
- if (types_size_native[type] == 2 && (len % 2) ) {
- fprintf(stderr, "Align 2 error (%s) in struct: %s %s (add %d padding bytes)\n",
- detail, types[structtype], name, len % 2);
- result = false;
- }
- return result;
+ bool result = true;
+ if (type < firststruct && types_size_native[type] > 4 && (len % 8)) {
+ fprintf(stderr,
+ "Align 8 error (%s) in struct: %s %s (add %d padding bytes)\n",
+ detail,
+ types[structtype],
+ name,
+ len % 8);
+ result = false;
+ }
+ if (types_size_native[type] > 3 && (len % 4)) {
+ fprintf(stderr,
+ "Align 4 error (%s) in struct: %s %s (add %d padding bytes)\n",
+ detail,
+ types[structtype],
+ name,
+ len % 4);
+ result = false;
+ }
+ if (types_size_native[type] == 2 && (len % 2)) {
+ fprintf(stderr,
+ "Align 2 error (%s) in struct: %s %s (add %d padding bytes)\n",
+ detail,
+ types[structtype],
+ name,
+ len % 2);
+ result = false;
+ }
+ return result;
}
static int calculate_struct_sizes(int firststruct, FILE *file_verify, const char *base_directory)
{
- int unknown = nr_structs, lastunknown;
- bool dna_error = false;
-
- /* Write test to verify sizes are accurate. */
- fprintf(file_verify, "/* Verify struct sizes and member offsets are as expected by DNA. */\n");
- fprintf(file_verify, "#include \"BLI_assert.h\"\n\n");
- fprintf(file_verify, "#define DNA_DEPRECATED\n");
- for (int i = 0; *(includefiles[i]) != '\0'; i++) {
- fprintf(file_verify, "#include \"%s%s\"\n", base_directory, includefiles[i]);
- }
- fprintf(file_verify, "\n");
-
- /* Multiple iterations to handle nested structs. */
- while (unknown) {
- lastunknown = unknown;
- unknown = 0;
-
- /* check all structs... */
- for (int a = 0; a < nr_structs; a++) {
- const short *structpoin = structs[a];
- const int structtype = structpoin[0];
- const char *structname = version_struct_alias_from_static(types[structtype]);
-
- /* when length is not known... */
- if (types_size_native[structtype] == 0) {
-
- const short *sp = structpoin + 2;
- int size_native = 0;
- int size_32 = 0;
- int size_64 = 0;
- bool has_pointer = false;
-
- /* check all elements in struct */
- for (int b = 0; b < structpoin[1]; b++, sp += 2) {
- int type = sp[0];
- const char *cp = names[sp[1]];
- int namelen = (int)strlen(cp);
-
- /* Write size verification to file. */
- {
- char *name_static = alloca(namelen + 1);
- DNA_elem_id_strip_copy(name_static, cp);
- const char *str_pair[2] = {types[structtype], name_static};
- const char *name_alias = BLI_ghash_lookup(g_version_data.elem_map_alias_from_static, str_pair);
- fprintf(file_verify, "BLI_STATIC_ASSERT(offsetof(struct %s, %s) == %d, \"DNA member offset verify\");\n",
- structname, name_alias ? name_alias : name_static, size_native);
- }
-
- /* is it a pointer or function pointer? */
- if (cp[0] == '*' || cp[1] == '*') {
- has_pointer = 1;
- /* has the name an extra length? (array) */
- int mul = 1;
- if (cp[namelen - 1] == ']') {
- mul = DNA_elem_array_size(cp);
- }
-
- if (mul == 0) {
- fprintf(stderr, "Zero array size found or could not parse %s: '%.*s'\n",
- types[structtype], namelen + 1, cp);
- dna_error = 1;
- }
-
- /* 4-8 aligned/ */
- if (sizeof(void *) == 4) {
- if (size_native % 4) {
- fprintf(stderr, "Align pointer error in struct (size_native 4): %s %s\n",
- types[structtype], cp);
- dna_error = 1;
- }
- }
- else {
- if (size_native % 8) {
- fprintf(stderr, "Align pointer error in struct (size_native 8): %s %s\n",
- types[structtype], cp);
- dna_error = 1;
- }
- }
-
- if (size_64 % 8) {
- fprintf(stderr, "Align pointer error in struct (size_64 8): %s %s\n",
- types[structtype], cp);
- dna_error = 1;
- }
-
- size_native += sizeof(void *) * mul;
- size_32 += 4 * mul;
- size_64 += 8 * mul;
-
- }
- else if (cp[0] == '[') {
- /* parsing can cause names "var" and "[3]"
- * to be found for "float var [3]" */
- fprintf(stderr, "Parse error in struct, invalid member name: %s %s\n",
- types[structtype], cp);
- dna_error = 1;
- }
- else if (types_size_native[type]) {
- /* has the name an extra length? (array) */
- int mul = 1;
- if (cp[namelen - 1] == ']') {
- mul = DNA_elem_array_size(cp);
- }
-
- if (mul == 0) {
- fprintf(stderr, "Zero array size found or could not parse %s: '%.*s'\n",
- types[structtype], namelen + 1, cp);
- dna_error = 1;
- }
-
- /* struct alignment */
- if (type >= firststruct) {
- if (sizeof(void *) == 8 && (size_native % 8) ) {
- fprintf(stderr, "Align struct error: %s %s\n",
- types[structtype], cp);
- dna_error = 1;
- }
- }
-
- /* Check 2-4-8 aligned. */
- if (!check_field_alignment(firststruct, structtype, type, size_32, cp, "32 bit")) {
- dna_error = 1;
- }
- if (!check_field_alignment(firststruct, structtype, type, size_64, cp, "64 bit")) {
- dna_error = 1;
- }
-
- size_native += mul * types_size_native[type];
- size_32 += mul * types_size_32[type];
- size_64 += mul * types_size_64[type];
-
- }
- else {
- size_native = 0;
- size_32 = 0;
- size_64 = 0;
- break;
- }
- }
-
- if (size_native == 0) {
- unknown++;
- }
- else {
- types_size_native[structtype] = size_native;
- types_size_32[structtype] = size_32;
- types_size_64[structtype] = size_64;
- /* two ways to detect if a struct contains a pointer:
- * has_pointer is set or size_native doesn't match any of 32/64bit lengths*/
- if (has_pointer || size_64 != size_native || size_32 != size_native) {
- if (size_64 % 8) {
- fprintf(stderr, "Sizeerror 8 in struct: %s (add %d bytes)\n",
- types[structtype], size_64 % 8);
- dna_error = 1;
- }
- }
-
- if (size_native % 4) {
- fprintf(stderr, "Sizeerror 4 in struct: %s (add %d bytes)\n",
- types[structtype], size_native % 4);
- dna_error = 1;
- }
-
- /* Write size verification to file. */
- fprintf(file_verify, "BLI_STATIC_ASSERT(sizeof(struct %s) == %d, \"DNA struct size verify\");\n\n", structname, size_native);
- }
- }
- }
-
- if (unknown == lastunknown) {
- break;
- }
- }
-
- if (unknown) {
- fprintf(stderr, "ERROR: still %d structs unknown\n", unknown);
-
- if (debugSDNA) {
- fprintf(stderr, "*** Known structs :\n");
-
- for (int a = 0; a < nr_structs; a++) {
- const short *structpoin = structs[a];
- const int structtype = structpoin[0];
-
- /* length unknown */
- if (types_size_native[structtype] != 0) {
- fprintf(stderr, " %s\n", types[structtype]);
- }
- }
- }
-
-
- fprintf(stderr, "*** Unknown structs :\n");
-
- for (int a = 0; a < nr_structs; a++) {
- const short *structpoin = structs[a];
- const int structtype = structpoin[0];
-
- /* length unknown yet */
- if (types_size_native[structtype] == 0) {
- fprintf(stderr, " %s\n", types[structtype]);
- }
- }
-
- dna_error = 1;
- }
-
- return dna_error;
+ int unknown = nr_structs, lastunknown;
+ bool dna_error = false;
+
+ /* Write test to verify sizes are accurate. */
+ fprintf(file_verify, "/* Verify struct sizes and member offsets are as expected by DNA. */\n");
+ fprintf(file_verify, "#include \"BLI_assert.h\"\n\n");
+ fprintf(file_verify, "#define DNA_DEPRECATED\n");
+ for (int i = 0; *(includefiles[i]) != '\0'; i++) {
+ fprintf(file_verify, "#include \"%s%s\"\n", base_directory, includefiles[i]);
+ }
+ fprintf(file_verify, "\n");
+
+ /* Multiple iterations to handle nested structs. */
+ while (unknown) {
+ lastunknown = unknown;
+ unknown = 0;
+
+ /* check all structs... */
+ for (int a = 0; a < nr_structs; a++) {
+ const short *structpoin = structs[a];
+ const int structtype = structpoin[0];
+ const char *structname = version_struct_alias_from_static(types[structtype]);
+
+ /* when length is not known... */
+ if (types_size_native[structtype] == 0) {
+
+ const short *sp = structpoin + 2;
+ int size_native = 0;
+ int size_32 = 0;
+ int size_64 = 0;
+ bool has_pointer = false;
+
+ /* check all elements in struct */
+ for (int b = 0; b < structpoin[1]; b++, sp += 2) {
+ int type = sp[0];
+ const char *cp = names[sp[1]];
+ int namelen = (int)strlen(cp);
+
+ /* Write size verification to file. */
+ {
+ char *name_static = alloca(namelen + 1);
+ DNA_elem_id_strip_copy(name_static, cp);
+ const char *str_pair[2] = {types[structtype], name_static};
+ const char *name_alias = BLI_ghash_lookup(g_version_data.elem_map_alias_from_static,
+ str_pair);
+ fprintf(file_verify,
+ "BLI_STATIC_ASSERT(offsetof(struct %s, %s) == %d, \"DNA member offset "
+ "verify\");\n",
+ structname,
+ name_alias ? name_alias : name_static,
+ size_native);
+ }
+
+ /* is it a pointer or function pointer? */
+ if (cp[0] == '*' || cp[1] == '*') {
+ has_pointer = 1;
+ /* has the name an extra length? (array) */
+ int mul = 1;
+ if (cp[namelen - 1] == ']') {
+ mul = DNA_elem_array_size(cp);
+ }
+
+ if (mul == 0) {
+ fprintf(stderr,
+ "Zero array size found or could not parse %s: '%.*s'\n",
+ types[structtype],
+ namelen + 1,
+ cp);
+ dna_error = 1;
+ }
+
+ /* 4-8 aligned/ */
+ if (sizeof(void *) == 4) {
+ if (size_native % 4) {
+ fprintf(stderr,
+ "Align pointer error in struct (size_native 4): %s %s\n",
+ types[structtype],
+ cp);
+ dna_error = 1;
+ }
+ }
+ else {
+ if (size_native % 8) {
+ fprintf(stderr,
+ "Align pointer error in struct (size_native 8): %s %s\n",
+ types[structtype],
+ cp);
+ dna_error = 1;
+ }
+ }
+
+ if (size_64 % 8) {
+ fprintf(stderr,
+ "Align pointer error in struct (size_64 8): %s %s\n",
+ types[structtype],
+ cp);
+ dna_error = 1;
+ }
+
+ size_native += sizeof(void *) * mul;
+ size_32 += 4 * mul;
+ size_64 += 8 * mul;
+ }
+ else if (cp[0] == '[') {
+ /* parsing can cause names "var" and "[3]"
+ * to be found for "float var [3]" */
+ fprintf(stderr,
+ "Parse error in struct, invalid member name: %s %s\n",
+ types[structtype],
+ cp);
+ dna_error = 1;
+ }
+ else if (types_size_native[type]) {
+ /* has the name an extra length? (array) */
+ int mul = 1;
+ if (cp[namelen - 1] == ']') {
+ mul = DNA_elem_array_size(cp);
+ }
+
+ if (mul == 0) {
+ fprintf(stderr,
+ "Zero array size found or could not parse %s: '%.*s'\n",
+ types[structtype],
+ namelen + 1,
+ cp);
+ dna_error = 1;
+ }
+
+ /* struct alignment */
+ if (type >= firststruct) {
+ if (sizeof(void *) == 8 && (size_native % 8)) {
+ fprintf(stderr, "Align struct error: %s %s\n", types[structtype], cp);
+ dna_error = 1;
+ }
+ }
+
+ /* Check 2-4-8 aligned. */
+ if (!check_field_alignment(firststruct, structtype, type, size_32, cp, "32 bit")) {
+ dna_error = 1;
+ }
+ if (!check_field_alignment(firststruct, structtype, type, size_64, cp, "64 bit")) {
+ dna_error = 1;
+ }
+
+ size_native += mul * types_size_native[type];
+ size_32 += mul * types_size_32[type];
+ size_64 += mul * types_size_64[type];
+ }
+ else {
+ size_native = 0;
+ size_32 = 0;
+ size_64 = 0;
+ break;
+ }
+ }
+
+ if (size_native == 0) {
+ unknown++;
+ }
+ else {
+ types_size_native[structtype] = size_native;
+ types_size_32[structtype] = size_32;
+ types_size_64[structtype] = size_64;
+ /* two ways to detect if a struct contains a pointer:
+ * has_pointer is set or size_native doesn't match any of 32/64bit lengths*/
+ if (has_pointer || size_64 != size_native || size_32 != size_native) {
+ if (size_64 % 8) {
+ fprintf(stderr,
+ "Sizeerror 8 in struct: %s (add %d bytes)\n",
+ types[structtype],
+ size_64 % 8);
+ dna_error = 1;
+ }
+ }
+
+ if (size_native % 4) {
+ fprintf(stderr,
+ "Sizeerror 4 in struct: %s (add %d bytes)\n",
+ types[structtype],
+ size_native % 4);
+ dna_error = 1;
+ }
+
+ /* Write size verification to file. */
+ fprintf(file_verify,
+ "BLI_STATIC_ASSERT(sizeof(struct %s) == %d, \"DNA struct size verify\");\n\n",
+ structname,
+ size_native);
+ }
+ }
+ }
+
+ if (unknown == lastunknown) {
+ break;
+ }
+ }
+
+ if (unknown) {
+ fprintf(stderr, "ERROR: still %d structs unknown\n", unknown);
+
+ if (debugSDNA) {
+ fprintf(stderr, "*** Known structs :\n");
+
+ for (int a = 0; a < nr_structs; a++) {
+ const short *structpoin = structs[a];
+ const int structtype = structpoin[0];
+
+ /* length unknown */
+ if (types_size_native[structtype] != 0) {
+ fprintf(stderr, " %s\n", types[structtype]);
+ }
+ }
+ }
+
+ fprintf(stderr, "*** Unknown structs :\n");
+
+ for (int a = 0; a < nr_structs; a++) {
+ const short *structpoin = structs[a];
+ const int structtype = structpoin[0];
+
+ /* length unknown yet */
+ if (types_size_native[structtype] == 0) {
+ fprintf(stderr, " %s\n", types[structtype]);
+ }
+ }
+
+ dna_error = 1;
+ }
+
+ return dna_error;
}
#define MAX_DNA_LINE_LENGTH 20
static void dna_write(FILE *file, const void *pntr, const int size)
{
- static int linelength = 0;
- int i;
- const char *data;
-
- data = (const char *)pntr;
-
- for (i = 0; i < size; i++) {
- fprintf(file, "%d, ", data[i]);
- linelength++;
- if (linelength >= MAX_DNA_LINE_LENGTH) {
- fprintf(file, "\n");
- linelength = 0;
- }
- }
+ static int linelength = 0;
+ int i;
+ const char *data;
+
+ data = (const char *)pntr;
+
+ for (i = 0; i < size; i++) {
+ fprintf(file, "%d, ", data[i]);
+ linelength++;
+ if (linelength >= MAX_DNA_LINE_LENGTH) {
+ fprintf(file, "\n");
+ linelength = 0;
+ }
+ }
}
void print_struct_sizes(void)
{
- int a, unknown = nr_structs, structtype;
- /*int lastunknown;*/ /*UNUSED*/
- const short *structpoin;
- printf("\n\n*** All detected structs:\n");
-
- while (unknown) {
- /*lastunknown = unknown;*/ /*UNUSED*/
- unknown = 0;
-
- /* check all structs... */
- for (a = 0; a < nr_structs; a++) {
- structpoin = structs[a];
- structtype = structpoin[0];
- printf("\t%s\t:%d\n", types[structtype], types_size_native[structtype]);
- }
- }
-
- printf("*** End of list\n");
-
+ int a, unknown = nr_structs, structtype;
+ /*int lastunknown;*/ /*UNUSED*/
+ const short *structpoin;
+ printf("\n\n*** All detected structs:\n");
+
+ while (unknown) {
+ /*lastunknown = unknown;*/ /*UNUSED*/
+ unknown = 0;
+
+ /* check all structs... */
+ for (a = 0; a < nr_structs; a++) {
+ structpoin = structs[a];
+ structtype = structpoin[0];
+ printf("\t%s\t:%d\n", types[structtype], types_size_native[structtype]);
+ }
+ }
+
+ printf("*** End of list\n");
}
-
-static int make_structDNA(const char *base_directory, FILE *file, FILE *file_offsets, FILE *file_verify)
+static int make_structDNA(const char *base_directory,
+ FILE *file,
+ FILE *file_offsets,
+ FILE *file_verify)
{
- int i;
- const short *sp;
- /* str contains filenames. Since we now include paths, I stretched */
- /* it a bit. Hope this is enough :) -nzc- */
- char str[SDNA_MAX_FILENAME_LENGTH];
- int firststruct;
-
- if (debugSDNA > 0) {
- fflush(stdout);
- printf("Running makesdna at debug level %d\n", debugSDNA);
- }
-
- mem_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
-
- /* the longest known struct is 50k, so we assume 100k is sufficient! */
- structdata = MEM_callocN(maxdata, "structdata");
-
- /* a maximum of 5000 variables, must be sufficient? */
- names = MEM_callocN(sizeof(char *) * maxnr, "names");
- types = MEM_callocN(sizeof(char *) * maxnr, "types");
- types_size_native = MEM_callocN(sizeof(short) * maxnr, "types_size_native");
- types_size_32 = MEM_callocN(sizeof(short) * maxnr, "types_size_32");
- types_size_64 = MEM_callocN(sizeof(short) * maxnr, "types_size_64");
- structs = MEM_callocN(sizeof(short *) * maxnr, "structs");
-
- /* Build versioning data */
- DNA_alias_maps(
- DNA_RENAME_ALIAS_FROM_STATIC,
- &g_version_data.struct_map_alias_from_static,
- &g_version_data.elem_map_alias_from_static);
- DNA_alias_maps(
- DNA_RENAME_STATIC_FROM_ALIAS,
- &g_version_data.struct_map_static_from_alias,
- &g_version_data.elem_map_static_from_alias);
-
- /**
- * Insertion of all known types.
- *
- * \warning Order of function calls here must be aligned with #eSDNA_Type.
- * \warning uint is not allowed! use in structs an unsigned int.
- * \warning sizes must match #DNA_elem_type_size().
- */
- add_type("char", 1); /* SDNA_TYPE_CHAR */
- add_type("uchar", 1); /* SDNA_TYPE_UCHAR */
- add_type("short", 2); /* SDNA_TYPE_SHORT */
- add_type("ushort", 2); /* SDNA_TYPE_USHORT */
- add_type("int", 4); /* SDNA_TYPE_INT */
-
- /* note, long isn't supported,
- * these are place-holders to maintain alignment with eSDNA_Type*/
- add_type("long", 4); /* SDNA_TYPE_LONG */
- add_type("ulong", 4); /* SDNA_TYPE_ULONG */
-
- add_type("float", 4); /* SDNA_TYPE_FLOAT */
- add_type("double", 8); /* SDNA_TYPE_DOUBLE */
- add_type("int64_t", 8); /* SDNA_TYPE_INT64 */
- add_type("uint64_t", 8); /* SDNA_TYPE_UINT64 */
- add_type("void", 0); /* SDNA_TYPE_VOID */
-
- /* the defines above shouldn't be output in the padding file... */
- firststruct = nr_types;
-
- /* add all include files defined in the global array */
- /* Since the internal file+path name buffer has limited length, I do a */
- /* little test first... */
- /* Mind the breaking condition here! */
- DEBUG_PRINTF(0, "\tStart of header scan:\n");
- for (i = 0; *(includefiles[i]) != '\0'; i++) {
- sprintf(str, "%s%s", base_directory, includefiles[i]);
- DEBUG_PRINTF(0, "\t|-- Converting %s\n", str);
- if (convert_include(str)) {
- return 1;
- }
- }
- DEBUG_PRINTF(0, "\tFinished scanning %d headers.\n", i);
-
- if (calculate_struct_sizes(firststruct, file_verify, base_directory)) {
- /* error */
- return 1;
- }
-
- /* FOR DEBUG */
- if (debugSDNA > 1) {
- int a, b;
- /* short *elem; */
- short num_types;
-
- printf("nr_names %d nr_types %d nr_structs %d\n", nr_names, nr_types, nr_structs);
- for (a = 0; a < nr_names; a++) {
- printf(" %s\n", names[a]);
- }
- printf("\n");
-
- sp = types_size_native;
- for (a = 0; a < nr_types; a++, sp++) {
- printf(" %s %d\n", types[a], *sp);
- }
- printf("\n");
-
- for (a = 0; a < nr_structs; a++) {
- sp = structs[a];
- printf(" struct %s elems: %d size: %d\n", types[sp[0]], sp[1], types_size_native[sp[0]]);
- num_types = sp[1];
- sp += 2;
- /* ? num_types was elem? */
- for (b = 0; b < num_types; b++, sp += 2) {
- printf(" %s %s\n", types[sp[0]], names[sp[1]]);
- }
- }
- }
-
- /* file writing */
-
- DEBUG_PRINTF(0, "Writing file ... ");
-
- if (nr_names == 0 || nr_structs == 0) {
- /* pass */
- }
- else {
- const char nil_bytes[4] = {0};
- int len, len_align;
-
- dna_write(file, "SDNA", 4);
-
- /* write names */
- dna_write(file, "NAME", 4);
- len = nr_names;
- dna_write(file, &len, 4);
- /* write array */
- len = 0;
- for (int nr = 0; nr < nr_names; nr++) {
- int name_size = strlen(names[nr]) + 1;
- dna_write(file, names[nr], name_size);
- len += name_size;
- }
- len_align = (len + 3) & ~3;
- if (len != len_align) {
- dna_write(file, nil_bytes, len_align - len);
- }
-
- /* write TYPES */
- dna_write(file, "TYPE", 4);
- len = nr_types;
- dna_write(file, &len, 4);
- /* write array */
- len = 0;
- for (int nr = 0; nr < nr_types; nr++) {
- int type_size = strlen(types[nr]) + 1;
- dna_write(file, types[nr], type_size);
- len += type_size;
- }
- len_align = (len + 3) & ~3;
- if (len != len_align) {
- dna_write(file, nil_bytes, len_align - len);
- }
-
- /* WRITE TYPELENGTHS */
- dna_write(file, "TLEN", 4);
-
- len = 2 * nr_types;
- if (nr_types & 1) {
- len += 2;
- }
- dna_write(file, types_size_native, len);
-
- /* WRITE STRUCTS */
- dna_write(file, "STRC", 4);
- len = nr_structs;
- dna_write(file, &len, 4);
-
- /* calc datablock size */
- sp = structs[nr_structs - 1];
- sp += 2 + 2 * (sp[1]);
- len = (intptr_t) ((char *) sp - (char *) structs[0]);
- len = (len + 3) & ~3;
-
- dna_write(file, structs[0], len);
-
- }
-
- /* write a simple enum with all structs offsets,
- * should only be accessed via SDNA_TYPE_FROM_STRUCT macro */
- {
- fprintf(file_offsets, "#define SDNA_TYPE_FROM_STRUCT(id) _SDNA_TYPE_##id\n");
- fprintf(file_offsets, "enum {\n");
- for (i = 0; i < nr_structs; i++) {
- const short *structpoin = structs[i];
- const int structtype = structpoin[0];
- fprintf(file_offsets, "\t_SDNA_TYPE_%s = %d,\n", version_struct_alias_from_static(types[structtype]), i);
- }
- fprintf(file_offsets, "\tSDNA_TYPE_MAX = %d,\n", nr_structs);
- fprintf(file_offsets, "};\n\n");
- }
-
- /* Check versioning errors which could cause duplicate names,
- * do last because names are stripped. */
- {
- GSet *names_unique = BLI_gset_str_new_ex(__func__, 512);
- for (int struct_nr = 0; struct_nr < nr_structs; struct_nr++) {
- sp = structs[struct_nr];
- const char *struct_name = types[sp[0]];
- const int len = sp[1];
- sp += 2;
- for (int a = 0; a < len; a++, sp += 2) {
- char *name = names[sp[1]];
- DNA_elem_id_strip(name);
- if (!BLI_gset_add(names_unique, name)) {
- fprintf(stderr, "Error: duplicate name found '%s.%s', "
- "likely cause is 'dna_rename_defs.h'\n",
- struct_name, name);
- return 1;
- }
- }
- BLI_gset_clear(names_unique, NULL);
- }
- BLI_gset_free(names_unique, NULL);
- }
-
- MEM_freeN(structdata);
- MEM_freeN(names);
- MEM_freeN(types);
- MEM_freeN(types_size_native);
- MEM_freeN(types_size_32);
- MEM_freeN(types_size_64);
- MEM_freeN(structs);
-
- BLI_memarena_free(mem_arena);
-
- BLI_ghash_free(g_version_data.struct_map_alias_from_static, NULL, NULL);
- BLI_ghash_free(g_version_data.struct_map_static_from_alias, NULL, NULL);
- BLI_ghash_free(g_version_data.elem_map_static_from_alias, MEM_freeN, NULL);
- BLI_ghash_free(g_version_data.elem_map_alias_from_static, MEM_freeN, NULL);
-
- DEBUG_PRINTF(0, "done.\n");
-
- return 0;
+ int i;
+ const short *sp;
+ /* str contains filenames. Since we now include paths, I stretched */
+ /* it a bit. Hope this is enough :) -nzc- */
+ char str[SDNA_MAX_FILENAME_LENGTH];
+ int firststruct;
+
+ if (debugSDNA > 0) {
+ fflush(stdout);
+ printf("Running makesdna at debug level %d\n", debugSDNA);
+ }
+
+ mem_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
+
+ /* the longest known struct is 50k, so we assume 100k is sufficient! */
+ structdata = MEM_callocN(maxdata, "structdata");
+
+ /* a maximum of 5000 variables, must be sufficient? */
+ names = MEM_callocN(sizeof(char *) * maxnr, "names");
+ types = MEM_callocN(sizeof(char *) * maxnr, "types");
+ types_size_native = MEM_callocN(sizeof(short) * maxnr, "types_size_native");
+ types_size_32 = MEM_callocN(sizeof(short) * maxnr, "types_size_32");
+ types_size_64 = MEM_callocN(sizeof(short) * maxnr, "types_size_64");
+ structs = MEM_callocN(sizeof(short *) * maxnr, "structs");
+
+ /* Build versioning data */
+ DNA_alias_maps(DNA_RENAME_ALIAS_FROM_STATIC,
+ &g_version_data.struct_map_alias_from_static,
+ &g_version_data.elem_map_alias_from_static);
+ DNA_alias_maps(DNA_RENAME_STATIC_FROM_ALIAS,
+ &g_version_data.struct_map_static_from_alias,
+ &g_version_data.elem_map_static_from_alias);
+
+ /**
+ * Insertion of all known types.
+ *
+ * \warning Order of function calls here must be aligned with #eSDNA_Type.
+ * \warning uint is not allowed! use in structs an unsigned int.
+ * \warning sizes must match #DNA_elem_type_size().
+ */
+ add_type("char", 1); /* SDNA_TYPE_CHAR */
+ add_type("uchar", 1); /* SDNA_TYPE_UCHAR */
+ add_type("short", 2); /* SDNA_TYPE_SHORT */
+ add_type("ushort", 2); /* SDNA_TYPE_USHORT */
+ add_type("int", 4); /* SDNA_TYPE_INT */
+
+ /* note, long isn't supported,
+ * these are place-holders to maintain alignment with eSDNA_Type*/
+ add_type("long", 4); /* SDNA_TYPE_LONG */
+ add_type("ulong", 4); /* SDNA_TYPE_ULONG */
+
+ add_type("float", 4); /* SDNA_TYPE_FLOAT */
+ add_type("double", 8); /* SDNA_TYPE_DOUBLE */
+ add_type("int64_t", 8); /* SDNA_TYPE_INT64 */
+ add_type("uint64_t", 8); /* SDNA_TYPE_UINT64 */
+ add_type("void", 0); /* SDNA_TYPE_VOID */
+
+ /* the defines above shouldn't be output in the padding file... */
+ firststruct = nr_types;
+
+ /* add all include files defined in the global array */
+ /* Since the internal file+path name buffer has limited length, I do a */
+ /* little test first... */
+ /* Mind the breaking condition here! */
+ DEBUG_PRINTF(0, "\tStart of header scan:\n");
+ for (i = 0; *(includefiles[i]) != '\0'; i++) {
+ sprintf(str, "%s%s", base_directory, includefiles[i]);
+ DEBUG_PRINTF(0, "\t|-- Converting %s\n", str);
+ if (convert_include(str)) {
+ return 1;
+ }
+ }
+ DEBUG_PRINTF(0, "\tFinished scanning %d headers.\n", i);
+
+ if (calculate_struct_sizes(firststruct, file_verify, base_directory)) {
+ /* error */
+ return 1;
+ }
+
+ /* FOR DEBUG */
+ if (debugSDNA > 1) {
+ int a, b;
+ /* short *elem; */
+ short num_types;
+
+ printf("nr_names %d nr_types %d nr_structs %d\n", nr_names, nr_types, nr_structs);
+ for (a = 0; a < nr_names; a++) {
+ printf(" %s\n", names[a]);
+ }
+ printf("\n");
+
+ sp = types_size_native;
+ for (a = 0; a < nr_types; a++, sp++) {
+ printf(" %s %d\n", types[a], *sp);
+ }
+ printf("\n");
+
+ for (a = 0; a < nr_structs; a++) {
+ sp = structs[a];
+ printf(" struct %s elems: %d size: %d\n", types[sp[0]], sp[1], types_size_native[sp[0]]);
+ num_types = sp[1];
+ sp += 2;
+ /* ? num_types was elem? */
+ for (b = 0; b < num_types; b++, sp += 2) {
+ printf(" %s %s\n", types[sp[0]], names[sp[1]]);
+ }
+ }
+ }
+
+ /* file writing */
+
+ DEBUG_PRINTF(0, "Writing file ... ");
+
+ if (nr_names == 0 || nr_structs == 0) {
+ /* pass */
+ }
+ else {
+ const char nil_bytes[4] = {0};
+ int len, len_align;
+
+ dna_write(file, "SDNA", 4);
+
+ /* write names */
+ dna_write(file, "NAME", 4);
+ len = nr_names;
+ dna_write(file, &len, 4);
+ /* write array */
+ len = 0;
+ for (int nr = 0; nr < nr_names; nr++) {
+ int name_size = strlen(names[nr]) + 1;
+ dna_write(file, names[nr], name_size);
+ len += name_size;
+ }
+ len_align = (len + 3) & ~3;
+ if (len != len_align) {
+ dna_write(file, nil_bytes, len_align - len);
+ }
+
+ /* write TYPES */
+ dna_write(file, "TYPE", 4);
+ len = nr_types;
+ dna_write(file, &len, 4);
+ /* write array */
+ len = 0;
+ for (int nr = 0; nr < nr_types; nr++) {
+ int type_size = strlen(types[nr]) + 1;
+ dna_write(file, types[nr], type_size);
+ len += type_size;
+ }
+ len_align = (len + 3) & ~3;
+ if (len != len_align) {
+ dna_write(file, nil_bytes, len_align - len);
+ }
+
+ /* WRITE TYPELENGTHS */
+ dna_write(file, "TLEN", 4);
+
+ len = 2 * nr_types;
+ if (nr_types & 1) {
+ len += 2;
+ }
+ dna_write(file, types_size_native, len);
+
+ /* WRITE STRUCTS */
+ dna_write(file, "STRC", 4);
+ len = nr_structs;
+ dna_write(file, &len, 4);
+
+ /* calc datablock size */
+ sp = structs[nr_structs - 1];
+ sp += 2 + 2 * (sp[1]);
+ len = (intptr_t)((char *)sp - (char *)structs[0]);
+ len = (len + 3) & ~3;
+
+ dna_write(file, structs[0], len);
+ }
+
+ /* write a simple enum with all structs offsets,
+ * should only be accessed via SDNA_TYPE_FROM_STRUCT macro */
+ {
+ fprintf(file_offsets, "#define SDNA_TYPE_FROM_STRUCT(id) _SDNA_TYPE_##id\n");
+ fprintf(file_offsets, "enum {\n");
+ for (i = 0; i < nr_structs; i++) {
+ const short *structpoin = structs[i];
+ const int structtype = structpoin[0];
+ fprintf(file_offsets,
+ "\t_SDNA_TYPE_%s = %d,\n",
+ version_struct_alias_from_static(types[structtype]),
+ i);
+ }
+ fprintf(file_offsets, "\tSDNA_TYPE_MAX = %d,\n", nr_structs);
+ fprintf(file_offsets, "};\n\n");
+ }
+
+ /* Check versioning errors which could cause duplicate names,
+ * do last because names are stripped. */
+ {
+ GSet *names_unique = BLI_gset_str_new_ex(__func__, 512);
+ for (int struct_nr = 0; struct_nr < nr_structs; struct_nr++) {
+ sp = structs[struct_nr];
+ const char *struct_name = types[sp[0]];
+ const int len = sp[1];
+ sp += 2;
+ for (int a = 0; a < len; a++, sp += 2) {
+ char *name = names[sp[1]];
+ DNA_elem_id_strip(name);
+ if (!BLI_gset_add(names_unique, name)) {
+ fprintf(stderr,
+ "Error: duplicate name found '%s.%s', "
+ "likely cause is 'dna_rename_defs.h'\n",
+ struct_name,
+ name);
+ return 1;
+ }
+ }
+ BLI_gset_clear(names_unique, NULL);
+ }
+ BLI_gset_free(names_unique, NULL);
+ }
+
+ MEM_freeN(structdata);
+ MEM_freeN(names);
+ MEM_freeN(types);
+ MEM_freeN(types_size_native);
+ MEM_freeN(types_size_32);
+ MEM_freeN(types_size_64);
+ MEM_freeN(structs);
+
+ BLI_memarena_free(mem_arena);
+
+ BLI_ghash_free(g_version_data.struct_map_alias_from_static, NULL, NULL);
+ BLI_ghash_free(g_version_data.struct_map_static_from_alias, NULL, NULL);
+ BLI_ghash_free(g_version_data.elem_map_static_from_alias, MEM_freeN, NULL);
+ BLI_ghash_free(g_version_data.elem_map_alias_from_static, MEM_freeN, NULL);
+
+ DEBUG_PRINTF(0, "done.\n");
+
+ return 0;
}
/** \} */
@@ -1368,80 +1423,80 @@ static int make_structDNA(const char *base_directory, FILE *file, FILE *file_off
static void make_bad_file(const char *file, int line)
{
- FILE *fp = fopen(file, "w");
- fprintf(fp,
- "#error \"Error! can't make correct DNA.c file from %s:%d, check alignment.\"\n",
- __FILE__, line);
- fclose(fp);
+ FILE *fp = fopen(file, "w");
+ fprintf(fp,
+ "#error \"Error! can't make correct DNA.c file from %s:%d, check alignment.\"\n",
+ __FILE__,
+ line);
+ fclose(fp);
}
#ifndef BASE_HEADER
-#define BASE_HEADER "../"
+# define BASE_HEADER "../"
#endif
int main(int argc, char **argv)
{
- int return_status = 0;
-
- if (argc != 4 && argc != 5) {
- printf("Usage: %s dna.c dna_struct_offsets.h [base directory]\n", argv[0]);
- return_status = 1;
- }
- else {
- FILE *file_dna = fopen(argv[1], "w");
- FILE *file_dna_offsets = fopen(argv[2], "w");
- FILE *file_dna_verify = fopen(argv[3], "w");
- if (!file_dna) {
- printf("Unable to open file: %s\n", argv[1]);
- return_status = 1;
- }
- else if (!file_dna_offsets) {
- printf("Unable to open file: %s\n", argv[2]);
- return_status = 1;
- }
- else if (!file_dna_verify) {
- printf("Unable to open file: %s\n", argv[3]);
- return_status = 1;
- }
- else {
- const char *base_directory;
-
- if (argc == 5) {
- base_directory = argv[4];
- }
- else {
- base_directory = BASE_HEADER;
- }
-
- fprintf(file_dna, "extern const unsigned char DNAstr[];\n");
- fprintf(file_dna, "const unsigned char DNAstr[] = {\n");
- if (make_structDNA(base_directory, file_dna, file_dna_offsets, file_dna_verify)) {
- /* error */
- fclose(file_dna);
- file_dna = NULL;
- make_bad_file(argv[1], __LINE__);
- return_status = 1;
- }
- else {
- fprintf(file_dna, "};\n");
- fprintf(file_dna, "extern const int DNAlen;\n");
- fprintf(file_dna, "const int DNAlen = sizeof(DNAstr);\n");
- }
- }
-
- if (file_dna) {
- fclose(file_dna);
- }
- if (file_dna_offsets) {
- fclose(file_dna_offsets);
- }
- if (file_dna_verify) {
- fclose(file_dna_verify);
- }
- }
-
-
- return return_status;
+ int return_status = 0;
+
+ if (argc != 4 && argc != 5) {
+ printf("Usage: %s dna.c dna_struct_offsets.h [base directory]\n", argv[0]);
+ return_status = 1;
+ }
+ else {
+ FILE *file_dna = fopen(argv[1], "w");
+ FILE *file_dna_offsets = fopen(argv[2], "w");
+ FILE *file_dna_verify = fopen(argv[3], "w");
+ if (!file_dna) {
+ printf("Unable to open file: %s\n", argv[1]);
+ return_status = 1;
+ }
+ else if (!file_dna_offsets) {
+ printf("Unable to open file: %s\n", argv[2]);
+ return_status = 1;
+ }
+ else if (!file_dna_verify) {
+ printf("Unable to open file: %s\n", argv[3]);
+ return_status = 1;
+ }
+ else {
+ const char *base_directory;
+
+ if (argc == 5) {
+ base_directory = argv[4];
+ }
+ else {
+ base_directory = BASE_HEADER;
+ }
+
+ fprintf(file_dna, "extern const unsigned char DNAstr[];\n");
+ fprintf(file_dna, "const unsigned char DNAstr[] = {\n");
+ if (make_structDNA(base_directory, file_dna, file_dna_offsets, file_dna_verify)) {
+ /* error */
+ fclose(file_dna);
+ file_dna = NULL;
+ make_bad_file(argv[1], __LINE__);
+ return_status = 1;
+ }
+ else {
+ fprintf(file_dna, "};\n");
+ fprintf(file_dna, "extern const int DNAlen;\n");
+ fprintf(file_dna, "const int DNAlen = sizeof(DNAstr);\n");
+ }
+ }
+
+ if (file_dna) {
+ fclose(file_dna);
+ }
+ if (file_dna_offsets) {
+ fclose(file_dna_offsets);
+ }
+ if (file_dna_verify) {
+ fclose(file_dna_verify);
+ }
+ }
+
+ return return_status;
}
/* handy but fails on struct bounds which makesdna doesn't care about
@@ -1451,9 +1506,9 @@ int main(int argc, char **argv)
/* extra safety check that we are aligned,
* warnings here are easier to fix the makesdna's */
-#ifdef __GNUC__
-# pragma GCC diagnostic error "-Wpadded"
-#endif
+# ifdef __GNUC__
+# pragma GCC diagnostic error "-Wpadded"
+# endif
#endif /* if 0 */
@@ -1535,7 +1590,6 @@ int main(int argc, char **argv)
/** \} */
-
/* -------------------------------------------------------------------- */
/** \name DNA Renaming Sanity Check
*