|
2 | 2 | #include "Animation/AnimSequence.h" |
3 | 3 | #include "Animation/BlendSpaceBase.h" |
4 | 4 |
|
5 | | -PyObject *py_ue_anim_sequence_get_skeleton(ue_PyUObject * self, PyObject * args) { |
| 5 | +PyObject *py_ue_anim_get_skeleton(ue_PyUObject * self, PyObject * args) { |
6 | 6 | ue_py_check(self); |
7 | 7 |
|
8 | | - UAnimSequence *anim_seq = ue_py_check_type<UAnimSequence>(self); |
9 | | - if (!anim_seq) |
10 | | - return PyErr_Format(PyExc_Exception, "UObject is not a UAnimSequence."); |
| 8 | + UAnimationAsset *anim = ue_py_check_type<UAnimationAsset>(self); |
| 9 | + if (!anim) |
| 10 | + return PyErr_Format(PyExc_Exception, "UObject is not a UAnimationAsset."); |
11 | 11 |
|
12 | | - USkeleton *skeleton = anim_seq->GetSkeleton(); |
| 12 | + USkeleton *skeleton = anim->GetSkeleton(); |
13 | 13 | if (!skeleton) { |
14 | | - Py_INCREF(Py_None); |
15 | | - return Py_None; |
| 14 | + Py_RETURN_NONE; |
16 | 15 | } |
17 | 16 |
|
18 | 17 | ue_PyUObject *ret = ue_get_python_wrapper((UObject *)skeleton); |
@@ -96,22 +95,37 @@ PyObject *py_ue_anim_sequence_add_new_raw_track(ue_PyUObject * self, PyObject * |
96 | 95 | } |
97 | 96 | #endif |
98 | 97 |
|
99 | | -PyObject *py_ue_anim_sequence_set_skeleton(ue_PyUObject * self, PyObject * args) { |
| 98 | +PyObject *py_ue_anim_set_skeleton(ue_PyUObject * self, PyObject * args) { |
100 | 99 | ue_py_check(self); |
101 | 100 |
|
102 | 101 | PyObject *py_skeleton; |
103 | | - if (!PyArg_ParseTuple(args, "O:anim_sequence_set_skeleton", &py_skeleton)) |
| 102 | + if (!PyArg_ParseTuple(args, "O:anim_set_skeleton", &py_skeleton)) |
104 | 103 | return nullptr; |
105 | 104 |
|
106 | | - UAnimSequence *anim_seq = ue_py_check_type<UAnimSequence>(self); |
107 | | - if (!anim_seq) |
108 | | - return PyErr_Format(PyExc_Exception, "UObject is not a UAnimSequence."); |
| 105 | + UAnimationAsset *anim = ue_py_check_type<UAnimationAsset>(self); |
| 106 | + if (!anim) |
| 107 | + return PyErr_Format(PyExc_Exception, "UObject is not a UAnimationAsset."); |
109 | 108 |
|
110 | 109 | USkeleton *skeleton = ue_py_check_type<USkeleton>(py_skeleton); |
111 | 110 | if (!skeleton) |
112 | 111 | return PyErr_Format(PyExc_Exception, "argument is not a USkeleton."); |
113 | 112 |
|
114 | | - anim_seq->SetSkeleton(skeleton); |
| 113 | + anim->SetSkeleton(skeleton); |
115 | 114 |
|
116 | 115 | Py_RETURN_NONE; |
117 | 116 | } |
| 117 | + |
| 118 | +PyObject *py_ue_add_anim_composite_section(ue_PyUObject * self, PyObject * args) { |
| 119 | + ue_py_check(self); |
| 120 | + |
| 121 | + char *name; |
| 122 | + float time; |
| 123 | + if (!PyArg_ParseTuple(args, "sf:add_anim_composite_section", &name, &time)) |
| 124 | + return nullptr; |
| 125 | + |
| 126 | + UAnimMontage *anim = ue_py_check_type<UAnimMontage>(self); |
| 127 | + if (!anim) |
| 128 | + return PyErr_Format(PyExc_Exception, "UObject is not a UAnimMontage."); |
| 129 | + |
| 130 | + return PyLong_FromLong(anim->AddAnimCompositeSection(FName(UTF8_TO_TCHAR(name)), time)); |
| 131 | +} |
0 commit comments