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

DNA_scene_types.h « makesdna « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1872ced9b24c2b475ea4976414da0226757b0b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): none yet.
 *
 * ***** END GPL LICENSE BLOCK *****
 */

/** \file DNA_scene_types.h
 *  \ingroup DNA
 */

#ifndef __DNA_SCENE_TYPES_H__
#define __DNA_SCENE_TYPES_H__

#include "DNA_defs.h"

/* XXX, temp feature - campbell */
#define DURIAN_CAMERA_SWITCH

#ifdef __cplusplus
extern "C" {
#endif

#include "DNA_color_types.h"  /* color management */
#include "DNA_vec_types.h"
#include "DNA_listBase.h"
#include "DNA_ID.h"
#include "DNA_freestyle_types.h"
#include "DNA_gpu_types.h"
#include "DNA_userdef_types.h"

struct CurveMapping;
struct Object;
struct Brush;
struct World;
struct Scene;
struct Image;
struct Group;
struct Text;
struct bNodeTree;
struct AnimData;
struct Editing;
struct SceneStats;
struct bGPdata;
struct MovieClip;
struct ColorSpace;

/* ************************************************************* */
/* Scene Data */

/* Base - Wrapper for referencing Objects in a Scene */
typedef struct Base {
	struct Base *next, *prev;
	unsigned int lay, selcol;
	int flag;
	short sx, sy;
	struct Object *object;
} Base;

/* ************************************************************* */
/* Output Format Data */

typedef struct AviCodecData {
	void			*lpFormat;  /* save format */
	void			*lpParms;   /* compressor options */
	unsigned int	cbFormat;	    /* size of lpFormat buffer */
	unsigned int	cbParms;	    /* size of lpParms buffer */

	unsigned int	fccType;            /* stream type, for consistency */
	unsigned int	fccHandler;         /* compressor */
	unsigned int	dwKeyFrameEvery;    /* keyframe rate */
	unsigned int	dwQuality;          /* compress quality 0-10,000 */
	unsigned int	dwBytesPerSecond;   /* bytes per second */
	unsigned int	dwFlags;            /* flags... see below */
	unsigned int	dwInterleaveEvery;  /* for non-video streams only */
	unsigned int	pad;

	char			avicodecname[128];
} AviCodecData;

typedef struct QuicktimeCodecData {
	/*Old quicktime implementation compatibility fields, read only in 2.5 - deprecated*/
	void			*cdParms;   /* codec/compressor options */
	void			*pad;	    /* padding */

	unsigned int	cdSize;		    /* size of cdParms buffer */
	unsigned int	pad2;		    /* padding */

	char			qtcodecname[128];
} QuicktimeCodecData;
	
typedef struct QuicktimeCodecSettings {
	/* Codec settings detailed for 2.5 implementation*/
	int codecType; /* Types defined in quicktime_export.h */
	int	codecSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */

	/* Settings not available in current QTKit API */
	int	codec;
	int	codecFlags;
	int	colorDepth;
	int	codecTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
	int	minSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
	int	minTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
	int	keyFrameRate;
	int	bitRate;	/* bitrate in bps */
	
	/* Audio Codec settings */
	int audiocodecType;
	int audioSampleRate;
	short audioBitDepth;
	short audioChannels;
	int audioCodecFlags;
	int audioBitRate;
	int pad1;
} QuicktimeCodecSettings;

typedef struct FFMpegCodecData {
	int type;
	int codec;
	int audio_codec;
	int video_bitrate;
	int audio_bitrate;
	int audio_mixrate;
	int audio_channels;
	int audio_pad;
	float audio_volume;
	int gop_size;
	int flags;

	int rc_min_rate;
	int rc_max_rate;
	int rc_buffer_size;
	int mux_packet_size;
	int mux_rate;
	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;
	short pad;
	float volume;
	float pad2;
} AudioData;

/* *************************************************************** */
/* Render Layers */

/* Render Layer */
typedef struct SceneRenderLayer {
	struct SceneRenderLayer *next, *prev;
	
	char name[64];	/* MAX_NAME */
	
	struct Material *mat_override;
	struct Group *light_override;
	
	unsigned int lay;		  /* scene->lay itself has priority over this */
	unsigned int lay_zmask;	  /* has to be after lay, this is for Z-masking */
	unsigned int lay_exclude; /* not used by internal, exclude */
	int layflag;
	
	int passflag;			/* pass_xor has to be after passflag */
	int pass_xor;

	int samples;
	float pass_alpha_threshold;
	
	struct FreestyleConfig freestyleConfig;
} SceneRenderLayer;

/* srl->layflag */
#define SCE_LAY_SOLID	1
#define SCE_LAY_ZTRA	2
#define SCE_LAY_HALO	4
#define SCE_LAY_EDGE	8
#define SCE_LAY_SKY		16
#define SCE_LAY_STRAND	32
#define SCE_LAY_FRS		64
	/* flags between 128 and 0x8000 are set to 1 already, for future options */

#define SCE_LAY_ALL_Z		0x8000
#define SCE_LAY_XOR			0x10000
#define SCE_LAY_DISABLE		0x20000
#define SCE_LAY_ZMASK		0x40000
#define SCE_LAY_NEG_ZMASK	0x80000

/* srl->passflag */
typedef enum ScenePassType {
	SCE_PASS_COMBINED                 = (1 << 0),
	SCE_PASS_Z                        = (1 << 1),
	SCE_PASS_RGBA                     = (1 << 2),
	SCE_PASS_DIFFUSE                  = (1 << 3),
	SCE_PASS_SPEC                     = (1 << 4),
	SCE_PASS_SHADOW                   = (1 << 5),
	SCE_PASS_AO                       = (1 << 6),
	SCE_PASS_REFLECT                  = (1 << 7),
	SCE_PASS_NORMAL                   = (1 << 8),
	SCE_PASS_VECTOR                   = (1 << 9),
	SCE_PASS_REFRACT                  = (1 << 10),
	SCE_PASS_INDEXOB                  = (1 << 11),
	SCE_PASS_UV                       = (1 << 12),
	SCE_PASS_INDIRECT                 = (1 << 13),
	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_DEBUG                    = (1 << 31),  /* This is a virtual pass. */
} ScenePassType;

/* note, srl->passflag is treestore element 'nr' in outliner, short still... */

/* View - MultiView */
typedef struct SceneRenderView {
	struct SceneRenderView *next, *prev;

	char name[64];	/* MAX_NAME */
	char suffix[64];	/* MAX_NAME */

	int viewflag;
	int pad[2];
	char pad2[4];

} SceneRenderView;

/* srv->viewflag */
#define SCE_VIEW_DISABLE		(1<<0)

/* scene.render.views_format */
enum {
	SCE_VIEWS_FORMAT_STEREO_3D = 0,
	SCE_VIEWS_FORMAT_MULTIVIEW = 1,
};

/* ImageFormatData.views_output */
enum {
	R_IMF_VIEWS_INDIVIDUAL = 0,
	R_IMF_VIEWS_STEREO_3D  = 1,
	R_IMF_VIEWS_MULTIVIEW  = 2,
};

typedef struct Stereo3dFormat {
	short flag;
	char display_mode; /* encoding mode */
	char anaglyph_type; /* anaglyph scheme for the user display */
	char interlace_type;  /* interlace type for the user display */
	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,
} eStereoDisplayMode;

/* Stereo3dFormat.flag */
typedef enum eStereo3dFlag {
	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,
} eStereo3dAnaglyphType;

/* Stereo3dFormat.interlace_type */
typedef enum eStereo3dInterlaceType {
	S3D_INTERLACE_ROW          = 0,
	S3D_INTERLACE_COLUMN       = 1,
	S3D_INTERLACE_CHECKERBOARD = 2,
} eStereo3dInterlaceType;

/* *************************************************************** */

/* Generic image format settings,
 * this is used for NodeImageFile and IMAGE_OT_save_as operator too.
 *
 * note: its a bit strange that even though this is an image format struct
 *  the imtype can still be used to select video formats.
 *  RNA ensures these enum's are only selectable for render output.
 */
typedef struct ImageFormatData {
	char imtype;   /* R_IMF_IMTYPE_PNG, R_... */
	               /* note, video types should only ever be set from this
	                * structure when used from RenderData */
	char depth;    /* bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
	                * not a flag, only set 1 at a time */

	char planes;   /* - R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA */
	char flag;     /* generic options for all image types, alpha zbuffer */

	char quality;  /* (0 - 100), eg: jpeg quality */
	char compress; /* (0 - 100), eg: png compression */


	/* --- 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;

	char pad[5];

	/* 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_HAMX                    2 */ /* hamx is nomore */
/* #define R_FTYPE                   3 */ /* ftype is nomore */
#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_AVICODEC    18 */ /* avicodec is nomore */
#define R_IMF_IMTYPE_QUICKTIME      19
#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
#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 */

/* 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_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) */
#define R_IMF_CHAN_DEPTH_24 (1<<5) /* 24bits (unused) */
#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

/* ImageFormatData.exr_codec */
#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

/* 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 */

/* ImageFormatData.jp2_codec */
#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 */

typedef struct BakeData {
	struct ImageFormatData im_format;

	char filepath[1024]; /* FILE_MAX */

	short width, height;
	short margin, flag;

	float cage_extrusion;
	float pad2;

	char normal_swizzle[3];
	char normal_space;

	char save_mode;
	char pad[3];

	char cage[64];  /* MAX_NAME */
} BakeData;

/* (char) normal_swizzle */
typedef enum BakeNormalSwizzle {
	R_BAKE_POSX = 0,
	R_BAKE_POSY = 1,
	R_BAKE_POSZ = 2,
	R_BAKE_NEGX = 3,
	R_BAKE_NEGY = 4,
	R_BAKE_NEGZ = 5,
} BakeNormalSwizzle;

/* (char) save_mode */
typedef enum BakeSaveMode {
	R_BAKE_SAVE_INTERNAL = 0,
	R_BAKE_SAVE_EXTERNAL = 1,
} BakeSaveMode;

/* *************************************************************** */
/* Render Data */

typedef struct RenderData {
	struct ImageFormatData im_format;
	
	struct AviCodecData *avicodecdata;
	struct QuicktimeCodecData *qtcodecdata;
	struct QuicktimeCodecSettings qtcodecsettings;
	struct FFMpegCodecData ffcodecdata;

	int cfra, sfra, efra;	/* frames as in 'images' */
	float subframe;			/* subframe offset from cfra, in 0.0-1.0 */
	int psfra, pefra;		/* start+end frames of preview range */

	int images, framapto;
	short flag, threads;

	float framelen, blurfac;

	/** For UR edge rendering: give the edges this color */
	float edgeR, edgeG, edgeB;


	/* standalone player */  //  XXX deprecated since 2.5
	short fullscreen  DNA_DEPRECATED, xplay  DNA_DEPRECATED, yplay  DNA_DEPRECATED;
	short freqplay  DNA_DEPRECATED;
	/* standalone player */  //  XXX deprecated since 2.5
	short depth  DNA_DEPRECATED, attrib  DNA_DEPRECATED;


	int frame_step;		/* frames to jump during render/playback */

	short stereomode  DNA_DEPRECATED;	/* standalone player stereo settings */  //  XXX deprecated since 2.5
	
	short dimensionspreset;		/* for the dimensions presets menu */

	short filtertype;	/* filter is box, tent, gauss, mitch, etc */

	short size; /* size in % */
	
	short maximsize DNA_DEPRECATED; /* max in Kb */

	short pad6;

	/* from buttons: */
	/**
	 * The desired number of pixels in the x direction
	 */
	int xsch;
	/**
	 * The desired number of pixels in the y direction
	 */
	int ysch;

	/**
	 * The number of part to use in the x direction
	 */
	short xparts DNA_DEPRECATED;
	/**
	 * The number of part to use in the y direction
	 */
	short yparts DNA_DEPRECATED;

	/**
	 * render tile dimensions
	 */
	int tilex, tiley;

	short planes  DNA_DEPRECATED, imtype  DNA_DEPRECATED, subimtype  DNA_DEPRECATED, quality  DNA_DEPRECATED; /*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;

	/**
	 * Flags for raytrace settings. Use bit-masking to access the settings.
	 */
	int raytrace_options;
	
	/**
	 * Raytrace acceleration structure
	 */
	short raytrace_structure;

	short pad1;

	/* octree resolution */
	short ocres;
	short pad4;
	
	/**
	 * What to do with the sky/background. Picks sky/premul/key
	 * blending for the background
	 */
	short alphamode;

	/**
	 * The number of samples to use per pixel.
	 */
	short osa;

	short frs_sec, edgeint;

	
	/* safety, border and display rect */
	rctf safety, border;
	rcti disprect;
	
	/* information on different layers to be rendered */
	ListBase layers;
	short actlay;
	
	/* number of mblur samples */
	short mblur_samples;
	
	/**
	 * 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;
	
	/** post-production settings. deprecated, but here for upwards compat (initialized to 1) */
	float postgamma, posthue, postsat;
	
	 /* Dither noise intensity */
	float dither_intensity;
	
	/* Bake Render options */
	short bake_osa, bake_filter, bake_mode, bake_flag;
	short bake_normal_space, bake_quad_split;
	float bake_maxdist, bake_biasdist;
	short bake_samples, bake_pad;
	float bake_user_scale, bake_pad1;

	/* path to render output */
	char pic[1024]; /* 1024 = FILE_MAX */

	/* stamps flags. */
	int stamp;
	short stamp_font_id, pad3; /* select one of blenders bitmap fonts */

	/* 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;
	char seq_rend_type;
	char seq_flag; /* flag use for sequence render/draw */
	char pad5[5];

	/* render simplify */
	int simplify_flag;
	short simplify_subsurf;
	short simplify_subsurf_render;
	short simplify_shadowsamples, pad9;
	float simplify_particles;
	float simplify_particles_render;
	float simplify_aosss;

	/* cineon */
	short cineonwhite  DNA_DEPRECATED, cineonblack  DNA_DEPRECATED;  /*deprecated*/
	float cineongamma  DNA_DEPRECATED;  /*deprecated*/
	
	/* jpeg2000 */
	short jp2_preset  DNA_DEPRECATED, jp2_depth  DNA_DEPRECATED;  /*deprecated*/
	int rpad3;

	/* Dome variables */ //  XXX deprecated since 2.5
	short domeres  DNA_DEPRECATED, domemode  DNA_DEPRECATED;	//  XXX deprecated since 2.5
	short domeangle  DNA_DEPRECATED, dometilt  DNA_DEPRECATED;	//  XXX deprecated since 2.5
	float domeresbuf  DNA_DEPRECATED;	//  XXX deprecated since 2.5
	float pad2;
	struct Text *dometext  DNA_DEPRECATED;	//  XXX deprecated since 2.5

	/* Freestyle line thickness options */
	int line_thickness_mode;
	float unit_line_thickness; /* in pixels */

	/* render engine */
	char engine[32];

	/* Cycles baking */
	struct BakeData bake;

	int preview_start_resolution;
	int pad;

	/* MultiView */
	ListBase views;
	short actview;
	short views_format;
	short pad8[2];
} RenderData;

/* *************************************************************** */
/* Render Conversion/Simplfication Settings */

/* control render convert and shading engine */
typedef struct RenderProfile {
	struct RenderProfile *next, *prev;
	char name[32];
	
	short particle_perc;
	short subsurf_max;
	short shadbufsample_max;
	short pad1;
	
	float ao_error, pad2;
	
} RenderProfile;

/* *************************************************************** */
/* Game Engine - Dome */

typedef struct GameDome {
	short res, mode;
	short angle, tilt;
	float resbuf, pad2;
	struct Text *warptext;
} GameDome;

#define DOME_FISHEYE			1
#define DOME_TRUNCATED_FRONT	2
#define DOME_TRUNCATED_REAR		3
#define DOME_ENVMAP				4
#define DOME_PANORAM_SPH		5
#define DOME_NUM_MODES			6

/* *************************************************************** */
/* Game Engine */

typedef struct GameFraming {
	float col[3];
	char type, pad1, pad2, pad3;
} GameFraming;

#define SCE_GAMEFRAMING_BARS   0
#define SCE_GAMEFRAMING_EXTEND 1
#define SCE_GAMEFRAMING_SCALE  2

typedef struct RecastData {
	float cellsize;
	float cellheight;
	float agentmaxslope;
	float agentmaxclimb;
	float agentheight;
	float agentradius;
	float edgemaxlen;
	float edgemaxerror;
	float regionminsize;
	float regionmergesize;
	int vertsperpoly;
	float detailsampledist;
	float detailsamplemaxerror;
	short pad1, pad2;
} RecastData;

typedef struct GameData {

	/*  standalone player */
	struct GameFraming framing;
	short playerflag, xplay, yplay, freqplay;
	short depth, attrib, rt1, rt2;
	short aasamples, pad4[3];

	/* stereo/dome mode */
	struct GameDome dome;
	short stereoflag, stereomode;
	float eyeseparation;
	RecastData recastData;


	/* physics (it was in world)*/
	float gravity; /*Gravitation constant for the game world*/

	/*
	 * Radius of the activity bubble, in Manhattan length. Objects
	 * outside the box are activity-culled. */
	float activityBoxRadius;

	/*
	 * bit 3: (gameengine): Activity culling is enabled.
	 * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
	 */
	int flag;
	short mode, matmode;
	short occlusionRes;		/* resolution of occlusion Z buffer in pixel */
	short physicsEngine;
	short exitkey;
	short vsync; /* Controls vsync: off, on, or adaptive (if supported) */
	short ticrate, maxlogicstep, physubstep, maxphystep;
	short obstacleSimulation;
	short raster_storage;
	float levelHeight;
	float deactivationtime, lineardeactthreshold, angulardeactthreshold;

	/* Scene LoD */
	short lodflag, pad2;
	int scehysteresis, pad5;

} GameData;

#define STEREO_NOSTEREO		1
#define STEREO_ENABLED		2
#define STEREO_DOME			3

//#define STEREO_NOSTEREO		 1
#define STEREO_QUADBUFFERED 2
#define STEREO_ABOVEBELOW	 3
#define STEREO_INTERLACED	 4
#define STEREO_ANAGLYPH		5
#define STEREO_SIDEBYSIDE	6
#define STEREO_VINTERLACE	7
//#define STEREO_DOME		8
#define STEREO_3DTVTOPBOTTOM 9

/* physicsEngine */
#define WOPHY_NONE		0
#define WOPHY_BULLET	5

/* obstacleSimulation */
#define OBSTSIMULATION_NONE		0
#define OBSTSIMULATION_TOI_rays		1
#define OBSTSIMULATION_TOI_cells	2

/* Raster storage */
#define RAS_STORE_AUTO		0
#define RAS_STORE_IMMEDIATE	1
#define RAS_STORE_VA		2
#define RAS_STORE_VBO		3

/* vsync */
#define VSYNC_ON	0
#define VSYNC_OFF	1
#define VSYNC_ADAPTIVE	2

/* GameData.flag */
#define GAME_RESTRICT_ANIM_UPDATES			(1 << 0)
#define GAME_ENABLE_ALL_FRAMES				(1 << 1)
#define GAME_SHOW_DEBUG_PROPS				(1 << 2)
#define GAME_SHOW_FRAMERATE					(1 << 3)
#define GAME_SHOW_PHYSICS					(1 << 4)
#define GAME_DISPLAY_LISTS					(1 << 5)
#define GAME_GLSL_NO_LIGHTS					(1 << 6)
#define GAME_GLSL_NO_SHADERS				(1 << 7)
#define GAME_GLSL_NO_SHADOWS				(1 << 8)
#define GAME_GLSL_NO_RAMPS					(1 << 9)
#define GAME_GLSL_NO_NODES					(1 << 10)
#define GAME_GLSL_NO_EXTRA_TEX				(1 << 11)
#define GAME_IGNORE_DEPRECATION_WARNINGS	(1 << 12)
#define GAME_ENABLE_ANIMATION_RECORD		(1 << 13)
#define GAME_SHOW_MOUSE						(1 << 14)
#define GAME_GLSL_NO_COLOR_MANAGEMENT		(1 << 15)
#define GAME_SHOW_OBSTACLE_SIMULATION		(1 << 16)
#define GAME_NO_MATERIAL_CACHING			(1 << 17)
/* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */

/* GameData.playerflag */
#define GAME_PLAYER_FULLSCREEN				(1 << 0)
#define GAME_PLAYER_DESKTOP_RESOLUTION		(1 << 1)

/* GameData.matmode */
enum {
	GAME_MAT_TEXFACE    = 0, /* deprecated */
	GAME_MAT_MULTITEX   = 1,
	GAME_MAT_GLSL       = 2,
};

#if (DNA_DEPRECATED_GCC_POISON == 1)
#pragma GCC poison GAME_MAT_TEXFACE
#endif

/* GameData.lodflag */
#define SCE_LOD_USE_HYST		(1 << 0)

/* UV Paint */
#define UV_SCULPT_LOCK_BORDERS				1
#define UV_SCULPT_ALL_ISLANDS				2

#define UV_SCULPT_TOOL_PINCH				1
#define UV_SCULPT_TOOL_RELAX				2
#define UV_SCULPT_TOOL_GRAB					3

#define UV_SCULPT_TOOL_RELAX_LAPLACIAN	1
#define UV_SCULPT_TOOL_RELAX_HC			2

/* Stereo Flags */
#define STEREO_RIGHT_NAME "right"
#define STEREO_LEFT_NAME "left"
#define STEREO_RIGHT_SUFFIX "_R"
#define STEREO_LEFT_SUFFIX "_L"

typedef enum StereoViews {
	STEREO_LEFT_ID = 0,
	STEREO_RIGHT_ID = 1,
	STEREO_3D_ID = 2,
	STEREO_MONO_ID = 3,
} StereoViews;

/* Markers */

typedef struct TimeMarker {	
	struct TimeMarker *next, *prev;
	int frame;
	char name[64];
	unsigned int flag;
	struct Object *camera;
} TimeMarker;

/* *************************************************************** */
/* Paint Mode/Tool Data */

#define PAINT_MAX_INPUT_SAMPLES 64

/* Paint Tool Base */
typedef struct Paint {
	struct Brush *brush;
	struct Palette *palette;
	struct CurveMapping *cavity_curve; /* cavity curve */

	/* WM Paint cursor */
	void *paint_cursor;
	unsigned char paint_cursor_col[4];

	/* enum PaintFlags */
	int flags;

	/* 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;
} Paint;

/* ------------------------------------------- */
/* Image Paint */

/* Texture/Image Editor */
typedef struct ImagePaintSettings {
	Paint paint;

	short flag, missing_data;
	
	/* for projection painting only */
	short seam_bleed, normal_angle;
	short screen_grab_size[2]; /* capture size for re-projection */

	int mode;                  /* mode used for texture painting */

	void *paintcursor;		   /* wm handle */
	struct Image *stencil;     /* workaround until we support true layer masks */
	struct Image *clone;       /* clone layer for image mode for projective texture painting */
	struct Image *canvas;      /* canvas when the explicit system is used for painting */
	float stencil_col[3];
	float dither;              /* dither amount used when painting on byte images */
} ImagePaintSettings;

/* ------------------------------------------- */
/* Particle Edit */

/* Settings for a Particle Editing Brush */
typedef struct ParticleBrushData {
	short size;						/* common setting */
	short step, invert, count;		/* for specific brushes only */
	int flag;
	float strength;
} ParticleBrushData;

/* Particle Edit Mode Settings */
typedef struct ParticleEditSettings {
	short flag;
	short totrekey;
	short totaddkey;
	short brushtype;

	ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
	void *paintcursor;			/* runtime */

	float emitterdist, rt;

	int selectmode;
	int edittype;

	int draw_step, fade_frames;

	struct Scene *scene;
	struct Object *object;
	struct Object *shape_object;
} ParticleEditSettings;

/* ------------------------------------------- */
/* Hair Edit */

/* HairEditSettings->select_mode */
typedef enum HairEditSelectMode {
	HAIR_SELECT_STRAND  = 0,
	HAIR_SELECT_VERTEX  = 1,
	HAIR_SELECT_TIP     = 2,
} HairEditSelectMode;

/* HairEditSettings->flag */
typedef enum HairEditFlag {
	HAIR_EDIT_SHOW_DEBUG    = (1 << 16),
} HairEditFlag;

typedef struct HairEditSettings {
	int flag;
	int select_mode;
	
	struct Brush *brush;
	struct Object *shape_object;
	
	/* WM Paint cursor */
	void *paint_cursor;
} HairEditSettings;

/* ------------------------------------------- */
/* Sculpt */

/* Sculpt */
typedef struct Sculpt {
	Paint paint;

	/* 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];

	/* Maximum edge length for dynamic topology sculpting (in pixels) */
	float detail_size;

	/* Direction used for SCULPT_OT_symmetrize operator */
	int symmetrize_direction;

	/* gravity factor for sculpting */
	float gravity_factor;

	/* scale for constant detail size */
	float constant_detail;
	float detail_percent;
	float pad;

	struct Object *gravity_object;
	void *pad2;
} Sculpt;

typedef struct UvSculpt {
	Paint paint;
} UvSculpt;
/* ------------------------------------------- */
/* Vertex Paint */

/* Vertex Paint */
typedef struct VPaint {
	Paint paint;

	short flag, pad;
	int tot;							/* allocation size of prev buffers */
	unsigned int *vpaint_prev;			/* previous mesh colors */
	struct MDeformVert *wpaint_prev;	/* previous vertex weights */
	
	void *paintcursor;					/* wm handle */
} VPaint;

/* VPaint.flag */
enum {
	// VP_COLINDEX  = (1 << 0),  /* only paint onto active material*/  /* deprecated since before 2.49 */
	// VP_AREA      = (1 << 1),  /* deprecated since 2.70 */
	VP_NORMALS      = (1 << 3),
	VP_SPRAY        = (1 << 4),
	// VP_MIRROR_X  = (1 << 5),  /* deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) */
	VP_ONLYVGROUP   = (1 << 7)   /* weight paint only */
};

/* *************************************************************** */
/* Transform Orientations */

typedef struct TransformOrientation {
	struct TransformOrientation *next, *prev;
	char name[64];	/* MAX_NAME */
	float mat[3][3];
	int pad;
} TransformOrientation;

/* *************************************************************** */
/* Unified Paint Settings
 */

/* These settings can override the equivalent fields in the active
 * 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 strength of brush */
	float alpha;

	/* unified brush weight, [0, 1] */
	float weight;

	/* unified brush color */
	float rgb[3];
	/* unified brush secondary color */
	float secondary_rgb[3];

	/* user preferences for sculpt and paint */
	int flag;

	/* rake rotation */

	/* 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;

	/*********************************************************************************
	 *  all data below are used to communicate with cursor drawing and tex sampling  *
	 *********************************************************************************/
	int anchored_size;

	float overlap_factor; /* 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*/
	char draw_inverted;
	/* check is there an ongoing stroke right now */
	char stroke_active;

	char draw_anchored;
	char do_linear_conversion;

	float anchored_initial_mouse[2];

	/* radius of brush, premultiplied with pressure.
	 * In case of anchored brushes contains the anchored radius */
	float pixel_radius;

	/* 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 mask texture */
	float mask_tex_mouse[2];

	/* ColorSpace cache to avoid locking up during sampling */
	struct ColorSpace *colorspace;
} UnifiedPaintSettings;

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)
} UnifiedPaintSettingsFlags;

