diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..f81bce6b4 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "justMyCode": true, + "cwd": "${fileDirname}" + } + ] +} \ No newline at end of file diff --git a/Source/PythonEditor/Private/PythonEditorStyle.cpp b/Source/PythonEditor/Private/PythonEditorStyle.cpp index 06f30e2ec..6dd56325b 100644 --- a/Source/PythonEditor/Private/PythonEditorStyle.cpp +++ b/Source/PythonEditor/Private/PythonEditorStyle.cpp @@ -68,7 +68,7 @@ void FPythonEditorStyle::Initialize() StyleSet->Set("PythonEditor.PEP8ize.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16)); } - const FSlateFontInfo Consolas10 = TTF_FONT("Font/DroidSansMono", 9); + const FSlateFontInfo Consolas10 = TTF_FONT("Font/DroidSansMono", 14); const FTextBlockStyle NormalText = FTextBlockStyle() .SetFont(Consolas10) diff --git a/Source/UnrealEnginePython/Private/UObject/UEPyExporter.cpp b/Source/UnrealEnginePython/Private/UObject/UEPyExporter.cpp index 4f10efbdb..2620b6efc 100644 --- a/Source/UnrealEnginePython/Private/UObject/UEPyExporter.cpp +++ b/Source/UnrealEnginePython/Private/UObject/UEPyExporter.cpp @@ -1,18 +1,18 @@ #include "UEPyExporter.h" - - +#include "UObject/GCObjectScopeGuard.h" +#include "AssetExportTask.h" #include "Exporters/Exporter.h" PyObject *py_ue_export_to_file(ue_PyUObject * self, PyObject * args) { - ue_py_check(self); PyObject *py_object; char *filename; + bool bShowExportOptions = false; - if (!PyArg_ParseTuple(args, "Os:export_to_file", &py_object, &filename)) + if (!PyArg_ParseTuple(args, "Osp:export_to_file", &py_object, &filename, &bShowExportOptions)) { return nullptr; } @@ -29,10 +29,13 @@ PyObject *py_ue_export_to_file(ue_PyUObject * self, PyObject * args) return PyErr_Format(PyExc_Exception, "argument is not a UObject"); } + Exporter->SetShowExportOption(bShowExportOptions); if (UExporter::ExportToFile(Object, Exporter, UTF8_TO_TCHAR(filename), false, false, false) > 0) { Py_RETURN_TRUE; } + + Py_RETURN_FALSE; } diff --git a/Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp b/Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp index 3386d4537..c404b45b5 100644 --- a/Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp +++ b/Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp @@ -875,10 +875,11 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO PyObject *py_compute_normals = nullptr; PyObject *py_compute_tangents = nullptr; PyObject *py_use_mikk = nullptr; + PyObject *py_RemoveDegenerateTriangle=nullptr; - static char *kw_names[] = { (char *)"soft_vertices", (char *)"lod", (char *)"compute_normals", (char *)"compute_tangents", (char *)"use_mikk", nullptr }; + static char *kw_names[] = { (char *)"soft_vertices", (char *)"lod", (char *)"compute_normals", (char *)"compute_tangents", (char *)"use_mikk", (char*)"RemoveDegenerateTriangle", nullptr }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|iOOO:skeletal_mesh_build_lod", kw_names, &py_ss_vertex, &lod_index, &py_compute_normals, &py_compute_tangents, &py_use_mikk)) + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|iOOOO:skeletal_mesh_build_lod", kw_names, &py_ss_vertex, &lod_index, &py_compute_normals, &py_compute_tangents, &py_use_mikk, &py_RemoveDegenerateTriangle)) { return nullptr; } @@ -1063,7 +1064,8 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO build_settings.bUseMikkTSpace = (py_use_mikk && PyObject_IsTrue(py_use_mikk)); build_settings.bComputeNormals = (py_compute_normals && PyObject_IsTrue(py_compute_normals)); build_settings.bComputeTangents = (py_compute_tangents && PyObject_IsTrue(py_compute_tangents)); - build_settings.bRemoveDegenerateTriangles = true; + build_settings.bRemoveDegenerateTriangles = (py_RemoveDegenerateTriangle && PyObject_IsTrue(py_RemoveDegenerateTriangle));; + bool success = MeshUtilities.BuildSkeletalMesh(lod_model, mesh->RefSkeleton, influences, wedges, faces, points, points_to_map, build_settings); diff --git a/Source/UnrealEnginePython/UnrealEnginePython.Build.cs b/Source/UnrealEnginePython/UnrealEnginePython.Build.cs index a6fe71946..80fd517f8 100644 --- a/Source/UnrealEnginePython/UnrealEnginePython.Build.cs +++ b/Source/UnrealEnginePython/UnrealEnginePython.Build.cs @@ -8,7 +8,7 @@ public class UnrealEnginePython : ModuleRules { // leave this string as empty for triggering auto-discovery of python installations... - private string pythonHome = ""; + private string pythonHome = "C:\\Users\\long\\AppData\\Local\\Programs\\Python\\Python39"; // otherwise specify the path of your python installation //private string pythonHome = "C:/Program Files/Python36"; // this is an example for Homebrew on Mac