Skip to content

Commit 21a1a9b

Browse files
author
Roberto De Ioris
committed
do not use labels out of the editor
1 parent 4df4566 commit 21a1a9b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static PyObject *py_ue_get_name(ue_PyUObject *self, PyObject * args) {
193193
return PyUnicode_FromString(TCHAR_TO_UTF8(*(self->ue_object->GetName())));
194194
}
195195

196+
#if WITH_EDITOR
196197
static PyObject *py_ue_get_actor_label(ue_PyUObject *self, PyObject * args) {
197198

198199
ue_py_check(self);
@@ -209,7 +210,7 @@ static PyObject *py_ue_get_actor_label(ue_PyUObject *self, PyObject * args) {
209210

210211
return PyErr_Format(PyExc_Exception, "uobject is not an actor or a component");
211212
}
212-
213+
#endif
213214

214215
static PyObject *py_ue_get_actor_location(ue_PyUObject *self, PyObject * args) {
215216

@@ -412,6 +413,7 @@ static PyObject *py_ue_find_object(ue_PyUObject * self, PyObject * args) {
412413
return Py_None;
413414
}
414415

416+
#if WITH_EDITOR
415417
static PyObject *py_ue_find_actor_by_label(ue_PyUObject * self, PyObject * args) {
416418

417419
ue_py_check(self);
@@ -446,6 +448,7 @@ static PyObject *py_ue_find_actor_by_label(ue_PyUObject * self, PyObject * args)
446448
Py_INCREF(Py_None);
447449
return Py_None;
448450
}
451+
#endif
449452

450453
static PyObject *py_ue_get_class(ue_PyUObject * self, PyObject * args) {
451454

@@ -536,9 +539,11 @@ static PyMethodDef ue_PyUObject_methods[] = {
536539
{ "call", (PyCFunction)py_ue_call, METH_VARARGS, "" },
537540
{ "get_owner", (PyCFunction)py_ue_get_owner, METH_VARARGS, "" },
538541
{ "get_name", (PyCFunction)py_ue_get_name, METH_VARARGS, "" },
542+
#if WITH_EDITOR
539543
{ "get_actor_label", (PyCFunction)py_ue_get_actor_label, METH_VARARGS, "" },
540-
{ "find_object", (PyCFunction)py_ue_find_object, METH_VARARGS, "" },
541544
{ "find_actor_by_label", (PyCFunction)py_ue_find_actor_by_label, METH_VARARGS, "" },
545+
#endif
546+
{ "find_object", (PyCFunction)py_ue_find_object, METH_VARARGS, "" },
542547
{ "all_objects", (PyCFunction)py_ue_all_objects, METH_VARARGS, "" },
543548
{ "all_actors", (PyCFunction)py_ue_all_actors, METH_VARARGS, "" },
544549
{ "get_input_axis", (PyCFunction)py_ue_get_input_axis, METH_VARARGS, "" },

‎Source/UnrealEnginePython/UnrealEnginePython.Build.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public UnrealEnginePython(TargetInfo Target)
6161
PublicLibraryPaths.Add(pythonHome + "libs");
6262
PublicAdditionalLibraries.Add("python35.lib");
6363

64-
RuntimeDependencies.Add(new RuntimeDependency("python35.dll"));
64+
RuntimeDependencies.Add(new RuntimeDependency("C:/Users/Roberto/Documents/Unreal Projects/PyTest30/Plugins/UnrealEnginePython/python35.dll"));
6565

6666
}
6767
}

0 commit comments

Comments
 (0)