Skip to content

Commit d957ca0

Browse files
author
David
committed
Additional function wraps added while debugging blueprint node creation from example scripts for 4.25.
1 parent 5c96b51 commit d957ca0

4 files changed

Lines changed: 37 additions & 0 deletions

File tree

‎Source/UnrealEnginePython/Private/Blueprint/UEPyEdGraph.cpp‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,32 @@ PyObject *py_ue_node_find_pin(ue_PyUObject * self, PyObject * args)
654654
return py_ue_new_edgraphpin(pin);
655655
}
656656

657+
PyObject *py_ue_node_set_purity(ue_PyUObject * self, PyObject * args)
658+
{
659+
ue_py_check(self);
660+
661+
PyObject *py_bool = nullptr;
662+
if (!PyArg_ParseTuple(args, "O:set_purity", &py_bool))
663+
{
664+
return nullptr;
665+
}
666+
667+
UK2Node_DynamicCast *node = ue_py_check_type<UK2Node_DynamicCast>(self);
668+
if (!node)
669+
return PyErr_Format(PyExc_Exception, "uobject is not a K2Node_DynamicCast");
670+
671+
if (PyObject_IsTrue(py_bool))
672+
{
673+
node->SetPurity(true);
674+
}
675+
else
676+
{
677+
node->SetPurity(false);
678+
}
679+
680+
Py_RETURN_NONE;
681+
}
682+
657683
PyObject *py_ue_node_function_entry_set_pure(ue_PyUObject * self, PyObject * args)
658684
{
659685

‎Source/UnrealEnginePython/Private/Blueprint/UEPyEdGraph.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ PyObject *py_ue_node_create_pin(ue_PyUObject *, PyObject *);
2828
PyObject *py_ue_node_pin_type_changed(ue_PyUObject *, PyObject *);
2929
PyObject *py_ue_node_pin_default_value_changed(ue_PyUObject *, PyObject *);
3030

31+
PyObject *py_ue_node_set_purity(ue_PyUObject *, PyObject *);
32+
3133
PyObject *py_ue_node_function_entry_set_pure(ue_PyUObject *, PyObject *);
3234

3335
PyObject *py_ue_node_get_title(ue_PyUObject *, PyObject *);

‎Source/UnrealEnginePython/Private/Blueprint/UEPyEdGraphPin.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,15 @@ static int py_ue_edgraphpin_set_sub_category(ue_PyEdGraphPin *self, PyObject *va
253253
return -1;
254254
}
255255

256+
static PyObject *py_ue_edgraphpin_get_direction(ue_PyEdGraphPin *self, void *closure)
257+
{
258+
uint8 direction = self->pin->Direction;
259+
return PyLong_FromLong((long)direction);
260+
}
261+
256262
static PyGetSetDef ue_PyEdGraphPin_getseters[] = {
257263
{ (char*)"name", (getter)py_ue_edgraphpin_get_name, NULL, (char *)"", NULL },
264+
{ (char*)"direction", (getter)py_ue_edgraphpin_get_direction, NULL, (char *)"", NULL },
258265
{ (char*)"category", (getter)py_ue_edgraphpin_get_category, (setter)py_ue_edgraphpin_set_category, (char *)"", NULL },
259266
{ (char*)"sub_category", (getter)py_ue_edgraphpin_get_sub_category, (setter)py_ue_edgraphpin_set_sub_category, (char *)"", NULL },
260267
{ (char*)"default_value", (getter)py_ue_edgraphpin_get_default_value, (setter)py_ue_edgraphpin_set_default_value, (char *)"", NULL },

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@ static PyMethodDef ue_PyUObject_methods[] = {
678678
{ "node_pin_type_changed", (PyCFunction)py_ue_node_pin_type_changed, METH_VARARGS, "" },
679679
{ "node_pin_default_value_changed", (PyCFunction)py_ue_node_pin_default_value_changed, METH_VARARGS, "" },
680680

681+
{ "node_set_purity", (PyCFunction)py_ue_node_set_purity, METH_VARARGS, "" },
682+
681683
{ "node_function_entry_set_pure", (PyCFunction)py_ue_node_function_entry_set_pure, METH_VARARGS, "" },
682684

683685
{ "node_allocate_default_pins", (PyCFunction)py_ue_node_allocate_default_pins, METH_VARARGS, "" },

0 commit comments

Comments
 (0)