@@ -27,6 +27,29 @@ static PyObject *py_ue_edgraphpin_make_link_to(ue_PyEdGraphPin *self, PyObject *
2727 return Py_None;
2828}
2929
30+ static PyObject *py_ue_edgraphpin_connect (ue_PyEdGraphPin *self, PyObject * args) {
31+ PyObject *other_pin;
32+ if (!PyArg_ParseTuple (args, " O:connect" , &other_pin)) {
33+ return NULL ;
34+ }
35+
36+ ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin (other_pin);
37+ if (!py_other_pin) {
38+ return PyErr_Format (PyExc_Exception, " argument is not a UEdGraphPin" );
39+ }
40+
41+ if (!self->pin ->GetSchema ()->TryCreateConnection (self->pin , py_other_pin->pin )) {
42+ return PyErr_Format (PyExc_Exception, " unable to connect pins" );
43+ }
44+
45+ if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ())) {
46+ FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified (bp);
47+ }
48+
49+ Py_INCREF (Py_None);
50+ return Py_None;
51+ }
52+
3053static PyObject *py_ue_edgraphpin_break_link_to (ue_PyEdGraphPin *self, PyObject * args) {
3154 PyObject *other_pin;
3255 if (!PyArg_ParseTuple (args, " O:break_link_to" , &other_pin)) {
@@ -51,6 +74,7 @@ static PyObject *py_ue_edgraphpin_break_link_to(ue_PyEdGraphPin *self, PyObject
5174static PyMethodDef ue_PyEdGraphPin_methods[] = {
5275 { " make_link_to" , (PyCFunction)py_ue_edgraphpin_make_link_to, METH_VARARGS, " " },
5376 { " break_link_to" , (PyCFunction)py_ue_edgraphpin_break_link_to, METH_VARARGS, " " },
77+ { " connect" , (PyCFunction)py_ue_edgraphpin_connect, METH_VARARGS, " " },
5478 { NULL } /* Sentinel */
5579};
5680
0 commit comments