2
* blenlib/DNA_ID.h (mar-2001 nzc)
4
* ID and Library types, which are fundamental for sdna,
6
* $Id: DNA_ID.h 15739 2008-07-24 19:22:17Z joeedh $
8
* ***** BEGIN GPL LICENSE BLOCK *****
10
* This program is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU General Public License
12
* as published by the Free Software Foundation; either version 2
13
* of the License, or (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software Foundation,
22
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
25
* All rights reserved.
27
* The Original Code is: all of this file.
29
* Contributor(s): none yet.
31
* ***** END GPL LICENSE BLOCK *****
36
#include "DNA_listBase.h"
46
typedef struct IDPropertyData {
49
int val, val2; /*note, we actually fit a double into these two ints*/
52
typedef struct IDProperty {
53
struct IDProperty *next, *prev;
57
int saved; /*saved is used to indicate if this struct has been saved yet.
58
seemed like a good idea as a pad var was needed anyway :)*/
59
IDPropertyData data; /* note, alignment for 64 bits */
60
int len; /* array length, also (this is important!) string length + 1.
61
the idea is to be able to reuse array realloc functions on strings.*/
62
/*totallen is total length of allocated array/string, including a buffer.
63
Note that the buffering is mild; the code comes from python's list implementation.*/
64
int totallen; /*strings and arrays are both buffered, though the buffer isn't
68
#define MAX_IDPROP_NAME 32
69
#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
77
/*the ID link property type hasn't been implemented yet, this will require
78
some cleanup of blenkernel, most likely.*/
82
/*add any future new id property types here.*/
84
/* watch it: Sequence has identical beginning. */
86
* ID is the first thing included in all serializable types. It
87
* provides a common handle to place all data in double-linked lists.
90
/* There's a nasty circular dependency here.... void* to the rescue! I
91
* really wonder why this is needed. */
99
* LIB_... flags report on status of the datablock this ID belongs
104
IDProperty *properties;
108
* For each library file used, a Library struct is added to Main
109
* WARNING: readfile.c, expand_doit() reads this struct without DNA check!
111
typedef struct Library {
114
struct FileData *filedata;
115
char name[240]; /* reveiled in the UI, can store relative path */
116
char filename[240]; /* expanded name, not relative, used while reading */
117
int tot, pad; /* tot, idblock and filedata are only fo read and write */
118
struct Library *parent; /* for outliner, showing dependency */
121
#define PREVIEW_MIPMAPS 2
122
#define PREVIEW_MIPMAP_ZERO 0
123
#define PREVIEW_MIPMAP_LARGE 1
125
typedef struct PreviewImage {
130
unsigned int * rect[2];
134
* Defines for working with IDs.
136
* The tags represent types! This is a dirty way of enabling RTTI. The
137
* sig_byte end endian defines aren't really used much.
141
#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
143
#define MAKE_ID2(c, d) ( (c)<<8 | (d) )
144
#define MOST_SIG_BYTE 0
148
#define MAKE_ID2(c, d) ( (d)<<8 | (c) )
149
#define MOST_SIG_BYTE 1
150
#define BLITTLE_ENDIAN
153
/* ID from database */
154
#define ID_SCE MAKE_ID2('S', 'C')
155
#define ID_LI MAKE_ID2('L', 'I')
156
#define ID_OB MAKE_ID2('O', 'B')
157
#define ID_ME MAKE_ID2('M', 'E')
158
#define ID_CU MAKE_ID2('C', 'U')
159
#define ID_MB MAKE_ID2('M', 'B')
160
#define ID_MA MAKE_ID2('M', 'A')
161
#define ID_TE MAKE_ID2('T', 'E')
162
#define ID_IM MAKE_ID2('I', 'M')
163
#define ID_IK MAKE_ID2('I', 'K')
164
#define ID_WV MAKE_ID2('W', 'V')
165
#define ID_LT MAKE_ID2('L', 'T')
166
#define ID_SE MAKE_ID2('S', 'E')
167
#define ID_LF MAKE_ID2('L', 'F')
168
#define ID_LA MAKE_ID2('L', 'A')
169
#define ID_CA MAKE_ID2('C', 'A')
170
#define ID_IP MAKE_ID2('I', 'P')
171
#define ID_KE MAKE_ID2('K', 'E')
172
#define ID_WO MAKE_ID2('W', 'O')
173
#define ID_SCR MAKE_ID2('S', 'R')
174
#define ID_VF MAKE_ID2('V', 'F')
175
#define ID_TXT MAKE_ID2('T', 'X')
176
#define ID_SO MAKE_ID2('S', 'O')
177
#define ID_GR MAKE_ID2('G', 'R')
178
#define ID_ID MAKE_ID2('I', 'D')
179
#define ID_AR MAKE_ID2('A', 'R')
180
#define ID_AC MAKE_ID2('A', 'C')
181
#define ID_SCRIPT MAKE_ID2('P', 'Y')
182
#define ID_NT MAKE_ID2('N', 'T')
183
#define ID_BR MAKE_ID2('B', 'R')
184
#define ID_PA MAKE_ID2('P', 'A')
186
/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
187
#define ID_SEQ MAKE_ID2('S', 'Q')
189
#define ID_CO MAKE_ID2('C', 'O')
190
/* pose (action channel, used to be ID_AC in code, so we keep code for backwards compat) */
191
#define ID_PO MAKE_ID2('A', 'C')
192
/* used in outliner... */
193
#define ID_NLA MAKE_ID2('N', 'L')
195
#define ID_FLUIDSIM MAKE_ID2('F', 'S')
198
/*#ifdef WITH_VERSE*/
199
#define ID_VS MAKE_ID2('V', 'S') /* fake id for VerseSession, needed for outliner */
200
#define ID_VN MAKE_ID2('V', 'N') /* fake id for VerseNode, needed for outliner */
201
#define ID_MS MAKE_ID2('M', 'S') /* fake id for VerseServer root entry, needed for outliner */
202
#define ID_SS MAKE_ID2('S', 'S') /* fake id for VerseServer entry, needed for ountliner */
206
/* id->flag: set frist 8 bits always at zero while reading */
209
#define LIB_INDIRECT 2
211
#define LIB_TESTEXT 9
212
#define LIB_TESTIND 10
214
#define LIB_NEEDLINK 32
217
#define LIB_FAKEUSER 512
219
#define LIB_DOIT 1024
221
#define LIB_APPEND_TAG 2048