|
26 | 26 | #include "Editor/LandscapeEditor/Public/LandscapeFileFormatInterface.h" |
27 | 27 |
|
28 | 28 | #include "Developer/Settings/Public/ISettingsModule.h" |
| 29 | +#include "Engine/Blueprint.h" |
29 | 30 |
|
30 | 31 |
|
31 | 32 | PyObject *py_unreal_engine_editor_play_in_viewport(PyObject * self, PyObject * args) |
@@ -1120,6 +1121,33 @@ PyObject *py_unreal_engine_create_blueprint(PyObject * self, PyObject * args) |
1120 | 1121 |
|
1121 | 1122 | } |
1122 | 1123 |
|
| 1124 | +PyObject *py_unreal_engine_get_blueprint_hierarchy_from_class(PyObject * self, PyObject * args) |
| 1125 | +{ |
| 1126 | + PyObject *py_class; |
| 1127 | + if (!PyArg_ParseTuple(args, "O:get_blueprint_hierarchy_from_class", &py_class)) |
| 1128 | + { |
| 1129 | + return NULL; |
| 1130 | + } |
| 1131 | + |
| 1132 | + UClass* u_class = ue_py_check_type<UClass>(py_class); |
| 1133 | + if (!u_class) |
| 1134 | + { |
| 1135 | + return PyErr_Format(PyExc_Exception, "argument is not a UClass"); |
| 1136 | + } |
| 1137 | + |
| 1138 | + |
| 1139 | + TArray<UBlueprint*> outBPs; |
| 1140 | + UBlueprint::GetBlueprintHierarchyFromClass(u_class, outBPs); |
| 1141 | + |
| 1142 | + PyObject *py_bpClasses = PyList_New(0); |
| 1143 | + |
| 1144 | + for (UBlueprint* bpClass : outBPs) { |
| 1145 | + ue_PyUObject *item = ue_get_python_wrapper(bpClass); |
| 1146 | + if (item) |
| 1147 | + PyList_Append(py_bpClasses, (PyObject *)item); |
| 1148 | + } |
| 1149 | + return py_bpClasses; |
| 1150 | +} |
1123 | 1151 |
|
1124 | 1152 | PyObject *py_unreal_engine_reload_blueprint(PyObject * self, PyObject * args) |
1125 | 1153 | { |
@@ -1602,6 +1630,35 @@ PyObject *py_unreal_engine_blueprint_add_ubergraph_page(PyObject * self, PyObjec |
1602 | 1630 | return ret; |
1603 | 1631 | } |
1604 | 1632 |
|
| 1633 | +PyObject *py_unreal_engine_blueprint_get_all_graphs(PyObject * self, PyObject * args) |
| 1634 | +{ |
| 1635 | + PyObject *py_blueprint; |
| 1636 | + |
| 1637 | + if (!PyArg_ParseTuple(args, "O:blueprint_get_all_graphs", &py_blueprint)) |
| 1638 | + { |
| 1639 | + return nullptr; |
| 1640 | + } |
| 1641 | + |
| 1642 | + UBlueprint *bp = ue_py_check_type<UBlueprint>(py_blueprint); |
| 1643 | + if (!bp) |
| 1644 | + return PyErr_Format(PyExc_Exception, "uobject is not a UBlueprint"); |
| 1645 | + |
| 1646 | + PyObject *py_graphs = PyList_New(0); |
| 1647 | + |
| 1648 | + TArray<UEdGraph*> graphs; |
| 1649 | + |
| 1650 | + bp->GetAllGraphs(graphs); |
| 1651 | + |
| 1652 | + for (UEdGraph *graph : graphs) |
| 1653 | + { |
| 1654 | + ue_PyUObject *item = ue_get_python_wrapper(graph); |
| 1655 | + if (item) |
| 1656 | + PyList_Append(py_graphs, (PyObject *)item); |
| 1657 | + } |
| 1658 | + |
| 1659 | + return py_graphs; |
| 1660 | +} |
| 1661 | + |
1605 | 1662 | PyObject *py_unreal_engine_create_new_graph(PyObject * self, PyObject * args) |
1606 | 1663 | { |
1607 | 1664 |
|
@@ -1665,35 +1722,6 @@ PyObject *py_unreal_engine_create_new_graph(PyObject * self, PyObject * args) |
1665 | 1722 | Py_RETURN_UOBJECT(graph); |
1666 | 1723 | } |
1667 | 1724 |
|
1668 | | -PyObject *py_unreal_engine_editor_blueprint_graphs(PyObject * self, PyObject * args) |
1669 | | -{ |
1670 | | - PyObject *py_blueprint; |
1671 | | - |
1672 | | - if (!PyArg_ParseTuple(args, "O:blueprint_graphs", &py_blueprint)) |
1673 | | - { |
1674 | | - return nullptr; |
1675 | | - } |
1676 | | - |
1677 | | - UBlueprint *bp = ue_py_check_type<UBlueprint>(py_blueprint); |
1678 | | - if (!bp) |
1679 | | - return PyErr_Format(PyExc_Exception, "uobject is not a UBlueprint"); |
1680 | | - |
1681 | | - PyObject *py_graphs = PyList_New(0); |
1682 | | - |
1683 | | - TArray<UEdGraph*> graphs; |
1684 | | - |
1685 | | - bp->GetAllGraphs(graphs); |
1686 | | - |
1687 | | - for (UEdGraph *graph : graphs) |
1688 | | - { |
1689 | | - ue_PyUObject *item = ue_get_python_wrapper(graph); |
1690 | | - if (item) |
1691 | | - PyList_Append(py_graphs, (PyObject *)item); |
1692 | | - } |
1693 | | - |
1694 | | - return py_graphs; |
1695 | | -} |
1696 | | - |
1697 | 1725 | PyObject *py_unreal_engine_editor_on_asset_post_import(PyObject * self, PyObject * args) |
1698 | 1726 | { |
1699 | 1727 | PyObject *py_callable; |
@@ -2237,6 +2265,27 @@ PyObject *py_unreal_engine_register_settings(PyObject * self, PyObject * args) |
2237 | 2265 | Py_RETURN_NONE; |
2238 | 2266 | } |
2239 | 2267 |
|
| 2268 | +PyObject * py_unreal_engine_show_viewer(PyObject * self, PyObject * args) |
| 2269 | +{ |
| 2270 | + char *container_name; |
| 2271 | + char *category_name; |
| 2272 | + char *section_name; |
| 2273 | + |
| 2274 | + if (!PyArg_ParseTuple(args, "sss:register_settings", &container_name, &category_name, §ion_name)) |
| 2275 | + return nullptr; |
| 2276 | + |
| 2277 | + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings")) |
| 2278 | + { |
| 2279 | + SettingsModule->ShowViewer(container_name, category_name, section_name); |
| 2280 | + } |
| 2281 | + else |
| 2282 | + { |
| 2283 | + return PyErr_Format(PyExc_Exception, "unable to find the Settings Module"); |
| 2284 | + } |
| 2285 | + |
| 2286 | + Py_RETURN_NONE; |
| 2287 | +} |
| 2288 | + |
2240 | 2289 | PyObject *py_unreal_engine_unregister_settings(PyObject * self, PyObject * args) |
2241 | 2290 | { |
2242 | 2291 | char *container_name; |
|
0 commit comments