Skip to content

Commit

Permalink
Merge pull request #504 from heylenz/master
Browse files Browse the repository at this point in the history
pyactor add  function "set_actor_hidden_in_game"
  • Loading branch information
Roberto De Ioris authored Aug 13, 2018
2 parents 6556d36 + 9aac61e commit 95b4136
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/UnrealEnginePython/Private/UEPyModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,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, "" },
Expand Down
29 changes: 29 additions & 0 deletions Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down
1 change: 1 addition & 0 deletions Source/UnrealEnginePython/Private/UObject/UEPyActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit 95b4136

Please sign in to comment.