typedef struct MeshStatVis {
	char type;
	char _pad1[2];

	/* overhang */
	char  overhang_axis;
	float overhang_min, overhang_max;

	/* thickness */
	float thickness_min, thickness_max;
	char thickness_samples;
	char _pad2[3];

	/* distort */
	float distort_min, distort_max;

	/* sharp */
	float sharp_min, sharp_max;
} MeshStatVis;


/* *************************************************************** */
/* Tool Settings */

typedef struct ToolSettings {
	VPaint *vpaint;		/* vertex paint */
	VPaint *wpaint;		/* weight paint */
	Sculpt *sculpt;
	UvSculpt *uvsculpt;	/* uv smooth */
	
	/* Vertex group weight - used only for editmode, not weight
	 * paint */
	float vgroup_weight;

	float doublimit;	/* remove doubles limit */
	float normalsize;	/* size of normals */
	short automerge;

	/* Selection Mode for Mesh */
	short selectmode;

	/* UV Calculation */
	char unwrapper;
	char uvcalc_flag;
	char uv_flag;
	char uv_selectmode;

	float uvcalc_margin;

	/* Auto-IK */
	short autoik_chainlen;  /* runtime only */

	/* Grease Pencil */
	char gpencil_flags;		/* flags/options for how the tool works */
	char gpencil_src;		/* for main 3D view Grease Pencil, where data comes from */

	char pad[4];

	/* Image Paint (8 byttse aligned please!) */
	struct ImagePaintSettings imapaint;

	/* Particle Editing */
	struct ParticleEditSettings particle;

	/* Hair Editing */
	struct HairEditSettings hair_edit;

	/* Transform Proportional Area of Effect */
	float proportional_size;

	/* Select Group Threshold */
	float select_thresh;

	/* Auto-Keying Mode */
	short autokey_mode, autokey_flag;	/* defines in DNA_userdef_types.h */

	/* Multires */
	char multires_subdiv_type;

	/* Motion Paths update in real time */
	char realtime_motion_path;

	/* Skeleton generation */
	short skgen_resolution;
	float skgen_threshold_internal;
	float skgen_threshold_external;
	float skgen_length_ratio;
	float skgen_length_limit;
	float skgen_angle_limit;
	float skgen_correlation_limit;
	float skgen_symmetry_limit;
	float skgen_retarget_angle_weight;
	float skgen_retarget_length_weight;
	float skgen_retarget_distance_weight;
	short skgen_options;
	char  skgen_postpro;
	char  skgen_postpro_passes;
	char  skgen_subdivisions[3];
	char  skgen_multi_level;

	/* Skeleton Sketching */
	struct Object *skgen_template;
	char bone_sketching;
	char bone_sketching_convert;
	char skgen_subdivision_number;
	char skgen_retarget_options;
	char skgen_retarget_roll;
	char skgen_side_string[8];
	char skgen_num_string[8];
	
	/* Alt+RMB option */
	char edge_mode;
	char edge_mode_live_unwrap;

	/* Transform */
	char snap_mode, snap_node_mode;
	char snap_uv_mode;
	short snap_flag, snap_target;
	short proportional, prop_mode;
	char proportional_objects; /* proportional edit, object mode */
	char proportional_mask; /* proportional edit, mask editing */
	char proportional_action; /* proportional edit, action editor */
	char proportional_fcurve; /* proportional edit, graph editor */
	char lock_markers; /* lock marker editing */
	char pad4[5];

	char auto_normalize; /*auto normalizing mode in wpaint*/
	char multipaint; /* paint multiple bones in wpaint */
	char weightuser;
	char vgroupsubset; /* subset selection filter in wpaint */

	/* UV painting */
	int use_uv_sculpt;
	int uv_sculpt_settings;
	int uv_sculpt_tool;
	int uv_relax_method;
	/* XXX: these sculpt_paint_* fields are deprecated, use the
	 * unified_paint_settings field instead! */
	short sculpt_paint_settings DNA_DEPRECATED;	short pad5;
	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 MeshStatVis statvis;
} ToolSettings;

