| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b33e067 commit de9cafa
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,10 +26,22 @@ static PyObject *py_ue_ftransform_get_relative_transform(ue_PyFTransform *self, | |||
| 26 | 26 | return py_ue_new_ftransform(self->transform.GetRelativeTransform(py_transform->transform)); | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | + static PyObject *py_ue_ftransform_get_matrix(ue_PyFTransform *self, PyObject * args) | ||
| 30 | + { | ||
| 31 | + FMatrix matrix = self->transform.ToMatrixWithScale(); | ||
| 32 | + UScriptStruct *u_struct = FindObject<UScriptStruct>(ANY_PACKAGE, UTF8_TO_TCHAR("Matrix")); | ||
| 33 | + if (!u_struct) | ||
| 34 | + { | ||
| 35 | + return PyErr_Format(PyExc_Exception, "unable to get Matrix struct"); | ||
| 36 | + } | ||
| 37 | + return py_ue_new_uscriptstruct(u_struct, (uint8 *)&matrix); | ||
| 38 | + } | ||
| 39 | + | ||
| 29 | 40 | static PyMethodDef ue_PyFTransform_methods[] = { | |
| 30 | 41 | { "inverse", (PyCFunction)py_ue_ftransform_inverse, METH_VARARGS, "" }, | |
| 31 | 42 | { "get_relative_transform", (PyCFunction)py_ue_ftransform_get_relative_transform, METH_VARARGS, "" }, | |
| 32 | 43 | { "normalize_rotation", (PyCFunction)py_ue_ftransform_normalize_rotation, METH_VARARGS, "" }, | |
| 44 | + { "get_matrix", (PyCFunction)py_ue_ftransform_get_matrix, METH_VARARGS, "" }, | ||
| 33 | 45 | { NULL } /* Sentinel */ | |
| 34 | 46 | }; | |
| 35 | 47 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments