Skip to content

Commit 6f20333

Browse files
author
Roberto De Ioris
committed
added can_modify() wrapper for UObject
1 parent 238383d commit 6f20333

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ static PyMethodDef ue_PyUObject_methods[] = {
404404
{ "get_path_name", (PyCFunction)py_ue_get_path_name, METH_VARARGS, "" },
405405
{ "get_full_name", (PyCFunction)py_ue_get_full_name, METH_VARARGS, "" },
406406

407+
{ "can_modify", (PyCFunction)py_ue_can_modify, METH_VARARGS, "" },
408+
407409
{ "set_name", (PyCFunction)py_ue_set_name, METH_VARARGS, "" },
408410

409411
{ "bind_event", (PyCFunction)py_ue_bind_event, METH_VARARGS, "" },

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ PyObject *py_ue_find_function(ue_PyUObject * self, PyObject * args) {
329329

330330
}
331331

332+
PyObject *py_ue_can_modify(ue_PyUObject *self, PyObject * args) {
333+
334+
ue_py_check(self);
335+
336+
if (self->ue_object->CanModify()) {
337+
Py_RETURN_TRUE;
338+
}
339+
340+
Py_RETURN_FALSE;
341+
}
342+
332343
PyObject *py_ue_set_name(ue_PyUObject *self, PyObject * args) {
333344

334345
ue_py_check(self);

Source/UnrealEnginePython/Private/UObject/UEPyObject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ PyObject *py_ue_add_property(ue_PyUObject *, PyObject *);
4242

4343
PyObject *py_ue_as_dict(ue_PyUObject *, PyObject *);
4444

45+
PyObject *py_ue_can_modify(ue_PyUObject *, PyObject *);
46+
4547
PyObject *py_ue_get_outer(ue_PyUObject *, PyObject *);
4648
PyObject *py_ue_get_outermost(ue_PyUObject *, PyObject *);
4749
PyObject *py_ue_conditional_begin_destroy(ue_PyUObject *, PyObject *);

0 commit comments

Comments
 (0)