1+ #include " UEPyEdGraphPin.h"
12
23#if WITH_EDITOR
34
4-
5- #include " UnrealEnginePythonPrivatePCH.h"
65#include " Runtime/Engine/Classes/EdGraph/EdGraphPin.h"
76#include " Editor/UnrealEd/Public/Kismet2/BlueprintEditorUtils.h"
87
9- static PyObject *py_ue_edgraphpin_make_link_to (ue_PyEdGraphPin *self, PyObject * args) {
8+ static PyObject *py_ue_edgraphpin_make_link_to (ue_PyEdGraphPin *self, PyObject * args)
9+ {
1010 PyObject *other_pin;
11- if (!PyArg_ParseTuple (args, " O:make_link_to" , &other_pin)) {
11+ if (!PyArg_ParseTuple (args, " O:make_link_to" , &other_pin))
12+ {
1213 return NULL ;
1314 }
1415
1516 ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin (other_pin);
16- if (!py_other_pin) {
17+ if (!py_other_pin)
18+ {
1719 return PyErr_Format (PyExc_Exception, " argument is not a UEdGraphPin" );
1820 }
1921
2022 self->pin ->MakeLinkTo (py_other_pin->pin );
2123
22- if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ())) {
24+ if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ()))
25+ {
2326 FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified (bp);
2427 }
2528
2629 Py_INCREF (Py_None);
2730 return Py_None;
2831}
2932
30- static PyObject *py_ue_edgraphpin_connect (ue_PyEdGraphPin *self, PyObject * args) {
33+ static PyObject *py_ue_edgraphpin_connect (ue_PyEdGraphPin *self, PyObject * args)
34+ {
3135 PyObject *other_pin;
32- if (!PyArg_ParseTuple (args, " O:connect" , &other_pin)) {
36+ if (!PyArg_ParseTuple (args, " O:connect" , &other_pin))
37+ {
3338 return NULL ;
3439 }
3540
3641 ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin (other_pin);
37- if (!py_other_pin) {
42+ if (!py_other_pin)
43+ {
3844 return PyErr_Format (PyExc_Exception, " argument is not a UEdGraphPin" );
3945 }
4046
41- if (!self->pin ->GetSchema ()->TryCreateConnection (self->pin , py_other_pin->pin )) {
47+ if (!self->pin ->GetSchema ()->TryCreateConnection (self->pin , py_other_pin->pin ))
48+ {
4249 return PyErr_Format (PyExc_Exception, " unable to connect pins" );
4350 }
4451
45- if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ())) {
52+ if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ()))
53+ {
4654 FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified (bp);
4755 }
4856
4957 Py_INCREF (Py_None);
5058 return Py_None;
5159}
5260
53- static PyObject *py_ue_edgraphpin_break_link_to (ue_PyEdGraphPin *self, PyObject * args) {
61+ static PyObject *py_ue_edgraphpin_break_link_to (ue_PyEdGraphPin *self, PyObject * args)
62+ {
5463 PyObject *other_pin;
55- if (!PyArg_ParseTuple (args, " O:break_link_to" , &other_pin)) {
64+ if (!PyArg_ParseTuple (args, " O:break_link_to" , &other_pin))
65+ {
5666 return NULL ;
5767 }
5868
5969 ue_PyEdGraphPin *py_other_pin = py_ue_is_edgraphpin (other_pin);
60- if (!py_other_pin) {
70+ if (!py_other_pin)
71+ {
6172 return PyErr_Format (PyExc_Exception, " argument is not a UEdGraphPin" );
6273 }
6374
6475 self->pin ->BreakLinkTo (py_other_pin->pin );
6576
66- if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ())) {
77+ if (UBlueprint *bp = Cast<UBlueprint>(self->pin ->GetOwningNode ()->GetGraph ()->GetOuter ()))
78+ {
6779 FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified (bp);
6880 }
6981
@@ -78,36 +90,42 @@ static PyMethodDef ue_PyEdGraphPin_methods[] = {
7890 { NULL } /* Sentinel */
7991};
8092
81- static PyObject *py_ue_edgraphpin_get_name (ue_PyEdGraphPin *self, void *closure) {
93+ static PyObject *py_ue_edgraphpin_get_name (ue_PyEdGraphPin *self, void *closure)
94+ {
8295#if ENGINE_MINOR_VERSION > 18
8396 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->PinName .ToString ())));
8497#else
8598 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->PinName )));
8699#endif
87100}
88101
89- static PyObject *py_ue_edgraphpin_get_category (ue_PyEdGraphPin *self, void *closure) {
102+ static PyObject *py_ue_edgraphpin_get_category (ue_PyEdGraphPin *self, void *closure)
103+ {
90104#if ENGINE_MINOR_VERSION > 18
91105 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->PinType .PinCategory .ToString ())));
92106#else
93107 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->PinType .PinCategory )));
94108#endif
95109}
96110
97- static PyObject *py_ue_edgraphpin_get_sub_category (ue_PyEdGraphPin *self, void *closure) {
111+ static PyObject *py_ue_edgraphpin_get_sub_category (ue_PyEdGraphPin *self, void *closure)
112+ {
98113#if ENGINE_MINOR_VERSION > 18
99114 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->PinType .PinSubCategory .ToString ())));
100115#else
101116 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->PinType .PinSubCategory )));
102117#endif
103118}
104119
105- static PyObject *py_ue_edgraphpin_get_default_value (ue_PyEdGraphPin *self, void *closure) {
120+ static PyObject *py_ue_edgraphpin_get_default_value (ue_PyEdGraphPin *self, void *closure)
121+ {
106122 return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->pin ->DefaultValue )));
107123}
108124
109- static int py_ue_edgraphpin_set_default_value (ue_PyEdGraphPin *self, PyObject *value, void *closure) {
110- if (value && PyUnicode_Check (value)) {
125+ static int py_ue_edgraphpin_set_default_value (ue_PyEdGraphPin *self, PyObject *value, void *closure)
126+ {
127+ if (value && PyUnicode_Check (value))
128+ {
111129 char *str = PyUnicode_AsUTF8 (value);
112130 self->pin ->DefaultValue = UTF8_TO_TCHAR (str);
113131 return 0 ;
@@ -116,16 +134,20 @@ static int py_ue_edgraphpin_set_default_value(ue_PyEdGraphPin *self, PyObject *v
116134 return -1 ;
117135}
118136
119- static PyObject *py_ue_edgraphpin_get_default_object (ue_PyEdGraphPin *self, void *closure) {
137+ static PyObject *py_ue_edgraphpin_get_default_object (ue_PyEdGraphPin *self, void *closure)
138+ {
120139 UObject *u_object = self->pin ->DefaultObject ;
121- if (!u_object) {
140+ if (!u_object)
141+ {
122142 Py_RETURN_NONE;
123143 }
124144 Py_RETURN_UOBJECT (u_object);
125145}
126146
127- static int py_ue_edgraphpin_set_default_object (ue_PyEdGraphPin *self, PyObject *value, void *closure) {
128- if (value && ue_is_pyuobject (value)) {
147+ static int py_ue_edgraphpin_set_default_object (ue_PyEdGraphPin *self, PyObject *value, void *closure)
148+ {
149+ if (value && ue_is_pyuobject (value))
150+ {
129151 ue_PyUObject *py_obj = (ue_PyUObject *)value;
130152 self->pin ->DefaultObject = py_obj->ue_object ;
131153 return 0 ;
@@ -187,7 +209,8 @@ static PyTypeObject ue_PyEdGraphPinType = {
187209};
188210
189211
190- void ue_python_init_edgraphpin (PyObject *ue_module) {
212+ void ue_python_init_edgraphpin (PyObject *ue_module)
213+ {
191214 ue_PyEdGraphPinType.tp_new = PyType_GenericNew;
192215
193216 if (PyType_Ready (&ue_PyEdGraphPinType) < 0 )
@@ -197,13 +220,15 @@ void ue_python_init_edgraphpin(PyObject *ue_module) {
197220 PyModule_AddObject (ue_module, " EdGraphPin" , (PyObject *)&ue_PyEdGraphPinType);
198221}
199222
200- PyObject *py_ue_new_edgraphpin (UEdGraphPin *pin) {
223+ PyObject *py_ue_new_edgraphpin (UEdGraphPin *pin)
224+ {
201225 ue_PyEdGraphPin *ret = (ue_PyEdGraphPin *)PyObject_New (ue_PyEdGraphPin, &ue_PyEdGraphPinType);
202226 ret->pin = pin;
203227 return (PyObject *)ret;
204228}
205229
206- ue_PyEdGraphPin *py_ue_is_edgraphpin (PyObject *obj) {
230+ ue_PyEdGraphPin *py_ue_is_edgraphpin (PyObject *obj)
231+ {
207232 if (!PyObject_IsInstance (obj, (PyObject *)&ue_PyEdGraphPinType))
208233 return nullptr ;
209234 return (ue_PyEdGraphPin *)obj;
0 commit comments