Skip to content

Commit d04c3af

Browse files
author
David
committed
Wrapped more editor only functions with WITH_EDITOR to allow package building.
1 parent 06ef4b3 commit d04c3af

7 files changed

Lines changed: 22 additions & 0 deletions

File tree

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,10 @@ static PyMethodDef ue_PyUObject_methods[] = {
619619
#endif
620620

621621
#if ENGINE_MINOR_VERSION >= 15
622+
#if WITH_EDITOR
622623
{ "can_modify", (PyCFunction)py_ue_can_modify, METH_VARARGS, "" },
623624
#endif
625+
#endif
624626

625627

626628
{ "set_name", (PyCFunction)py_ue_set_name, METH_VARARGS, "" },
@@ -1156,7 +1158,9 @@ static PyMethodDef ue_PyUObject_methods[] = {
11561158
{ "get_material_scalar_parameter", (PyCFunction)py_ue_get_material_scalar_parameter, METH_VARARGS, "" },
11571159
{ "get_material_vector_parameter", (PyCFunction)py_ue_get_material_vector_parameter, METH_VARARGS, "" },
11581160
{ "get_material_texture_parameter", (PyCFunction)py_ue_get_material_texture_parameter, METH_VARARGS, "" },
1161+
#if WITH_EDITOR
11591162
{ "get_material_static_switch_parameter", (PyCFunction)py_ue_get_material_static_switch_parameter, METH_VARARGS, "" },
1163+
#endif
11601164
{ "create_material_instance_dynamic", (PyCFunction)py_ue_create_material_instance_dynamic, METH_VARARGS, "" },
11611165
#if WITH_EDITOR
11621166
{ "set_material_parent", (PyCFunction)py_ue_set_material_parent, METH_VARARGS, "" },
@@ -1705,9 +1709,12 @@ static int ue_PyFProperty_setattro(ue_PyFProperty* self, PyObject* attr_name, Py
17051709

17061710

17071711
static PyMethodDef ue_PyFProperty_methods[] = {
1712+
#if WITH_EDITOR
1713+
// strictly WITH_EDITORONLY_DATA
17081714
{ "get_metadata", (PyCFunction)py_ue_fproperty_get_metadata, METH_VARARGS, "" },
17091715
{ "set_metadata", (PyCFunction)py_ue_fproperty_set_metadata, METH_VARARGS, "" },
17101716
{ "has_metadata", (PyCFunction)py_ue_fproperty_has_metadata, METH_VARARGS, "" },
1717+
#endif
17111718
{ NULL } /* Sentinel */
17121719
};
17131720

Source/UnrealEnginePython/Private/UObject/UEPyMaterial.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ PyObject *py_ue_get_material_scalar_parameter(ue_PyUObject *self, PyObject * arg
221221

222222
}
223223

224+
#if WITH_EDITOR
225+
// strictly this is WITH_EDITORONLY_DATA
224226
PyObject *py_ue_get_material_static_switch_parameter(ue_PyUObject *self, PyObject * args)
225227
{
226228

@@ -253,6 +255,7 @@ PyObject *py_ue_get_material_static_switch_parameter(ue_PyUObject *self, PyObjec
253255

254256
Py_RETURN_FALSE;
255257
}
258+
#endif
256259

257260
PyObject *py_ue_set_material_vector_parameter(ue_PyUObject *self, PyObject * args)
258261
{

Source/UnrealEnginePython/Private/UObject/UEPyMaterial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ PyObject *py_ue_set_material_texture_parameter(ue_PyUObject *, PyObject *);
1212
PyObject *py_ue_get_material_scalar_parameter(ue_PyUObject *, PyObject *);
1313
PyObject *py_ue_get_material_vector_parameter(ue_PyUObject *, PyObject *);
1414
PyObject *py_ue_get_material_texture_parameter(ue_PyUObject *, PyObject *);
15+
#if WITH_EDITOR
1516
PyObject *py_ue_get_material_static_switch_parameter(ue_PyUObject *, PyObject *);
17+
#endif
1618

1719
PyObject *py_ue_create_material_instance_dynamic(ue_PyUObject *, PyObject *);
1820

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ PyObject *py_ue_find_function(ue_PyUObject * self, PyObject * args)
672672
}
673673

674674
#if ENGINE_MINOR_VERSION >= 15
675+
#if WITH_EDITOR
675676
PyObject *py_ue_can_modify(ue_PyUObject *self, PyObject * args)
676677
{
677678

@@ -685,6 +686,7 @@ PyObject *py_ue_can_modify(ue_PyUObject *self, PyObject * args)
685686
Py_RETURN_FALSE;
686687
}
687688
#endif
689+
#endif
688690

689691
PyObject *py_ue_set_name(ue_PyUObject *self, PyObject * args)
690692
{

Source/UnrealEnginePython/Private/UObject/UEPyObject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ PyObject *py_ue_add_property(ue_PyUObject *, PyObject *);
6161

6262
PyObject *py_ue_as_dict(ue_PyUObject *, PyObject *);
6363

64+
#if WITH_EDITOR
6465
PyObject *py_ue_can_modify(ue_PyUObject *, PyObject *);
66+
#endif
6567

6668
PyObject *py_ue_get_outer(ue_PyUObject *, PyObject *);
6769
PyObject *py_ue_set_outer(ue_PyUObject *, PyObject *);

Source/UnrealEnginePython/Private/UObject/UEPyProperty.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ FProperty* FProperty_New(FFieldVariant* scope, FFieldClass* f_class, FName name,
134134
return nullptr;
135135
}
136136

137+
#if WITH_EDITOR
138+
// strictly WITH_EDITORONLY_DATA
137139
PyObject *py_ue_fproperty_set_metadata(ue_PyFProperty * self, PyObject * args)
138140
{
139141

@@ -212,5 +214,6 @@ PyObject *py_ue_fproperty_has_metadata(ue_PyFProperty * self, PyObject * args)
212214
Py_INCREF(Py_False);
213215
return Py_False;
214216
}
217+
#endif
215218

216219
#endif

Source/UnrealEnginePython/Private/UObject/UEPyProperty.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
#if ENGINE_MINOR_VERSION >= 25
88
PyObject *get_fproperty_uclass(FProperty *);
99
FProperty* FProperty_New(FFieldVariant* scope, FFieldClass* f_class, FName name, EObjectFlags o_flags);
10+
#if WITH_EDITOR
11+
// strictly WITH_EDITORONLY_DATA
1012
PyObject *py_ue_fproperty_set_metadata(ue_PyFProperty * self, PyObject * args);
1113
PyObject *py_ue_fproperty_get_metadata(ue_PyFProperty * self, PyObject * args);
1214
PyObject *py_ue_fproperty_has_metadata(ue_PyFProperty * self, PyObject * args);
1315
#endif
16+
#endif
1417

0 commit comments

Comments
 (0)