diff options
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 47 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 14 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_actuator_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_group_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_image_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 14 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_fluidsim.h | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 20 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_outliner_types.h | 50 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 20 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 127 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 25 | ||||
-rw-r--r-- | source/blender/makesdna/intern/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_genfile.c | 18 |
17 files changed, 314 insertions, 48 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 6b9de26f0a4..c2901b8b9a5 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -201,7 +201,12 @@ typedef struct PreviewImage { # define MAKE_ID2(c, d) ((d) << 8 | (c)) #endif -/* ID from database */ +/** + * ID from database. + * + * Written to #BHead.code (for file IO) + * and the first 2 bytes of #ID.name (for runtime checks, see #GS macro). + */ #define ID_SCE MAKE_ID2('S', 'C') /* Scene */ #define ID_LI MAKE_ID2('L', 'I') /* Library */ #define ID_OB MAKE_ID2('O', 'B') /* Object */ @@ -256,6 +261,8 @@ typedef struct PreviewImage { #define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : (_bmain)->name) +#define ID_MISSING(_id) (((_id)->flag & LIB_MISSING) != 0) + #ifdef GS # undef GS #endif @@ -275,6 +282,8 @@ enum { LIB_TESTIND = (LIB_NEED_EXPAND | LIB_INDIRECT), LIB_READ = 1 << 4, LIB_NEED_LINK = 1 << 5, + /* tag datablock as a place-holder (because the real one could not be linked from its library e.g.). */ + LIB_MISSING = 1 << 6, LIB_NEW = 1 << 8, LIB_FAKEUSER = 1 << 9, @@ -290,6 +299,42 @@ enum { LIB_ID_RECALC_ALL = (LIB_ID_RECALC | LIB_ID_RECALC_DATA), }; +/* To filter ID types (filter_id) */ +/* XXX We cannot put all needed IDs inside an enum... + * We'll have to see whether we can fit all needed ones inside 32 values, + * 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), +}; + #ifdef __cplusplus } #endif diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index b8688e5e12a..d574694c70d 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -198,7 +198,8 @@ typedef struct bPoseChannel { short agrp_index; /* index of action-group this bone belongs to (0 = default/no group) */ char constflag; /* for quick detecting which constraints affect this channel */ char selectflag; /* copy of bone flag, so you can work with library armatures, not for runtime use */ - char pad0[6]; + char drawflag; + char pad0[5]; struct Bone *bone; /* set on read file or rebuild pose */ struct bPoseChannel *parent; /* set on read file or rebuild pose */ @@ -212,6 +213,9 @@ typedef struct bPoseChannel { struct bPoseChannel *custom_tx; /* odd feature, display with another bones transform. * needed in rare cases for advanced rigs, * since the alternative is highly complicated - campbell */ + float custom_scale; + + char pad1[4]; /* transforms - written in by actions or transform */ float loc[3]; @@ -306,6 +310,14 @@ typedef enum ePchan_IkFlag { BONE_IK_NO_ZDOF_TEMP = (1 << 12) } ePchan_IkFlag; +/* PoseChannel->drawflag */ +typedef enum ePchan_DrawFlag { + 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) + /* PoseChannel->rotmode and Object->rotmode */ typedef enum eRotationModes { /* quaternion rotations (default, and for older Blender versions) */ diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index 9af0c1dac10..59a058925a6 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -512,6 +512,7 @@ typedef struct bActuator { #define ACT_GAME_QUIT 3 #define ACT_GAME_SAVECFG 4 #define ACT_GAME_LOADCFG 5 +#define ACT_GAME_SCREENSHOT 6 /* visibilityact->flag */ /* Set means the object will become invisible */ diff --git a/source/blender/makesdna/DNA_group_types.h b/source/blender/makesdna/DNA_group_types.h index 2740281b4c0..45dd0cb9ff2 100644 --- a/source/blender/makesdna/DNA_group_types.h +++ b/source/blender/makesdna/DNA_group_types.h @@ -52,7 +52,9 @@ typedef struct Group { ID id; ListBase gobject; /* GroupObject */ - + + struct PreviewImage *preview; + /* Bad design, since layers stored in the scenes 'Base' * the objects that show in the group can change depending * on the last used scene */ diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 6088dccd4e9..d112790eb47 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -55,7 +55,8 @@ typedef struct ImageUser { char ok; char multiview_eye; /* multiview current eye - for internal use of drawing routines */ - int passtype; + short pass; + short pad; short multi_index, view, layer; /* listbase indices, for menu browsing or retrieve buffer */ short flag; @@ -171,8 +172,8 @@ enum { IMA_IGNORE_ALPHA = (1 << 12), IMA_DEINTERLACE = (1 << 13), IMA_USE_VIEWS = (1 << 14), - IMA_IS_STEREO = (1 << 15), - IMA_IS_MULTIVIEW = (1 << 16), /* similar to stereo, but a more general case */ + // IMA_IS_STEREO = (1 << 15), /* deprecated */ + // IMA_IS_MULTIVIEW = (1 << 16), /* deprecated */ }; /* Image.tpageflag */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index b78cd65e913..621807d111c 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -71,7 +71,7 @@ typedef struct MVert { * at the moment alpha is abused for vertex painting and not used for transparency, note that red and blue are swapped */ typedef struct MCol { - 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.*/ @@ -224,7 +224,7 @@ enum { * \note red and blue are _not_ swapped, as they are with #MCol */ typedef struct MLoopCol { - char r, g, b, a; + unsigned char r, g, b, a; } MLoopCol; #define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \ @@ -446,6 +446,16 @@ enum { /* number of tri's that make up this polygon once tessellated */ #define ME_POLY_TRI_TOT(mp) ((mp)->totloop - 2) +/** + * Check out-of-bounds material, note that this is nearly always prevented, + * yet its still possible in rare cases. + * 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)) + /* mselect->type */ enum { ME_VSEL = 0, diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 634159e4e60..67ec9fe3db3 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -134,6 +134,7 @@ typedef struct SubsurfModifierData { ModifierData modifier; short subdivType, levels, renderLevels, flags; + short use_opensubdiv, pad[3]; void *emCache, *mCache; } SubsurfModifierData; @@ -391,6 +392,7 @@ enum { MOD_DISP_DIR_Z = 2, MOD_DISP_DIR_NOR = 3, MOD_DISP_DIR_RGB_XYZ = 4, + MOD_DISP_DIR_CLNOR = 5, }; /* DisplaceModifierData->texmapping */ diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 17b0dbca51c..1176ce1c9e6 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -748,6 +748,8 @@ typedef struct NodeTexEnvironment { ImageUser iuser; int color_space; int projection; + int interpolation; + int pad; } NodeTexEnvironment; typedef struct NodeTexGradient { @@ -795,6 +797,7 @@ typedef struct NodeShaderVectTransform { } NodeShaderVectTransform; typedef struct NodeShaderTexPointDensity { + NodeTexBase base; short point_source, pad; int particle_system; float radius; diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h index aaebdf579f8..a714195dd5d 100644 --- a/source/blender/makesdna/DNA_object_fluidsim.h +++ b/source/blender/makesdna/DNA_object_fluidsim.h @@ -88,11 +88,6 @@ typedef struct FluidsimSettings { /* gravity strength */ float iniVelx, iniVely, iniVelz; - /* store pointer to original mesh (for replacing the current one) */ - struct Mesh *orgMesh; - /* a mesh to display the bounding box used for simulation */ - struct Mesh *meshBB; - /* store output path, and file prefix for baked fluid surface */ /* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */ char surfdataPath[1024]; diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 0a454d4f281..cb39655ddc9 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -183,17 +183,16 @@ typedef struct Object { short transflag, protectflag; /* transformation settings and transform locks */ short trackflag, upflag; short nlaflag; /* used for DopeSheet filtering settings (expanded/collapsed) */ - short ipoflag; // xxx deprecated... old animation system short scaflag; /* ui state for game logic */ char scavisflag; /* more display settings for game logic */ char depsflag; - /* dupli-frame settings */ - int dupon, dupoff, dupsta, dupend; - /* did last modifier stack generation need mapping support? */ char lastNeedMapping; /* bool */ - char pad[3]; + char pad; + + /* dupli-frame settings */ + int dupon, dupoff, dupsta, dupend; /* during realtime */ @@ -223,6 +222,8 @@ typedef struct Object { float step_height; float jump_speed; float fall_speed; + unsigned char max_jumps; + char pad2[3]; /** Collision mask settings */ unsigned short col_group, col_mask; @@ -296,6 +297,8 @@ typedef struct Object { ListBase lodlevels; /* contains data for levels of detail */ LodLevel *currentlod; + + struct PreviewImage *preview; } Object; /* Warning, this is not used anymore because hooks are now modifiers */ @@ -415,13 +418,6 @@ enum { OB_DUPLI = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | OB_DUPLIFACES | OB_DUPLIPARTS, }; -/* (short) ipoflag */ -/* XXX: many old flags for features removed due to incompatibility - * with new system and/or other design issues were here - */ - /* for stride/path editing (XXX: NEEDS REVIEW) */ -#define OB_DISABLE_PATH (1 << 10) - /* (short) trackflag / upflag */ enum { OB_POSX = 0, diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h index 53061b55e2d..984e3334414 100644 --- a/source/blender/makesdna/DNA_outliner_types.h +++ b/source/blender/makesdna/DNA_outliner_types.h @@ -56,7 +56,55 @@ typedef struct TreeStore { #define TSE_CHILDSEARCH 8 #define TSE_SEARCHMATCH 16 -/* TreeStoreElem types in BIF_outliner.h */ +/* 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_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_PROXY 18 +#define TSE_R_LAYER_BASE 19 +#define TSE_R_LAYER 20 +#define TSE_R_PASS 21 +#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 */ + + +/* 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)) + #endif diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 16e530127a7..f9cea3871f6 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1443,6 +1443,8 @@ typedef struct Scene { /* RigidBody simulation world+settings */ struct RigidBodyWorld *rigidbody_world; + + struct PreviewImage *preview; } Scene; /* **************** RENDERDATA ********************* */ @@ -1826,7 +1828,6 @@ typedef enum SymmetryFlags { } SymmetryFlags; #define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z) -#define PAINT_TILE_AXIS_ALL (PAINT_TILE_X | PAINT_TILE_Y | PAINT_TILE_Z) /* Sculpt.flags */ /* These can eventually be moved to paint flags? */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 3f3bfdfe1b1..69e7fb43fb6 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -275,9 +275,10 @@ typedef struct TextVars { char text[512]; int text_size; float loc[2]; - short flag; - char align; - char pad; + float wrap_width; + char flag; + char align, align_y; + char pad[5]; } TextVars; /* TextVars.flag */ @@ -287,9 +288,16 @@ enum { /* TextVars.align */ enum { - SEQ_TEXT_ALIGN_LEFT = 0, - SEQ_TEXT_ALIGN_CENTER = 1, - SEQ_TEXT_ALIGN_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, }; /* ***************** Sequence modifiers ****************** */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 2a066726d96..b8f2ce1b2ea 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -590,6 +590,7 @@ typedef struct FileSelectParams { char filter_glob[64]; /* list of filetypes to filter */ char filter_search[64]; /* text items' name must match to be shown. */ + int filter_id; /* same as filter, but for ID types (aka library groups). */ int active_file; /* active file used for keyboard navigation */ int highlight_file; /* file under cursor */ @@ -603,7 +604,9 @@ typedef struct FileSelectParams { short flag; /* settings for filter, hiding dots files,... */ short sort; /* sort order */ short display; /* display mode flag */ - short filter; /* filter when (flags & FILE_FILTER) is true */ + int filter; /* filter when (flags & FILE_FILTER) is true */ + + short recursion_level; /* max number of levels in dirtree to show at once, 0 to disable recursion. */ /* XXX --- still unused -- */ short f_fp; /* show font preview */ @@ -635,6 +638,7 @@ typedef struct SpaceFile { struct wmOperator *op; struct wmTimer *smoothscroll_timer; + struct wmTimer *previews_timer; struct FileLayout *layout; @@ -709,7 +713,10 @@ typedef enum eFileSel_Params_Flag { } eFileSel_Params_Flag; -/* files in filesel list: file types */ +/* files in filesel list: file types + * Note we could use mere values (instead of bitflags) for file types themselves, + * 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), @@ -725,6 +732,9 @@ typedef enum eFileSel_File_Types { FILE_TYPE_COLLADA = (1 << 13), FILE_TYPE_OPERATOR = (1 << 14), /* from filter_glob operator property */ FILE_TYPE_APPLICATIONBUNDLE = (1 << 15), + + FILE_TYPE_DIR = (1 << 30), /* An FS directory (i.e. S_ISDIR on its path is true). */ + FILE_TYPE_BLENDERLIB = (1 << 31), } eFileSel_File_Types; /* Selection Flags in filesel: struct direntry, unsigned char selflag */ @@ -735,6 +745,119 @@ typedef enum eDirEntry_SelectFlag { FILE_SEL_EDITING = (1 << 4), } eDirEntry_SelectFlag; +#define FILE_LIST_MAX_RECURSION 4 + +/* ***** Related to file browser, but never saved in DNA, only here to help with RNA. ***** */ + +/* About Unique identifier. + * Stored in a CustomProps once imported. + * Each engine is free to use it as it likes - it will be the only thing passed to it by blender to identify + * 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 + +/* 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]; +} AssetUUID; + +typedef struct AssetUUIDList { + AssetUUID *uuids; + int nbr_uuids, pad; +} AssetUUIDList; + +/* Container for a revision, only relevant in asset context. */ +typedef struct FileDirEntryRevision { + struct FileDirEntryRevision *next, *prev; + + char *comment; + void *pad; + + 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]; +} FileDirEntryRevision; + +/* Container for a variant, only relevant in asset context. + * In case there are no variants, a single one shall exist, with NULL name/description. */ +typedef struct FileDirEntryVariant { + struct FileDirEntryVariant *next, *prev; + + int uuid[4]; + char *name; + char *description; + + 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; + + int uuid[4]; + char *name; + char *description; + + /* Either point to active variant/revision if available, or own entry (in mere filebrowser case). */ + FileDirEntryRevision *entry; + + int typeflag; /* eFileSel_File_Types */ + int blentype; /* ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */ + + char *relpath; + + void *poin; /* TODO: make this a real ID pointer? */ + struct ImBuf *image; + + /* Tags are for info only, most of filtering is done in asset engine. */ + char **tags; + int nbr_tags; + + short status; + short flags; + + ListBase variants; + int nbr_variants; + int act_variant; +} FileDirEntry; + +/* Array of direntries. */ +/* This struct is used in various, different contexts. + * In Filebrowser UI, it stores the total number of available entries, the number of visible (filtered) entries, + * and a subset of those in 'entries' ListBase, from idx_start (included) to idx_end (excluded). + * In AssetEngine context (i.e. outside of 'browsing' context), entries contain all needed data, there is no filtering, + * so nbr_entries_filtered, entry_idx_start and entry_idx_end should all be set to -1. + */ +typedef struct FileDirEntryArr { + ListBase entries; + int nbr_entries; + int nbr_entries_filtered; + int entry_idx_start, entry_idx_end; + + char root[1024]; /* FILE_MAX */ +} FileDirEntryArr; + +/* FileDirEntry.status */ +enum { + ASSET_STATUS_LOCAL = 1 << 0, /* If active uuid is available localy/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. */ +}; + /* Image/UV Editor ======================================== */ /* Image/UV Editor */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 6acc4c618a7..e4c2c09e1a8 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -74,7 +74,8 @@ typedef struct uiFontStyle { short uifont_id; /* saved in file, 0 is default */ short points; /* actual size depends on 'global' dpi */ short kerning; /* unfitted or default kerning value. */ - char pad[6]; + char word_wrap; /* enable word-wrap when drawing */ + char pad[5]; short italic, bold; /* style hint */ short shadow; /* value is amount of pixels blur */ short shadx, shady; /* shadow offset in pixels */ @@ -808,19 +809,23 @@ typedef enum eTimecodeStyles { * with '+' to denote the frames * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS */ - USER_TIMECODE_MINIMAL = 0, - + USER_TIMECODE_MINIMAL = 0, + /* reduced SMPTE - (HH:)MM:SS:FF */ - USER_TIMECODE_SMPTE_MSF = 1, - + USER_TIMECODE_SMPTE_MSF = 1, + /* full SMPTE - HH:MM:SS:FF */ - USER_TIMECODE_SMPTE_FULL = 2, - + USER_TIMECODE_SMPTE_FULL = 2, + /* milliseconds for sub-frames - HH:MM:SS.sss */ - USER_TIMECODE_MILLISECONDS = 3, - + USER_TIMECODE_MILLISECONDS = 3, + /* seconds only */ - USER_TIMECODE_SECONDS_ONLY = 4, + 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, } eTimecodeStyles; /* theme drawtypes */ diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index be097c0e51e..52487edfd2b 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -57,7 +57,7 @@ add_executable(makesdna ${SRC} ${SRC_DNA_INC}) # Output dna.c add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c - COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/ + COMMAND "$<TARGET_FILE:makesdna>" ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/ DEPENDS makesdna ) diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 499c430306b..16fbcbebe50 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -311,7 +311,21 @@ int DNA_struct_find_nr(SDNA *sdna, const char *str) } #ifdef WITH_DNA_GHASH - return (intptr_t)BLI_ghash_lookup(sdna->structs_map, str) - 1; + { + void **index_p; + int a; + + index_p = BLI_ghash_lookup_p(sdna->structs_map, str); + + if (index_p) { + a = GET_INT_FROM_POINTER(*index_p); + sdna->lastfind = a; + } + else { + a = -1; + } + return a; + } #else { int a; @@ -525,7 +539,7 @@ static void init_structDNA(SDNA *sdna, bool do_endian_swap) for (nr = 0; nr < sdna->nr_structs; nr++) { sp = sdna->structs[nr]; - BLI_ghash_insert(sdna->structs_map, sdna->types[sp[0]], SET_INT_IN_POINTER(nr + 1)); + BLI_ghash_insert(sdna->structs_map, sdna->types[sp[0]], SET_INT_IN_POINTER(nr)); } #endif } |