diff --git a/Source/UnrealEnginePython/Private/UEPyModule.cpp b/Source/UnrealEnginePython/Private/UEPyModule.cpp index ffbd2d9f7..f15b41b99 100644 --- a/Source/UnrealEnginePython/Private/UEPyModule.cpp +++ b/Source/UnrealEnginePython/Private/UEPyModule.cpp @@ -599,6 +599,7 @@ static PyMethodDef ue_PyUObject_methods[] = { { "save_config", (PyCFunction)py_ue_save_config, METH_VARARGS, "" }, { "get_actor_label", (PyCFunction)py_ue_get_actor_label, METH_VARARGS, "" }, { "set_actor_label", (PyCFunction)py_ue_set_actor_label, METH_VARARGS, "" }, + { "set_actor_hidden_in_game", (PyCFunction)py_ue_set_actor_hidden_in_game, METH_VARARGS, "" }, { "get_editor_world_counterpart_actor", (PyCFunction)py_ue_get_editor_world_counterpart_actor, METH_VARARGS, "" }, { "component_type_registry_invalidate_class", (PyCFunction)py_ue_component_type_registry_invalidate_class, METH_VARARGS, "" }, diff --git a/Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp b/Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp index fca6298a5..92f0a96d5 100644 --- a/Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp +++ b/Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp @@ -261,6 +261,35 @@ PyObject *py_ue_set_actor_label(ue_PyUObject *self, PyObject * args) Py_RETURN_NONE; } +PyObject *py_ue_set_actor_hidden_in_game(ue_PyUObject *self, PyObject * args) +{ + + ue_py_check(self); + + AActor *actor = ue_get_actor(self); + if (!actor) + return PyErr_Format(PyExc_Exception, "cannot retrieve Actor from uobject"); + + PyObject *py_bool = nullptr; + if (!PyArg_ParseTuple(args, "O:set_actor_hidden_in_game", &py_bool)) + { + return nullptr; + } + + if (PyObject_IsTrue(py_bool)) + { + actor->SetActorHiddenInGame(true); + } + else + { + actor->SetActorHiddenInGame(false); + } + + + + Py_RETURN_NONE; +} + PyObject *py_ue_find_actor_by_label(ue_PyUObject * self, PyObject * args) { diff --git a/Source/UnrealEnginePython/Private/UObject/UEPyActor.h b/Source/UnrealEnginePython/Private/UObject/UEPyActor.h index dbc72a9fd..9ab27f13c 100644 --- a/Source/UnrealEnginePython/Private/UObject/UEPyActor.h +++ b/Source/UnrealEnginePython/Private/UObject/UEPyActor.h @@ -27,6 +27,7 @@ PyObject *py_ue_actor_set_level_sequence(ue_PyUObject *, PyObject *); #if WITH_EDITOR PyObject *py_ue_get_actor_label(ue_PyUObject *, PyObject *); PyObject *py_ue_set_actor_label(ue_PyUObject *, PyObject *); +PyObject *py_ue_set_actor_hidden_in_game(ue_PyUObject *, PyObject *); PyObject *py_ue_find_actor_by_label(ue_PyUObject *, PyObject *); PyObject *py_ue_get_editor_world_counterpart_actor(ue_PyUObject *, PyObject *); PyObject *py_ue_component_type_registry_invalidate_class(ue_PyUObject *, PyObject *);