/* *************************************************************** */
/* Assorted Scene Data */

/* ------------------------------------------- */
/* Stats (show in Info header) */

typedef struct bStats {
	/* scene totals for visible layers */
	int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature;
	int totvert, totface;
} bStats;

/* ------------------------------------------- */
/* Unit Settings */

typedef struct UnitSettings {
	/* Display/Editing unit options for each scene */
	float scale_length; /* maybe have other unit conversions? */
	char system; /* imperial, metric etc */
	char system_rotation; /* not implemented as a proper unit system yet */
	short flag;
} UnitSettings;

/* ------------------------------------------- */
/* Global/Common Physics Settings */

typedef struct PhysicsSettings {
	float gravity[3];
	int flag, quick_cache_step, rt;
} PhysicsSettings;

/* ------------------------------------------- */
/* Safe Area options used in Camera View & VSE
 */
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 */

	float title[2];		/* Title Safe */
	float action[2];	/* Image/Graphics Safe */

	/* use for alternate aspect ratio */
	float title_center[2];
	float action_center[2];
} DisplaySafeAreas;

/* *************************************************************** */
/* Scene ID-Block */

typedef struct Scene {
	ID id;
	struct AnimData *adt;	/* animation data (must be immediately after id for utilities to use it) */ 
	
	struct Object *camera;
	struct World *world;
	
	struct Scene *set;
	
	ListBase base;
	struct Base *basact;		/* active base */
	struct Object *obedit;		/* name replaces old G.obedit */
	
	float cursor[3];			/* 3d cursor location */
	float twcent[3];			/* center for transform widget */
	float twmin[3], twmax[3];	/* boundbox of selection for transform widget */
	
	unsigned int lay;			/* bitflags for layer visibility */
	int layact;		/* active layer */
	unsigned int lay_updated;       /* runtime flag, has layer ever been updated since load? */
	
	short flag;								/* various settings */
	
	char use_nodes;
	char pad[1];
	
	struct bNodeTree *nodetree;
	
	struct Editing *ed;								/* sequence editor data is allocated here */
	
	struct ToolSettings *toolsettings;		/* default allocated now */
	struct SceneStats *stats;				/* default allocated now */
	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;
	
	ListBase markers;
	ListBase transform_spaces;
	
	void *sound_scene;
	void *playback_handle;
	void *sound_scrub_handle;
	void *speaker_handles;
	
	void *fps_info;					/* (runtime) info/cache used for presenting playback framerate info to the user */
	
	/* none of the dependency graph  vars is mean to be saved */
	struct Depsgraph *depsgraph;
	void *pad1;
	struct  DagForest *theDag;
	short dagflags;
	short recalc;				/* recalc = counterpart of ob->recalc */

	/* User-Defined KeyingSets */
	int active_keyingset;			/* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
	ListBase keyingsets;			/* KeyingSets for this scene */
	
	/* Game Settings */
	struct GameFraming framing  DNA_DEPRECATED; // XXX  deprecated since 2.5
	struct GameData gm;

	/* Units */
	struct UnitSettings unit;
	
	/* Grease Pencil */
	struct bGPdata *gpd;

	/* Physics simulation settings */
	struct PhysicsSettings physics_settings;

	/* Movie Tracking */
	struct MovieClip *clip;			/* active movie clip */

	uint64_t customdata_mask;	/* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */
	uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */

	/* Color Management */
	ColorManagedViewSettings view_settings;
	ColorManagedDisplaySettings display_settings;
	ColorManagedColorspaceSettings sequencer_colorspace_settings;
	
	/* RigidBody simulation world+settings */
	struct RigidBodyWorld *rigidbody_world;
} Scene;

