Skip to content

Commit 916766b

Browse files
author
Roberto De Ioris
committed
added SObjectPropertyEntryBox
1 parent 74ac673 commit 916766b

11 files changed

Lines changed: 97 additions & 9 deletions

‎Source/UnrealEnginePython/Private/Slate/UEPySAssetDropTarget.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if WITH_EDITOR
12
#include "UnrealEnginePythonPrivatePCH.h"
23

34
#include "UEPySAssetDropTarget.h"
@@ -59,3 +60,4 @@ void ue_python_init_sasset_drop_target(PyObject *ue_module) {
5960
Py_INCREF(&ue_PySAssetDropTargetType);
6061
PyModule_AddObject(ue_module, "SAssetDropTarget", (PyObject *)&ue_PySAssetDropTargetType);
6162
}
63+
#endif

‎Source/UnrealEnginePython/Private/Slate/UEPySAssetDropTarget.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "Editor/EditorWidgets/Public/SAssetDropTarget.h"
99

10-
extern PyTypeObject ue_PySVectorInputBoxType;
10+
extern PyTypeObject ue_PySAssetDropTargetType;
1111

1212
typedef struct {
1313
ue_PySDropTarget s_drop_target;

‎Source/UnrealEnginePython/Private/Slate/UEPySDropTarget.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if WITH_EDITOR
12
#include "UnrealEnginePythonPrivatePCH.h"
23

34
#include "UEPySDropTarget.h"
@@ -48,3 +49,4 @@ void ue_python_init_sdrop_target(PyObject *ue_module) {
4849
Py_INCREF(&ue_PySDropTargetType);
4950
PyModule_AddObject(ue_module, "SDropTarget", (PyObject *)&ue_PySDropTargetType);
5051
}
52+
#endif
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#if WITH_EDITOR
2+
#include "UnrealEnginePythonPrivatePCH.h"
3+
4+
#include "UEPySObjectPropertyEntryBox.h"
5+
6+
#define sw_object_property_entry_box StaticCastSharedRef<SObjectPropertyEntryBox>(self->s_compound_widget.s_widget.s_widget)
7+
8+
9+
static PyMethodDef ue_PySObjectPropertyEntryBox_methods[] = {
10+
{ NULL } /* Sentinel */
11+
};
12+
13+
PyTypeObject ue_PySObjectPropertyEntryBoxType = {
14+
PyVarObject_HEAD_INIT(NULL, 0)
15+
"unreal_engine.SObjectPropertyEntryBox", /* tp_name */
16+
sizeof(ue_PySObjectPropertyEntryBox), /* tp_basicsize */
17+
0, /* tp_itemsize */
18+
0, /* tp_dealloc */
19+
0, /* tp_print */
20+
0, /* tp_getattr */
21+
0, /* tp_setattr */
22+
0, /* tp_reserved */
23+
0, /* tp_repr */
24+
0, /* tp_as_number */
25+
0, /* tp_as_sequence */
26+
0, /* tp_as_mapping */
27+
0, /* tp_hash */
28+
0, /* tp_call */
29+
0, /* tp_str */
30+
0, /* tp_getattro */
31+
0, /* tp_setattro */
32+
0, /* tp_as_buffer */
33+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
34+
"Unreal Engine SObjectPropertyEntryBox", /* tp_doc */
35+
0, /* tp_traverse */
36+
0, /* tp_clear */
37+
0, /* tp_richcompare */
38+
0, /* tp_weaklistoffset */
39+
0, /* tp_iter */
40+
0, /* tp_iternext */
41+
ue_PySObjectPropertyEntryBox_methods, /* tp_methods */
42+
};
43+
44+
static int ue_py_sobject_property_entry_box_init(ue_PySObjectPropertyEntryBox *self, PyObject *args, PyObject *kwargs) {
45+
ue_py_slate_setup_farguments(SObjectPropertyEntryBox);
46+
47+
ue_py_snew(SObjectPropertyEntryBox, s_compound_widget.s_widget);
48+
return 0;
49+
}
50+
51+
void ue_python_init_sobject_property_entry_box(PyObject *ue_module) {
52+
53+
ue_PySObjectPropertyEntryBoxType.tp_init = (initproc)ue_py_sobject_property_entry_box_init;
54+
55+
ue_PySObjectPropertyEntryBoxType.tp_base = &ue_PySCompoundWidgetType;
56+
57+
if (PyType_Ready(&ue_PySObjectPropertyEntryBoxType) < 0)
58+
return;
59+
60+
Py_INCREF(&ue_PySObjectPropertyEntryBoxType);
61+
PyModule_AddObject(ue_module, "SObjectPropertyEntryBox", (PyObject *)&ue_PySObjectPropertyEntryBoxType);
62+
}
63+
#endif
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
#include "UnrealEnginePython.h"
4+
5+
6+
#include "UEPySCompoundWidget.h"
7+
8+
#include "Editor/PropertyEditor/Public/PropertyCustomizationHelpers.h"
9+
10+
extern PyTypeObject ue_PySObjectPropertyEntryBoxType;
11+
12+
typedef struct {
13+
ue_PySCompoundWidget s_compound_widget;
14+
/* Type-specific fields go here. */
15+
} ue_PySObjectPropertyEntryBox;
16+
17+
void ue_python_init_sobject_property_entry_box(PyObject *);

‎Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,6 @@ void ue_python_init_slate(PyObject *module) {
595595
ue_python_init_shorizontal_box(module);
596596
ue_python_init_svertical_box(module);
597597
ue_python_init_sviewport(module);
598-
ue_python_init_sdrop_target(module);
599-
ue_python_init_sasset_drop_target(module);
600598
ue_python_init_simage(module);
601599
ue_python_init_sdock_tab(module);
602600
ue_python_init_stable_view_base(module);
@@ -631,6 +629,9 @@ void ue_python_init_slate(PyObject *module) {
631629
ue_python_init_sfile_path_picker(module);
632630
#endif
633631
#endif
632+
ue_python_init_sdrop_target(module);
633+
ue_python_init_sasset_drop_target(module);
634+
ue_python_init_sobject_property_entry_box(module);
634635
#endif
635636

636637
ue_python_init_ftab_manager(module);

‎Source/UnrealEnginePython/Private/Slate/UEPySlate.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include "UEPySVerticalBox.h"
3535
#include "UEPySViewport.h"
3636

37-
#include "UEPySDropTarget.h"
38-
#include "UEPySAssetDropTarget.h"
3937

4038
#include "UEPySImage.h"
4139
#include "UEPySDockTab.h"
@@ -76,6 +74,9 @@
7674
#include "UEPySGraphEditor.h"
7775
#include "UEPySPythonShelf.h"
7876
#include "UEPySFilePathPicker.h"
77+
#include "UEPySDropTarget.h"
78+
#include "UEPySAssetDropTarget.h"
79+
#include "UEPySObjectPropertyEntryBox.h"
7980
#endif
8081

8182
#include "Runtime/Core/Public/Misc/Attribute.h"

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,11 @@ static PyMethodDef ue_PyUObject_methods[] = {
473473
{ "anim_get_skeleton", (PyCFunction)py_ue_anim_get_skeleton, METH_VARARGS, "" },
474474
{ "anim_set_skeleton", (PyCFunction)py_ue_anim_set_skeleton, METH_VARARGS, "" },
475475

476-
{ "add_anim_composite_section", (PyCFunction)py_ue_add_anim_composite_section, METH_VARARGS, "" },
477-
478476
#if WITH_EDITOR
479477
{ "get_raw_animation_data", (PyCFunction)py_ue_anim_sequence_get_raw_animation_data, METH_VARARGS, "" },
480478
{ "get_raw_animation_track", (PyCFunction)py_ue_anim_sequence_get_raw_animation_track, METH_VARARGS, "" },
481479
{ "add_new_raw_track", (PyCFunction)py_ue_anim_sequence_add_new_raw_track, METH_VARARGS, "" },
480+
{ "add_anim_composite_section", (PyCFunction)py_ue_add_anim_composite_section, METH_VARARGS, "" },
482481
#endif
483482

484483

‎Source/UnrealEnginePython/Private/UObject/UEPyAnimSequence.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ PyObject *py_ue_anim_set_skeleton(ue_PyUObject * self, PyObject * args) {
116116
Py_RETURN_NONE;
117117
}
118118

119+
#if WITH_EDITOR
119120
PyObject *py_ue_add_anim_composite_section(ue_PyUObject * self, PyObject * args) {
120121
ue_py_check(self);
121122

@@ -130,3 +131,4 @@ PyObject *py_ue_add_anim_composite_section(ue_PyUObject * self, PyObject * args)
130131

131132
return PyLong_FromLong(anim->AddAnimCompositeSection(FName(UTF8_TO_TCHAR(name)), time));
132133
}
134+
#endif

‎Source/UnrealEnginePython/Private/UObject/UEPyAnimSequence.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ PyObject *py_ue_anim_get_skeleton(ue_PyUObject *, PyObject *);
1010
PyObject *py_ue_anim_sequence_get_raw_animation_data(ue_PyUObject *, PyObject *);
1111
PyObject *py_ue_anim_sequence_get_raw_animation_track(ue_PyUObject *, PyObject *);
1212
PyObject *py_ue_anim_sequence_add_new_raw_track(ue_PyUObject *, PyObject *);
13+
PyObject *py_ue_add_anim_composite_section(ue_PyUObject *, PyObject *);
1314
#endif
1415
PyObject *py_ue_anim_set_skeleton(ue_PyUObject *, PyObject *);
15-
PyObject *py_ue_add_anim_composite_section(ue_PyUObject *, PyObject *);

0 commit comments

Comments
 (0)