Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 6fe11e1

Browse files
Eugene Feinbergsabhiram
authored andcommitted
Merge develop branch into master on top of upstream
Fix build for OSX10.9+ The UnrealEnginePython.Build.cs file would reference the python framework path incorrectly. This change adds three additional paths for macos which should allow the plugin to compile. [BugFix] Forgot to add framework paths for OSX Add ue.py_exec1 and ue.py_exec2 to the plugin This is so we can pass 1 and 2 args (respectively) to the invoked python file / script. This is done because this plugin (rather grossly) uses python's execfile to run the entire included file. Fix bug in draw_debug_line Add project_world_location_to_screen Remove double defn of mac paths Add debug print to log relative scripts path (this is temporary) Convert content directory to absolute path prior to usage. Fix bugs with temporary strings going out of scope 1. When you use the UE4 string macros to convert from TCHAR*s to UTF8 or ANSI, the storage for the destination strings will be allocated within the scope of the function call. Once the var goes out of context, it will be destructed and its memory reclaimed. 2. This was causing the case where the path specified to the RunFile() is relative to the scripts path and the `full_path` variable is assigned within the scope of an `if` block. Implement N number of args for RunFileWithArgs() Add ignore PCH rules to `*.Build.cs` Fix string warnings causing build error if warnings are treated as errs Fix more string warnings Add missing TCHAR_TO_UTF8 macros Fix include paths for 4.19 build Fix for 4.19 Remove path component for 4.19 Wrap editor specific functions with WITH_EDITOR ifdef Implement loading_assets call to check status of AssetRegistry
1 parent bbdf067 commit 6fe11e1

File tree

8 files changed

+30
-4
lines changed

8 files changed

+30
-4
lines changed

Source/UnrealEnginePython/Private/UEPyEditor.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,22 @@ PyObject *py_unreal_engine_create_modal_save_asset_dialog(PyObject * self, PyObj
521521
return PyUnicode_FromString(TCHAR_TO_UTF8(*ret));
522522
}
523523

524+
PyObject *py_unreal_engine_loading_assets(PyObject * self, PyObject * args)
525+
{
526+
if (!GEditor)
527+
return PyErr_Format(PyExc_Exception, "no GEditor found");
528+
529+
FAssetRegistryModule& AssetRegistryModule = FModuleManager::GetModuleChecked<FAssetRegistryModule>("AssetRegistry");
530+
531+
if (AssetRegistryModule.Get().IsLoadingAssets()) {
532+
Py_INCREF(Py_True);
533+
return Py_True;
534+
}
535+
536+
Py_INCREF(Py_False);
537+
return Py_False;
538+
}
539+
524540
PyObject *py_unreal_engine_get_asset(PyObject * self, PyObject * args)
525541
{
526542
char *path;

Source/UnrealEnginePython/Private/UEPyEditor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PyObject *py_unreal_engine_editor_get_selected_actors(PyObject *, PyObject *);
1212
PyObject *py_unreal_engine_editor_deselect_actors(PyObject *, PyObject *);
1313
PyObject *py_unreal_engine_editor_select_actor(PyObject *, PyObject *);
1414
PyObject *py_unreal_engine_import_asset(PyObject *, PyObject *);
15+
PyObject *py_unreal_engine_loading_assets(PyObject * self, PyObject * args);
1516
PyObject *py_unreal_engine_get_asset(PyObject *, PyObject *);
1617
PyObject *py_unreal_engine_find_asset(PyObject *, PyObject *);
1718
PyObject *py_unreal_engine_delete_object(PyObject *, PyObject *);

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ static PyMethodDef unreal_engine_methods[] = {
270270
{ "editor_deselect_actors", py_unreal_engine_editor_deselect_actors, METH_VARARGS, "" },
271271
{ "import_asset", py_unreal_engine_import_asset, METH_VARARGS, "" },
272272
{ "export_assets", py_unreal_engine_export_assets, METH_VARARGS, "" },
273+
{ "loading_assets", py_unreal_engine_loading_assets, METH_VARARGS, ""},
273274
{ "get_asset", py_unreal_engine_get_asset, METH_VARARGS, "" },
274275
{ "find_asset", py_unreal_engine_find_asset, METH_VARARGS, "" },
275276
{ "delete_object", py_unreal_engine_delete_object, METH_VARARGS, "" },
@@ -3213,4 +3214,4 @@ static PyObject *init_unreal_engine()
32133214

32143215
return new_unreal_engine_module;
32153216
}
3216-
#endif
3217+
#endif

Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#endif
99
#endif
1010

11+
#if WITH_EDITOR
1112

1213
PyObject *py_ue_get_anim_instance(ue_PyUObject *self, PyObject * args)
1314
{
@@ -1218,4 +1219,5 @@ PyObject *py_ue_skeletal_mesh_to_import_vertex_map(ue_PyUObject *self, PyObject
12181219

12191220
return py_list;
12201221
}
1222+
12211223
#endif

Source/UnrealEnginePython/Private/UnrealEnginePythonPrivatePCH.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
#include "Wrappers/UEPyFRandomStream.h"
4848

4949
#include "Wrappers/UEPyFPythonOutputDevice.h"
50+
5051
#if WITH_EDITOR
5152
#include "Wrappers/UEPyFSoftSkinVertex.h"
5253
#endif
54+
5355
#include "Wrappers/UEPyFMorphTargetDelta.h"
5456
#include "Wrappers/UEPyFObjectThumbnail.h"
5557

Source/UnrealEnginePython/Private/Wrappers/UEPyFMorphTargetDelta.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "UnrealEnginePythonPrivatePCH.h"
22

3+
#if WITH_EDITOR
4+
35
static PyObject *py_ue_fmorph_target_delta_get_position_delta(ue_PyFMorphTargetDelta *self, void *closure)
46
{
57
return py_ue_new_fvector(self->morph_target_delta.PositionDelta);
@@ -137,4 +139,6 @@ PyObject *py_ue_new_fmorph_target_delta(FMorphTargetDelta morph_target_delta)
137139
ue_PyFMorphTargetDelta *ret = (ue_PyFMorphTargetDelta *)PyObject_New(ue_PyFMorphTargetDelta, &ue_PyFMorphTargetDeltaType);
138140
new(&ret->morph_target_delta) FMorphTargetDelta(morph_target_delta);
139141
return (PyObject *)ret;
140-
}
142+
}
143+
144+
#endif

Source/UnrealEnginePython/Private/Wrappers/UEPyFSoftSkinVertex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,4 +365,4 @@ PyObject *py_ue_new_fsoft_skin_vertex(FSoftSkinVertex ss_vertex)
365365
return (PyObject *)ret;
366366
}
367367

368-
#endif
368+
#endif

Source/UnrealEnginePython/Private/Wrappers/UEPyFSoftSkinVertex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if ENGINE_MINOR_VERSION > 18
99

1010
#include "Runtime/Engine/Public/Rendering/SkeletalMeshLODModel.h"
11-
#include "Runtime/Engine/Public/Rendering/SkeletalMeshTypes.h"
11+
#include "Runtime/Engine/Public/SkeletalMeshTypes.h"
1212

1313
#endif
1414

0 commit comments

Comments
 (0)