/* **************** RENDERDATA ********************* */

/* flag */
	/* use preview range */
#define SCER_PRV_RANGE	(1<<0)
#define SCER_LOCK_FRAME_SELECTION	(1<<1)
	/* timeline/keyframe jumping - only selected items (on by default) */
#define SCE_KEYS_NO_SELONLY	(1<<2)

/* mode (int now) */
#define R_OSA			0x0001
#define R_SHADOW		0x0002
#define R_GAMMA			0x0004
#define R_ORTHO			0x0008
#define R_ENVMAP		0x0010
#define R_EDGE			0x0020
#define R_FIELDS		0x0040
#define R_FIELDSTILL	0x0080
/*#define R_RADIO			0x0100 */ /* deprecated */
#define R_BORDER		0x0200
#define R_PANORAMA		0x0400	/* deprecated as scene option, still used in renderer */
#define R_CROP			0x0800
/*#define R_COSMO			0x1000 deprecated */
#define R_ODDFIELD		0x2000
#define R_MBLUR			0x4000
		/* unified was here */
#define R_RAYTRACE      0x10000
		/* R_GAUSS is obsolete, but used to retrieve setting from old files */
#define R_GAUSS      	0x20000
		/* fbuf obsolete... */
/*#define R_FBUF			0x40000*/
		/* threads obsolete... is there for old files, now use for autodetect threads */
