-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMaterialInstanceResource.bt
More file actions
103 lines (91 loc) · 1.93 KB
/
CMaterialInstanceResource.bt
File metadata and controls
103 lines (91 loc) · 1.93 KB
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
#ifndef _CMATERIALINSTANCERESOURCE
#define _CMATERIALINSTANCERESOURCE
#include "CChunkDescriptor.bt"
#include "CMayaSpline.bt"
#include "NGraphicsMaterial.bt"
int getCountFromBits(int b) {
local int count = 0;
while (b > 0) {
count += (b & 1);
b >>= 1;
}
return count;
}
typedef struct {
FourCC type;
FourCC id;
uchar unk1;
uchar unk2;
} CVariableDesc <name=(Str("%s %s", type, id))>;
typedef struct {
FourCC id;
uchar type;
switch (type) {
case 2:
int unk;
break;
case 3:
case 4:
case 12:
CColor4f color;
break;
case 5:
case 6:
case 7:
case 8:
GUID texture;
STextureUsageInfo textureUsage;
break;
case 10:
CVector4i unk;
break;
case 32:
uchar unk1[3];
CColor4f unk2;
CColor4f unk3;
break;
case 48:
uchar unk2[3];
CColor4f color1;
CColor4f color2;
CColor4f color3;
break;
}
} CMaterialInstanceData; // named from CMaterialInstanceDataBuilder, not guaranteed to be accurate
typedef struct {
ChunkDescriptor chunk;
GUID guid1;
GUID guid2;
if (form.readerVersion == 37) {
uchar unkByte;
uchar unkByte2;
uint unkInt;
uint unkInt2;
uint variableDescCount;
CVariableDesc variableDescs[variableDescCount];
uchar unkByte3;
if (unkByte3) {
struct {
ubyte packedCount;
local int actualCount = getCountFromBits(packedCount);
if (actualCount > 0) {
CMayaSpline splines[actualCount] <optimize = false>;
}
} unkData[unkByte3] <optimize = false>;
}
ubyte unk4;
} else {
uint unk1;
uchar unk2;
uint unk3;
uint variableDescCount;
CVariableDesc varibleDescs[variableDescCount];
}
uint propertyCount;
CMaterialInstanceData data[propertyCount]<optimize = false>;
uint unkFccCount;
struct {
FourCC fcc;
} unkFourCC[unkFccCount];
} CMaterialInstanceResource;
#endif// _CMATERIALINSTANCERESOURCE