Skip to content

Commit 7dccc39

Browse files
author
Roberto De Ioris
committed
added game_viewport_client_set_rendering_flag()
1 parent d167ca0 commit 7dccc39

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static PyMethodDef ue_PyUObject_methods[] = {
755755
{ "has_world", (PyCFunction)py_ue_has_world, METH_VARARGS, "" },
756756

757757
{ "get_game_viewport", (PyCFunction)py_ue_get_game_viewport, METH_VARARGS, "" },
758+
759+
{ "game_viewport_client_set_rendering_flag", (PyCFunction)py_ue_game_viewport_client_set_rendering_flag, METH_VARARGS, "" },
758760

759761
{ "get_world_location_at_distance_along_spline", (PyCFunction)py_ue_get_world_location_at_distance_along_spline, METH_VARARGS, "" },
760762
{ "get_spline_length", (PyCFunction)py_ue_get_spline_length, METH_VARARGS, "" },

Source/UnrealEnginePython/Private/UObject/UEPyViewport.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,28 @@ PyObject *py_ue_remove_all_viewport_widgets(ue_PyUObject *self, PyObject * args)
208208
Py_RETURN_NONE;
209209
}
210210

211+
PyObject *py_ue_game_viewport_client_set_rendering_flag(ue_PyUObject *self, PyObject * args)
212+
{
213+
214+
ue_py_check(self);
215+
216+
PyObject *py_bool;
217+
218+
if (!PyArg_ParseTuple(args, "O:game_viewport_client_set_rendering_flag", &py_bool))
219+
{
220+
return nullptr;
221+
}
222+
223+
bool bEnabled = PyObject_IsTrue(py_bool) ? true : false;
224+
225+
UGameViewportClient *ViewportClient = ue_py_check_type<UGameViewportClient>(self);
226+
if (!ViewportClient)
227+
{
228+
return PyErr_Format(PyExc_Exception, "object is not a UGameViewportClient");
229+
}
230+
231+
ViewportClient->EngineShowFlags.Rendering = bEnabled;
232+
233+
Py_RETURN_NONE;
234+
}
235+

Source/UnrealEnginePython/Private/UObject/UEPyViewport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ PyObject *py_unreal_engine_editor_set_view_rotation(PyObject *, PyObject *);
1616
PyObject *py_ue_add_viewport_widget_content(ue_PyUObject *, PyObject *);
1717
PyObject *py_ue_remove_viewport_widget_content(ue_PyUObject *, PyObject *);
1818
PyObject *py_ue_remove_all_viewport_widgets(ue_PyUObject *, PyObject *);
19+
PyObject *py_ue_game_viewport_client_set_rendering_flag(ue_PyUObject *, PyObject *);

Source/UnrealEnginePython/Private/UObject/UEPyWorld.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ PyObject *py_ue_get_game_viewport(ue_PyUObject *self, PyObject * args)
195195
Py_RETURN_UOBJECT(viewport_client);
196196
}
197197

198+
199+
200+
198201
PyObject *py_ue_has_world(ue_PyUObject *self, PyObject * args)
199202
{
200203

0 commit comments

Comments
 (0)