Skip to content

Commit 602e369

Browse files
committed
update unrealsdk again
fixes tps
1 parent cfa024b commit 602e369

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

Diff for: src/pyunrealsdk/unreal_bindings/bound_function.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ namespace impl {
130130
PyCallInfo::PyCallInfo(const UFunction* func, const py::args& args, const py::kwargs& kwargs)
131131
// Start by initializing a null struct, to avoid allocations
132132
: params(func, nullptr) {
133-
if (func->NumParams < args.size()) {
133+
if (func->NumParams() < args.size()) {
134134
throw py::type_error(
135135
unrealsdk::fmt::format("{}() takes {} positional args, but {} were given", func->Name,
136-
func->NumParams, args.size()));
136+
func->NumParams(), args.size()));
137137
}
138138

139139
// If we're given exactly one arg, and it's a wrapped struct of our function type, take it as

Diff for: src/pyunrealsdk/unreal_bindings/uobject_children.cpp

+19-7
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ void register_uobject_children(py::module_& mod) {
153153
"Returns:\n"
154154
" True if this class implements the interface, false otherwise.",
155155
"interface"_a)
156-
.def_readwrite("ClassDefaultObject", &UClass::ClassDefaultObject)
156+
.def_property(
157+
"ClassDefaultObject", [](const UClass* self) { return self->ClassDefaultObject(); },
158+
[](UClass* self, UObject* value) { self->ClassDefaultObject() = value; })
157159
.def_property_readonly("Interfaces", [](const UClass* self) {
158160
std::vector<UClass*> interfaces{};
159-
for (const auto& iface : self->Interfaces) {
161+
for (const auto& iface : self->Interfaces()) {
160162
interfaces.push_back(iface.Class);
161163
}
162164
return interfaces;
@@ -179,10 +181,18 @@ void register_uobject_children(py::module_& mod) {
179181
"\n"
180182
"Returns:\n"
181183
" The return param, or None if it doesn't exist.")
182-
.def_readwrite("FunctionFlags", &UFunction::FunctionFlags)
183-
.def_readwrite("NumParams", &UFunction::NumParams)
184-
.def_readwrite("ParamsSize", &UFunction::ParamsSize)
185-
.def_readwrite("ReturnValueOffset", &UFunction::ReturnValueOffset);
184+
.def_property(
185+
"FunctionFlags", [](const UFunction* self) { return self->FunctionFlags(); },
186+
[](UFunction* self, uint32_t value) { self->FunctionFlags() = value; })
187+
.def_property(
188+
"NumParams", [](const UFunction* self) { return self->NumParams(); },
189+
[](UFunction* self, uint8_t value) { self->NumParams() = value; })
190+
.def_property(
191+
"ParamsSize", [](const UFunction* self) { return self->ParamsSize(); },
192+
[](UFunction* self, uint16_t value) { self->ParamsSize() = value; })
193+
.def_property(
194+
"ReturnValueOffset", [](const UFunction* self) { return self->ReturnValueOffset(); },
195+
[](UFunction* self, uint16_t value) { self->ReturnValueOffset() = value; });
186196

187197
PyUEClass<UInt8Property, UProperty>(mod, "UInt8Property");
188198

@@ -204,7 +214,9 @@ void register_uobject_children(py::module_& mod) {
204214
.def_property_readonly("PropertyClass", &UObjectProperty::get_property_class);
205215

206216
PyUEClass<UScriptStruct, UStruct>(mod, "UScriptStruct")
207-
.def_readwrite("StructFlags", &UScriptStruct::StructFlags);
217+
.def_property(
218+
"StructFlags", [](const UScriptStruct* self) { return self->StructFlags(); },
219+
[](UScriptStruct* self, uint32_t value) { self->StructFlags() = value; });
208220

209221
PyUEClass<UStrProperty, UProperty>(mod, "UStrProperty");
210222

0 commit comments

Comments
 (0)