#define R_THREADS		0x80000
		/* Use the same flag for autothreads */
#define R_FIXED_THREADS		0x80000 

#define R_SPEED				0x100000
#define R_SSS				0x200000
#define R_NO_OVERWRITE		0x400000  /* skip existing files */
#define R_TOUCH				0x800000  /* touch files before rendering */
#define R_SIMPLIFY			0x1000000
#define R_EDGE_FRS			0x2000000 /* R_EDGE reserved for Freestyle */
#define R_PERSISTENT_DATA	0x4000000 /* keep data around for re-render */

/* seq_flag */
#define R_SEQ_GL_PREV 1
// #define R_SEQ_GL_REND 2  // UNUSED, opengl render has its own operator now.
#define R_SEQ_SOLID_TEX 4

/* 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*/

/* filtertype */
#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 /* note, this is only used for nodes at the moment */

/* raytrace structure */
#define R_RAYSTRUCTURE_AUTO				0
#define R_RAYSTRUCTURE_OCTREE			1
#define R_RAYSTRUCTURE_BLIBVH			2	/* removed */
#define R_RAYSTRUCTURE_VBVH				3
#define R_RAYSTRUCTURE_SIMD_SVBVH		4	/* needs SIMD */
#define R_RAYSTRUCTURE_SIMD_QBVH		5	/* needs SIMD */

