Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit a33cc83

Browse files
committed
Add init for structs
1 parent fdf5e1b commit a33cc83

11 files changed

+1357
-0
lines changed

bl2-sdk/pydefs/AkAudio_structs.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ namespace py = pybind11;
66
void Export_pystes_AkAudio_structs(py::module &m)
77
{
88
py::class_< FEnvironmentalEffectInfo >(m, "FEnvironmentalEffectInfo")
9+
.def(py::init<>())
910
.def_readwrite("EffectID", &FEnvironmentalEffectInfo::EffectID)
1011
.def_readwrite("Volume", &FEnvironmentalEffectInfo::Volume)
1112
;
1213
py::class_< FAkEventTrackKey >(m, "FAkEventTrackKey")
14+
.def(py::init<>())
1315
.def_readwrite("Time", &FAkEventTrackKey::Time)
1416
.def_readwrite("Event", &FAkEventTrackKey::Event, py::return_value_policy::reference)
1517
;
1618
py::class_< FEnvironmentalEffectSetting >(m, "FEnvironmentalEffectSetting")
19+
.def(py::init<>())
1720
.def_readwrite("Effect", &FEnvironmentalEffectSetting::Effect, py::return_value_policy::reference)
1821
.def_readwrite("Volume", &FEnvironmentalEffectSetting::Volume)
1922
.def_readwrite("FadeDistance", &FEnvironmentalEffectSetting::FadeDistance)
2023
.def_readwrite("MinDistance", &FEnvironmentalEffectSetting::MinDistance)
2124
.def_readwrite("MaxDistance", &FEnvironmentalEffectSetting::MaxDistance)
2225
;
2326
py::class_< FRTPCSetting >(m, "FRTPCSetting")
27+
.def(py::init<>())
2428
.def_readwrite("Target", &FRTPCSetting::Target, py::return_value_policy::reference)
2529
.def_readwrite("AkRtpc", &FRTPCSetting::AkRtpc, py::return_value_policy::reference)
2630
.def_readwrite("ValueAtMaxRange", &FRTPCSetting::ValueAtMaxRange)
@@ -29,6 +33,7 @@ void Export_pystes_AkAudio_structs(py::module &m)
2933
.def_readwrite("LastEvalValue", &FRTPCSetting::LastEvalValue)
3034
;
3135
py::class_< FOccludedVolume >(m, "FOccludedVolume")
36+
.def(py::init<>())
3237
.def_property("bFadeIn", [](FOccludedVolume &self){return self.bFadeIn;}, [](FOccludedVolume &self, bool value){self.bFadeIn = value ? 1 : 0;})
3338
.def_property("bExternalFade", [](FOccludedVolume &self){return self.bExternalFade;}, [](FOccludedVolume &self, bool value){self.bExternalFade = value ? 1 : 0;})
3439
.def_readwrite("SoundVolume", &FOccludedVolume::SoundVolume, py::return_value_policy::reference)

bl2-sdk/pydefs/Core_structs.cpp

+57
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,42 @@ namespace py = pybind11;
66
void Export_pystes_Core_structs(py::module &m)
77
{
88
py::class_< FRotator >(m, "FRotator")
9+
.def(py::init<>())
910
.def_readwrite("Pitch", &FRotator::Pitch)
1011
.def_readwrite("Yaw", &FRotator::Yaw)
1112
.def_readwrite("Roll", &FRotator::Roll)
1213
;
1314
py::class_< FVector2D >(m, "FVector2D")
15+
.def(py::init<>())
1416
.def_readwrite("X", &FVector2D::X)
1517
.def_readwrite("Y", &FVector2D::Y)
1618
;
1719
py::class_< FVector >(m, "FVector")
20+
.def(py::init<>())
1821
.def_readwrite("X", &FVector::X)
1922
.def_readwrite("Y", &FVector::Y)
2023
.def_readwrite("Z", &FVector::Z)
2124
;
2225
py::class_< FGuid >(m, "FGuid")
26+
.def(py::init<>())
2327
.def_readwrite("A", &FGuid::A)
2428
.def_readwrite("B", &FGuid::B)
2529
.def_readwrite("C", &FGuid::C)
2630
.def_readwrite("D", &FGuid::D)
2731
;
2832
py::class_< FVector4 >(m, "FVector4")
33+
.def(py::init<>())
2934
.def_readwrite("X", &FVector4::X)
3035
.def_readwrite("Y", &FVector4::Y)
3136
.def_readwrite("Z", &FVector4::Z)
3237
.def_readwrite("W", &FVector4::W)
3338
;
3439
py::class_< FNameBasedObjectPath >(m, "FNameBasedObjectPath")
40+
.def(py::init<>())
3541
.def_readwrite("IsSubobjectMask", &FNameBasedObjectPath::IsSubobjectMask)
3642
;
3743
py::class_< FFlag >(m, "FFlag")
44+
.def(py::init<>())
3845
.def_readwrite("Value", &FFlag::Value)
3946
.def_readwrite("Raised", &FFlag::Raised)
4047
.def_readwrite("Lowered", &FFlag::Lowered)
@@ -44,85 +51,101 @@ void Export_pystes_Core_structs(py::module &m)
4451
.def_readwrite("Duration", &FFlag::Duration)
4552
;
4653
py::class_< FQuat >(m, "FQuat")
54+
.def(py::init<>())
4755
.def_readwrite("X", &FQuat::X)
4856
.def_readwrite("Y", &FQuat::Y)
4957
.def_readwrite("Z", &FQuat::Z)
5058
.def_readwrite("W", &FQuat::W)
5159
;
5260
py::class_< FBoneAtom >(m, "FBoneAtom")
61+
.def(py::init<>())
5362
.def_readwrite("Rotation", &FBoneAtom::Rotation)
5463
.def_readwrite("Translation", &FBoneAtom::Translation)
5564
.def_readwrite("Scale", &FBoneAtom::Scale)
5665
;
5766
py::class_< FSmartVector >(m, "FSmartVector")
67+
.def(py::init<>())
5868
.def_readwrite("Vector", &FSmartVector::Vector)
5969
.def_readwrite("Flag", &FSmartVector::Flag)
6070
;
6171
py::class_< FLinearColor >(m, "FLinearColor")
72+
.def(py::init<>())
6273
.def_readwrite("R", &FLinearColor::R)
6374
.def_readwrite("G", &FLinearColor::G)
6475
.def_readwrite("B", &FLinearColor::B)
6576
.def_readwrite("A", &FLinearColor::A)
6677
;
6778
py::class_< FColor >(m, "FColor")
79+
.def(py::init<>())
6880
.def_readwrite("B", &FColor::B)
6981
.def_readwrite("G", &FColor::G)
7082
.def_readwrite("R", &FColor::R)
7183
.def_readwrite("A", &FColor::A)
7284
;
7385
py::class_< FInterpCurvePointVector2D >(m, "FInterpCurvePointVector2D")
86+
.def(py::init<>())
7487
.def_readwrite("InVal", &FInterpCurvePointVector2D::InVal)
7588
.def_readwrite("OutVal", &FInterpCurvePointVector2D::OutVal)
7689
.def_readwrite("ArriveTangent", &FInterpCurvePointVector2D::ArriveTangent)
7790
.def_readwrite("LeaveTangent", &FInterpCurvePointVector2D::LeaveTangent)
7891
.def_readwrite("InterpMode", &FInterpCurvePointVector2D::InterpMode)
7992
;
8093
py::class_< FInterpCurveVector2D >(m, "FInterpCurveVector2D")
94+
.def(py::init<>())
8195
.def_readwrite("Points", &FInterpCurveVector2D::Points)
8296
.def_readwrite("InterpMethod", &FInterpCurveVector2D::InterpMethod)
8397
;
8498
py::class_< FInterpCurvePointFloat >(m, "FInterpCurvePointFloat")
99+
.def(py::init<>())
85100
.def_readwrite("InVal", &FInterpCurvePointFloat::InVal)
86101
.def_readwrite("OutVal", &FInterpCurvePointFloat::OutVal)
87102
.def_readwrite("ArriveTangent", &FInterpCurvePointFloat::ArriveTangent)
88103
.def_readwrite("LeaveTangent", &FInterpCurvePointFloat::LeaveTangent)
89104
.def_readwrite("InterpMode", &FInterpCurvePointFloat::InterpMode)
90105
;
91106
py::class_< FInterpCurveFloat >(m, "FInterpCurveFloat")
107+
.def(py::init<>())
92108
.def_readwrite("Points", &FInterpCurveFloat::Points)
93109
.def_readwrite("InterpMethod", &FInterpCurveFloat::InterpMethod)
94110
;
95111
py::class_< FCylinder >(m, "FCylinder")
112+
.def(py::init<>())
96113
.def_readwrite("Radius", &FCylinder::Radius)
97114
.def_readwrite("Height", &FCylinder::Height)
98115
;
99116
py::class_< FInterpCurvePointVector >(m, "FInterpCurvePointVector")
117+
.def(py::init<>())
100118
.def_readwrite("InVal", &FInterpCurvePointVector::InVal)
101119
.def_readwrite("OutVal", &FInterpCurvePointVector::OutVal)
102120
.def_readwrite("ArriveTangent", &FInterpCurvePointVector::ArriveTangent)
103121
.def_readwrite("LeaveTangent", &FInterpCurvePointVector::LeaveTangent)
104122
.def_readwrite("InterpMode", &FInterpCurvePointVector::InterpMode)
105123
;
106124
py::class_< FInterpCurveVector >(m, "FInterpCurveVector")
125+
.def(py::init<>())
107126
.def_readwrite("Points", &FInterpCurveVector::Points)
108127
.def_readwrite("InterpMethod", &FInterpCurveVector::InterpMethod)
109128
;
110129
py::class_< FMatrix >(m, "FMatrix")
130+
.def(py::init<>())
111131
.def_readwrite("XPlane", &FMatrix::XPlane)
112132
.def_readwrite("YPlane", &FMatrix::YPlane)
113133
.def_readwrite("ZPlane", &FMatrix::ZPlane)
114134
.def_readwrite("WPlane", &FMatrix::WPlane)
115135
;
116136
py::class_< FBoxSphereBounds >(m, "FBoxSphereBounds")
137+
.def(py::init<>())
117138
.def_readwrite("Origin", &FBoxSphereBounds::Origin)
118139
.def_readwrite("BoxExtent", &FBoxSphereBounds::BoxExtent)
119140
.def_readwrite("SphereRadius", &FBoxSphereBounds::SphereRadius)
120141
;
121142
py::class_< FTwoVectors >(m, "FTwoVectors")
143+
.def(py::init<>())
122144
.def_readwrite("v1", &FTwoVectors::v1)
123145
.def_readwrite("v2", &FTwoVectors::v2)
124146
;
125147
py::class_< FTAlphaBlend >(m, "FTAlphaBlend")
148+
.def(py::init<>())
126149
.def_readwrite("AlphaIn", &FTAlphaBlend::AlphaIn)
127150
.def_readwrite("AlphaOut", &FTAlphaBlend::AlphaOut)
128151
.def_readwrite("AlphaTarget", &FTAlphaBlend::AlphaTarget)
@@ -131,28 +154,34 @@ void Export_pystes_Core_structs(py::module &m)
131154
.def_readwrite("BlendType", &FTAlphaBlend::BlendType)
132155
;
133156
py::class_< FPointer >(m, "FPointer")
157+
.def(py::init<>())
134158
.def_readwrite("Dummy", &FPointer::Dummy)
135159
;
136160
py::class_< FArray_Mirror >(m, "FArray_Mirror")
161+
.def(py::init<>())
137162
.def_readwrite("Data", &FArray_Mirror::Data)
138163
.def_readwrite("ArrayNum", &FArray_Mirror::ArrayNum)
139164
.def_readwrite("ArrayMax", &FArray_Mirror::ArrayMax)
140165
;
141166
py::class_< FStableArray_Mirror >(m, "FStableArray_Mirror")
167+
.def(py::init<>())
142168
.def_readwrite("ArrayNumInUse", &FStableArray_Mirror::ArrayNumInUse)
143169
.def_readwrite("ArrayNumAllocated", &FStableArray_Mirror::ArrayNumAllocated)
144170
.def_readwrite("ArrayCapacity", &FStableArray_Mirror::ArrayCapacity)
145171
.def_readwrite("FreeListHeadIndex", &FStableArray_Mirror::FreeListHeadIndex)
146172
.def_readwrite("Chunks", &FStableArray_Mirror::Chunks)
147173
;
148174
py::class_< FOctreeElementId >(m, "FOctreeElementId")
175+
.def(py::init<>())
149176
.def_readwrite("Node", &FOctreeElementId::Node)
150177
.def_readwrite("ElementIndex", &FOctreeElementId::ElementIndex)
151178
;
152179
py::class_< FRenderCommandFence >(m, "FRenderCommandFence")
180+
.def(py::init<>())
153181
.def_readwrite("NumPendingFences", &FRenderCommandFence::NumPendingFences)
154182
;
155183
py::class_< FRawDistribution >(m, "FRawDistribution")
184+
.def(py::init<>())
156185
.def_readwrite("Type", &FRawDistribution::Type)
157186
.def_readwrite("Op", &FRawDistribution::Op)
158187
.def_readwrite("LookupTableNumElements", &FRawDistribution::LookupTableNumElements)
@@ -162,93 +191,112 @@ void Export_pystes_Core_structs(py::module &m)
162191
.def_readwrite("LookupTableStartTime", &FRawDistribution::LookupTableStartTime)
163192
;
164193
py::class_< FInterpCurvePointLinearColor >(m, "FInterpCurvePointLinearColor")
194+
.def(py::init<>())
165195
.def_readwrite("InVal", &FInterpCurvePointLinearColor::InVal)
166196
.def_readwrite("OutVal", &FInterpCurvePointLinearColor::OutVal)
167197
.def_readwrite("ArriveTangent", &FInterpCurvePointLinearColor::ArriveTangent)
168198
.def_readwrite("LeaveTangent", &FInterpCurvePointLinearColor::LeaveTangent)
169199
.def_readwrite("InterpMode", &FInterpCurvePointLinearColor::InterpMode)
170200
;
171201
py::class_< FInterpCurveLinearColor >(m, "FInterpCurveLinearColor")
202+
.def(py::init<>())
172203
.def_readwrite("Points", &FInterpCurveLinearColor::Points)
173204
.def_readwrite("InterpMethod", &FInterpCurveLinearColor::InterpMethod)
174205
;
175206
py::class_< FInterpCurvePointQuat >(m, "FInterpCurvePointQuat")
207+
.def(py::init<>())
176208
.def_readwrite("InVal", &FInterpCurvePointQuat::InVal)
177209
.def_readwrite("OutVal", &FInterpCurvePointQuat::OutVal)
178210
.def_readwrite("ArriveTangent", &FInterpCurvePointQuat::ArriveTangent)
179211
.def_readwrite("LeaveTangent", &FInterpCurvePointQuat::LeaveTangent)
180212
.def_readwrite("InterpMode", &FInterpCurvePointQuat::InterpMode)
181213
;
182214
py::class_< FInterpCurveQuat >(m, "FInterpCurveQuat")
215+
.def(py::init<>())
183216
.def_readwrite("Points", &FInterpCurveQuat::Points)
184217
.def_readwrite("InterpMethod", &FInterpCurveQuat::InterpMethod)
185218
;
186219
py::class_< FInterpCurvePointTwoVectors >(m, "FInterpCurvePointTwoVectors")
220+
.def(py::init<>())
187221
.def_readwrite("InVal", &FInterpCurvePointTwoVectors::InVal)
188222
.def_readwrite("OutVal", &FInterpCurvePointTwoVectors::OutVal)
189223
.def_readwrite("ArriveTangent", &FInterpCurvePointTwoVectors::ArriveTangent)
190224
.def_readwrite("LeaveTangent", &FInterpCurvePointTwoVectors::LeaveTangent)
191225
.def_readwrite("InterpMode", &FInterpCurvePointTwoVectors::InterpMode)
192226
;
193227
py::class_< FInterpCurveTwoVectors >(m, "FInterpCurveTwoVectors")
228+
.def(py::init<>())
194229
.def_readwrite("Points", &FInterpCurveTwoVectors::Points)
195230
.def_readwrite("InterpMethod", &FInterpCurveTwoVectors::InterpMethod)
196231
;
197232
py::class_< FBox >(m, "FBox")
233+
.def(py::init<>())
198234
.def_readwrite("Min", &FBox::Min)
199235
.def_readwrite("Max", &FBox::Max)
200236
.def_readwrite("IsValid", &FBox::IsValid)
201237
;
202238
py::class_< FTPOV >(m, "FTPOV")
239+
.def(py::init<>())
203240
.def_readwrite("Location", &FTPOV::Location)
204241
.def_readwrite("Rotation", &FTPOV::Rotation)
205242
.def_readwrite("FOV", &FTPOV::FOV)
206243
;
207244
py::class_< FSHVector >(m, "FSHVector")
245+
.def(py::init<>())
208246
;
209247
py::class_< FSHVectorRGB >(m, "FSHVectorRGB")
248+
.def(py::init<>())
210249
.def_readwrite("R", &FSHVectorRGB::R)
211250
.def_readwrite("G", &FSHVectorRGB::G)
212251
.def_readwrite("B", &FSHVectorRGB::B)
213252
;
214253
py::class_< FIntPoint3D >(m, "FIntPoint3D")
254+
.def(py::init<>())
215255
.def_readwrite("X", &FIntPoint3D::X)
216256
.def_readwrite("Y", &FIntPoint3D::Y)
217257
.def_readwrite("Z", &FIntPoint3D::Z)
218258
;
219259
py::class_< FIntPoint >(m, "FIntPoint")
260+
.def(py::init<>())
220261
.def_readwrite("X", &FIntPoint::X)
221262
.def_readwrite("Y", &FIntPoint::Y)
222263
;
223264
py::class_< FPackedNormal >(m, "FPackedNormal")
265+
.def(py::init<>())
224266
.def_readwrite("X", &FPackedNormal::X)
225267
.def_readwrite("Y", &FPackedNormal::Y)
226268
.def_readwrite("Z", &FPackedNormal::Z)
227269
.def_readwrite("W", &FPackedNormal::W)
228270
;
229271
py::class_< FChunkedList_Mirror >(m, "FChunkedList_Mirror")
272+
.def(py::init<>())
230273
.def_readwrite("Members", &FChunkedList_Mirror::Members)
231274
;
232275
py::class_< FIndirectArray_Mirror >(m, "FIndirectArray_Mirror")
276+
.def(py::init<>())
233277
.def_readwrite("Data", &FIndirectArray_Mirror::Data)
234278
.def_readwrite("ArrayNum", &FIndirectArray_Mirror::ArrayNum)
235279
.def_readwrite("ArrayMax", &FIndirectArray_Mirror::ArrayMax)
236280
;
237281
py::class_< FInlinePointerArray_Mirror >(m, "FInlinePointerArray_Mirror")
282+
.def(py::init<>())
238283
.def_readwrite("InlineData", &FInlinePointerArray_Mirror::InlineData)
239284
.def_readwrite("SecondaryData", &FInlinePointerArray_Mirror::SecondaryData)
240285
;
241286
py::class_< FFColorVertexBuffer_Mirror >(m, "FFColorVertexBuffer_Mirror")
287+
.def(py::init<>())
242288
.def_readwrite("VfTable", &FFColorVertexBuffer_Mirror::VfTable)
243289
.def_readwrite("VertexData", &FFColorVertexBuffer_Mirror::VertexData)
244290
.def_readwrite("Data", &FFColorVertexBuffer_Mirror::Data)
245291
.def_readwrite("Stride", &FFColorVertexBuffer_Mirror::Stride)
246292
.def_readwrite("NumVertices", &FFColorVertexBuffer_Mirror::NumVertices)
247293
;
248294
py::class_< FRenderCommandFence_Mirror >(m, "FRenderCommandFence_Mirror")
295+
.def(py::init<>())
249296
.def_readwrite("NumPendingFences", &FRenderCommandFence_Mirror::NumPendingFences)
250297
;
251298
py::class_< FUntypedBulkData_Mirror >(m, "FUntypedBulkData_Mirror")
299+
.def(py::init<>())
252300
.def_readwrite("VfTable", &FUntypedBulkData_Mirror::VfTable)
253301
.def_readwrite("BulkDataFlags", &FUntypedBulkData_Mirror::BulkDataFlags)
254302
.def_readwrite("ElementCount", &FUntypedBulkData_Mirror::ElementCount)
@@ -264,40 +312,49 @@ void Export_pystes_Core_structs(py::module &m)
264312
.def_readwrite("bShouldFreeOnEmpty", &FUntypedBulkData_Mirror::bShouldFreeOnEmpty)
265313
;
266314
py::class_< FBitArray_Mirror >(m, "FBitArray_Mirror")
315+
.def(py::init<>())
267316
.def_readwrite("IndirectData", &FBitArray_Mirror::IndirectData)
268317
.def_readwrite("NumBits", &FBitArray_Mirror::NumBits)
269318
.def_readwrite("MaxBits", &FBitArray_Mirror::MaxBits)
270319
;
271320
py::class_< FSparseArray_Mirror >(m, "FSparseArray_Mirror")
321+
.def(py::init<>())
272322
.def_readwrite("Elements", &FSparseArray_Mirror::Elements)
273323
.def_readwrite("AllocationFlags", &FSparseArray_Mirror::AllocationFlags)
274324
.def_readwrite("FirstFreeIndex", &FSparseArray_Mirror::FirstFreeIndex)
275325
.def_readwrite("NumFreeIndices", &FSparseArray_Mirror::NumFreeIndices)
276326
;
277327
py::class_< FSet_Mirror >(m, "FSet_Mirror")
328+
.def(py::init<>())
278329
.def_readwrite("Elements", &FSet_Mirror::Elements)
279330
.def_readwrite("InlineHash", &FSet_Mirror::InlineHash)
280331
.def_readwrite("Hash", &FSet_Mirror::Hash)
281332
.def_readwrite("HashSize", &FSet_Mirror::HashSize)
282333
;
283334
py::class_< FMultiMap_Mirror >(m, "FMultiMap_Mirror")
335+
.def(py::init<>())
284336
.def_readwrite("Pairs", &FMultiMap_Mirror::Pairs)
285337
;
286338
py::class_< FMap_Mirror >(m, "FMap_Mirror")
339+
.def(py::init<>())
287340
.def_readwrite("Pairs", &FMap_Mirror::Pairs)
288341
;
289342
py::class_< FThreadSafeCounter >(m, "FThreadSafeCounter")
343+
.def(py::init<>())
290344
.def_readwrite("Value", &FThreadSafeCounter::Value)
291345
;
292346
py::class_< FDouble >(m, "FDouble")
347+
.def(py::init<>())
293348
.def_readwrite("A", &FDouble::A)
294349
.def_readwrite("B", &FDouble::B)
295350
;
296351
py::class_< FQWord >(m, "FQWord")
352+
.def(py::init<>())
297353
.def_readwrite("A", &FQWord::A)
298354
.def_readwrite("B", &FQWord::B)
299355
;
300356
py::class_< FRawDistributionFloat >(m, "FRawDistributionFloat")
357+
.def(py::init<>())
301358
.def_readwrite("Distribution", &FRawDistributionFloat::Distribution)
302359
.def_readwrite("Type", &FRawDistribution::Type)
303360
.def_readwrite("Op", &FRawDistribution::Op)

0 commit comments

Comments
 (0)