/* raytrace_options */
#define R_RAYTRACE_USE_LOCAL_COORDS		0x0001
#define R_RAYTRACE_USE_INSTANCES		0x0002

/* scemode (int now) */
#define R_DOSEQ				0x0001
#define R_BG_RENDER			0x0002
		/* passepartout is camera option now, keep this for backward compatibility */
#define R_PASSEPARTOUT		0x0004
#define R_BUTS_PREVIEW		0x0008
#define R_EXTENSION			0x0010
#define R_MATNODE_PREVIEW	0x0020
#define R_DOCOMP			0x0040
#define R_COMP_CROP			0x0080
#define R_FREE_IMAGE		0x0100
#define R_SINGLE_LAYER		0x0200
#define R_EXR_TILE_FILE		0x0400
#define R_COMP_FREE			0x0800
#define R_NO_IMAGE_LOAD		0x1000
#define R_NO_TEX			0x2000
#define R_NO_FRAME_UPDATE	0x4000
#define R_FULL_SAMPLE		0x8000
/* #define R_DEPRECATED		0x10000 */
/* #define R_RECURS_PROTECTION	0x20000 */
#define R_TEXNODE_PREVIEW	0x40000
#define R_VIEWPORT_PREVIEW	0x80000
#define R_EXR_CACHE_FILE	0x100000
#define R_MULTIVIEW			0x200000

/* r->stamp */
#define R_STAMP_TIME 	0x0001
#define R_STAMP_FRAME	0x0002
#define R_STAMP_DATE	0x0004
#define R_STAMP_CAMERA	0x0008
#define R_STAMP_SCENE	0x0010
#define R_STAMP_NOTE	0x0020
#define R_STAMP_DRAW	0x0040 /* draw in the image */
#define R_STAMP_MARKER	0x0080
#define R_STAMP_FILENAME	0x0100
#define R_STAMP_SEQSTRIP	0x0200
#define R_STAMP_RENDERTIME	0x0400
#define R_STAMP_CAMERALENS	0x0800
#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)

/* alphamode */
#define R_ADDSKY		0
#define R_ALPHAPREMUL	1
/*#define R_ALPHAKEY		2*/ /* deprecated, shouldn't be used */

/* color_mgt_flag */
enum {
	R_COLOR_MANAGEMENT              = (1 << 0),  /* deprecated, should only be used in versioning code only */
	/*R_COLOR_MANAGEMENT_PREDIVIDE    = (1 << 1)*/  /* deprecated, shouldn't be used */
};

#if 0  /* TODO */
#if (DNA_DEPRECATED_GCC_POISON == 1)
#pragma GCC poison R_COLOR_MANAGEMENT
#endif
#endif

/* subimtype, flag options for imtype */
enum {
	R_OPENEXR_HALF	= 1,  /*deprecated*/
	R_OPENEXR_ZBUF	= 2,  /*deprecated*/
	R_PREVIEW_JPG	= 4,  /*deprecated*/
	R_CINEON_LOG	= 8,  /*deprecated*/
	R_TIFF_16BIT	= 16, /*deprecated*/

	R_JPEG2K_12BIT			=     32,  /* Jpeg2000 */                    /*deprecated*/
	R_JPEG2K_16BIT			=     64,                                    /*deprecated*/
	R_JPEG2K_YCC			=     128,  /* when disabled use RGB */      /*deprecated*/
	R_JPEG2K_CINE_PRESET	=     256,                                   /*deprecated*/
	R_JPEG2K_CINE_48FPS		=     512,                                   /*deprecated*/
};

#if (DNA_DEPRECATED_GCC_POISON == 1)
#pragma GCC poison R_OPENEXR_HALF R_OPENEXR_ZBUF R_PREVIEW_JPG R_CINEON_LOG R_TIFF_16BIT
#pragma GCC poison R_JPEG2K_12BIT R_JPEG2K_16BIT R_JPEG2K_YCC R_JPEG2K_CINE_PRESET R_JPEG2K_CINE_48FPS
#endif

/* bake_mode: same as RE_BAKE_xxx defines */
/* bake_flag: */
#define R_BAKE_CLEAR		1
#define R_BAKE_OSA			2
#define R_BAKE_TO_ACTIVE	4
#define R_BAKE_NORMALIZE	8
#define R_BAKE_MULTIRES		16
#define R_BAKE_LORES_MESH	32
#define R_BAKE_VCOL			64
#define R_BAKE_USERSCALE	128
#define R_BAKE_CAGE			256
#define R_BAKE_SPLIT_MAT	512
#define R_BAKE_AUTO_NAME	1024

/* 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_TANGENT 3

/* simplify_flag */
#define R_SIMPLE_NO_TRIANGULATE		1

/* line_thickness_mode */
#define R_LINE_THICKNESS_ABSOLUTE 1
#define R_LINE_THICKNESS_RELATIVE 2

/* sequencer seq_prev_type seq_rend_type */

/* scene->r.engine (scene.c) */
extern const char *RE_engine_id_BLENDER_RENDER;
extern const char *RE_engine_id_BLENDER_GAME;
extern const char *RE_engine_id_CYCLES;

/* **************** SCENE ********************* */

/* for general use */
#define MAXFRAME	300000
#define MAXFRAMEF	300000.0f

#define MINFRAME	0
#define MINFRAMEF	0.0f

/* (minimum frame number for current-frame) */
#define MINAFRAME	-300000
#define MINAFRAMEF	-300000.0f

/* depricate this! */
#define TESTBASE(v3d, base)  (                                                \
	((base)->flag & SELECT) &&                                                \
	((base)->lay & v3d->lay) &&                                               \
	(((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
#define TESTBASELIB(v3d, base)  (                                             \
	((base)->flag & SELECT) &&                                                \
	((base)->lay & v3d->lay) &&                                               \
	((base)->object->id.lib == NULL) &&                                       \
	(((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
#define TESTBASELIB_BGMODE(v3d, scene, base)  (                               \
	((base)->flag & SELECT) &&                                                \
	((base)->lay & (v3d ? v3d->lay : scene->lay)) &&                          \
	((base)->object->id.lib == NULL) &&                                       \
	(((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
#define BASE_EDITABLE_BGMODE(v3d, scene, base)  (                             \
	((base)->lay & (v3d ? v3d->lay : scene->lay)) &&                          \
	((base)->object->id.lib == NULL) &&                                       \
	(((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
#define BASE_SELECTABLE(v3d, base)  (                                         \
	(base->lay & v3d->lay) &&                                                 \
	(base->object->restrictflag & (OB_RESTRICT_SELECT | OB_RESTRICT_VIEW)) == 0)
#define BASE_VISIBLE(v3d, base)  (                                            \
	(base->lay & v3d->lay) &&                                                 \
	(base->object->restrictflag & OB_RESTRICT_VIEW) == 0)
#define BASE_VISIBLE_BGMODE(v3d, scene, base)  (                              \
	(base->lay & (v3d ? v3d->lay : scene->lay)) &&                            \
	(base->object->restrictflag & OB_RESTRICT_VIEW) == 0)

#define FIRSTBASE		scene->base.first
#define LASTBASE		scene->base.last
#define BASACT			(scene->basact)
#define OBACT			(BASACT ? BASACT->object: NULL)

#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)

/* base->flag is in DNA_object_types.h */

/* toolsettings->snap_flag */
#define SCE_SNAP				1
#define SCE_SNAP_ROTATE			2
#define SCE_SNAP_PEEL_OBJECT	4
#define SCE_SNAP_PROJECT		8
#define SCE_SNAP_NO_SELF		16
/* 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
/* toolsettings->snap_mode */
#define SCE_SNAP_MODE_INCREMENT	0
#define SCE_SNAP_MODE_VERTEX	1
#define SCE_SNAP_MODE_EDGE		2
#define SCE_SNAP_MODE_FACE		3
#define SCE_SNAP_MODE_VOLUME	4
#define SCE_SNAP_MODE_NODE_X	5
#define SCE_SNAP_MODE_NODE_Y	6
#define SCE_SNAP_MODE_NODE_XY	7
#define SCE_SNAP_MODE_GRID		8

/* toolsettings->selectmode */
#define SCE_SELECT_VERTEX	1 /* for mesh */
#define SCE_SELECT_EDGE		2
#define SCE_SELECT_FACE		4

/* toolsettings->statvis->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

/* toolsettings->particle.selectmode for particles */
#define SCE_SELECT_PATH		1
#define SCE_SELECT_POINT	2
#define SCE_SELECT_END		4

/* sce->recalc (now in use by previewrender) */
#define SCE_PRV_CHANGED		1

/* 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

/* toolsettings->proportional */
#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
};

/* toolsettings->vgroupsubset */
/* object_vgroup.c */
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
} 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))


/* sce->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)


	/* 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

/* audio->flag */
#define AUDIO_MUTE                (1<<0)
#define AUDIO_SYNC                (1<<1)
#define AUDIO_SCRUB		          (1<<2)
#define AUDIO_VOLUME_ANIMATED     (1<<3)

enum {
	FFMPEG_MULTIPLEX_AUDIO  = 1,  /* deprecated, you can choose none as audiocodec now */
	FFMPEG_AUTOSPLIT_OUTPUT = 2,
	FFMPEG_LOSSLESS_OUTPUT  = 4,
};

#if (DNA_DEPRECATED_GCC_POISON == 1)
#pragma GCC poison FFMPEG_MULTIPLEX_AUDIO
#endif


/* Paint.flags */
typedef enum {
	PAINT_SHOW_BRUSH = (1 << 0),
	PAINT_FAST_NAVIGATE = (1 << 1),
	PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
	PAINT_USE_CAVITY_MASK = (1 << 3)
} PaintFlags;

/* Paint.symmetry_flags
 * (for now just a duplicate of sculpt symmetry flags) */
typedef enum SymmetryFlags {
	PAINT_SYMM_X = (1 << 0),
	PAINT_SYMM_Y = (1 << 1),
	PAINT_SYMM_Z = (1 << 2),
	PAINT_SYMMETRY_FEATHER = (1 << 3)
} SymmetryFlags;

#define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)

/* Sculpt.flags */
/* These can eventually be moved to paint flags? */
typedef enum SculptFlags {
	/* deprecated, part of paint struct symmetry_flags now */
	SCULPT_SYMM_X = (1 << 0),
	SCULPT_SYMM_Y = (1 << 1),
	SCULPT_SYMM_Z = (1 << 2),

	SCULPT_LOCK_X = (1 << 3),
	SCULPT_LOCK_Y = (1 << 4),
	SCULPT_LOCK_Z = (1 << 5),
	/* deprecated, part of paint struct symmetry_flags now */
	SCULPT_SYMMETRY_FEATHER = (1 << 6),

	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, 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),
} SculptFlags;

typedef enum ImagePaintMode {
	IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
	IMAGEPAINT_MODE_IMAGE,    /* select texture paint image directly */
} ImagePaintMode;

#if (DNA_DEPRECATED_GCC_POISON == 1)
#pragma GCC poison SCULPT_SYMM_X SCULPT_SYMM_Y SCULPT_SYMM_Z SCULPT_SYMMETRY_FEATHER
#endif


/* ImagePaintSettings.flag */
#define IMAGEPAINT_DRAWING				1
// #define IMAGEPAINT_DRAW_TOOL			2 // deprecated
// #define IMAGEPAINT_DRAW_TOOL_DRAWING	4 // deprecated

/* projection painting only */
#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_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
#define UVCALC_NO_ASPECT_CORRECT	2	/* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
#define UVCALC_TRANSFORM_CORRECT	4	/* adjust UV's while transforming to avoid distortion */
#define UVCALC_USESUBSURF			8	/* Use mesh data after subsurf to compute UVs*/

/* toolsettings->uv_flag */
#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

/* 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

/* toolsettings->gpencil_flags */
#define GP_TOOL_FLAG_PAINTSESSIONS_ON	(1<<0)

/* toolsettings->gpencil_src */
typedef enum eGPencil_Source_3D {
	GP_TOOL_SOURCE_SCENE    = 0,
	GP_TOOL_SOURCE_OBJECT   = 1
} eGPencil_Source_3d;

/* toolsettings->particle flag */
#define PE_KEEP_LENGTHS			1
#define PE_LOCK_FIRST			2
#define PE_DEFLECT_EMITTER		4
#define PE_INTERPOLATE_ADDED	8
#define PE_DRAW_PART			16
/* #define PE_X_MIRROR			64 */	/* deprecated */
#define PE_FADE_TIME			128
#define PE_AUTO_VELOCITY		256

/* toolsetting->particle 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

/* this must equal ParticleEditSettings.brush array size */
#define PE_TOT_BRUSH		6

/* ParticleBrushData->flag */
#define PE_BRUSH_DATA_PUFF_VOLUME 1
#define PE_BRUSH_DATA_ADD_SINGLE  2

/* tooksettings->particle edittype */
#define PE_TYPE_PARTICLES	0
#define PE_TYPE_SOFTBODY	1
#define PE_TYPE_CLOTH		2

/* toolsettings->skgen_options */
#define SKGEN_FILTER_INTERNAL	(1 << 0)
#define SKGEN_FILTER_EXTERNAL	(1 << 1)
#define	SKGEN_SYMMETRY			(1 << 2)
#define	SKGEN_CUT_LENGTH		(1 << 3)
#define	SKGEN_CUT_ANGLE			(1 << 4)
#define	SKGEN_CUT_CORRELATION	(1 << 5)
#define	SKGEN_HARMONIC			(1 << 6)
#define	SKGEN_STICK_TO_EMBEDDING	(1 << 7)
#define	SKGEN_ADAPTIVE_DISTANCE		(1 << 8)
#define SKGEN_FILTER_SMART		(1 << 9)
#define SKGEN_DISP_LENGTH		(1 << 10)
#define SKGEN_DISP_WEIGHT		(1 << 11)
#define SKGEN_DISP_ORIG			(1 << 12)
#define SKGEN_DISP_EMBED		(1 << 13)
#define SKGEN_DISP_INDEX		(1 << 14)

#define	SKGEN_SUB_LENGTH		0
#define	SKGEN_SUB_ANGLE			1
#define	SKGEN_SUB_CORRELATION	2
#define	SKGEN_SUB_TOTAL			3

/* toolsettings->skgen_postpro */
#define SKGEN_SMOOTH			0
#define SKGEN_AVERAGE			1
#define SKGEN_SHARPEN			2

/* toolsettings->bone_sketching */
#define BONE_SKETCHING			1
#define BONE_SKETCHING_QUICK	2
#define BONE_SKETCHING_ADJUST	4

/* toolsettings->bone_sketching_convert */
#define	SK_CONVERT_CUT_FIXED			0
#define	SK_CONVERT_CUT_LENGTH			1
#define	SK_CONVERT_CUT_ADAPTATIVE		2
#define	SK_CONVERT_RETARGET				3

/* toolsettings->skgen_retarget_options */
#define	SK_RETARGET_AUTONAME			1

/* toolsettings->skgen_retarget_roll */
#define	SK_RETARGET_ROLL_NONE			0
#define	SK_RETARGET_ROLL_VIEW			1
#define	SK_RETARGET_ROLL_JOINT			2

/* physics_settings->flag */
#define PHYS_GLOBAL_GRAVITY		1

/* UnitSettings */

/* UnitSettings->system */
#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

#ifdef __cplusplus
}
#endif

#endif  /* __DNA_SCENE_TYPES_H__ */