55
66#include " UEPyFbx.h"
77
8- static PyObject *py_ue_fbx_property_get_name (ue_PyFbxProperty *self, PyObject *args) {
8+ static PyObject *py_ue_fbx_property_get_name (ue_PyFbxProperty *self, PyObject *args)
9+ {
910 return PyUnicode_FromString (self->fbx_property .GetName ());
1011}
1112
12- static PyObject *py_ue_fbx_property_get_double3 (ue_PyFbxProperty *self, PyObject *args) {
13+ static PyObject *py_ue_fbx_property_get_double3 (ue_PyFbxProperty *self, PyObject *args)
14+ {
1315 FbxDouble3 value = self->fbx_property .Get <FbxDouble3>();
1416 return Py_BuildValue ((char *)" (fff)" , value[0 ], value[1 ], value[2 ]);
1517}
1618
17- static PyObject *py_ue_fbx_property_get_string (ue_PyFbxProperty *self, PyObject *args) {
18- return PyUnicode_FromString (self->fbx_property .Get <FbxString>());
19+ static PyObject *py_ue_fbx_property_get_string (ue_PyFbxProperty *self, PyObject *args)
20+ {
21+ return PyUnicode_FromString (self->fbx_property .Get <FbxString>());
1922}
2023
21- static PyObject *py_ue_fbx_property_is_valid (ue_PyFbxProperty *self, PyObject *args) {
22- if (self->fbx_property .IsValid ()) {
24+ static PyObject *py_ue_fbx_property_is_valid (ue_PyFbxProperty *self, PyObject *args)
25+ {
26+ if (self->fbx_property .IsValid ())
27+ {
2328 Py_RETURN_TRUE;
2429 }
2530 Py_RETURN_FALSE;
2631}
2732
28- static PyObject *py_ue_fbx_property_get_curve_node (ue_PyFbxProperty *self, PyObject *args) {
33+ static PyObject *py_ue_fbx_property_get_curve_node (ue_PyFbxProperty *self, PyObject *args)
34+ {
2935 PyObject *py_object;
30- if (!PyArg_ParseTuple (args, " O" , &py_object)) {
36+ if (!PyArg_ParseTuple (args, " O" , &py_object))
37+ {
3138 return nullptr ;
3239 }
3340
@@ -45,10 +52,28 @@ static PyObject *py_ue_fbx_property_get_curve_node(ue_PyFbxProperty *self, PyObj
4552 return py_ue_new_fbx_object (fbx_anim_curve_node);
4653}
4754
55+ static PyObject *py_ue_fbx_property_get_bool (ue_PyFbxProperty *self, PyObject *args)
56+ {
57+ if (self->fbx_property .Get <FbxBool>())
58+ Py_RETURN_TRUE;
59+
60+ Py_RETURN_FALSE;
61+
62+ }
63+
64+ static PyObject *py_ue_fbx_property_get_int (ue_PyFbxProperty *self, PyObject *args)
65+ {
66+ return PyLong_FromLong (self->fbx_property .Get <FbxInt>());
67+
68+ }
69+
70+
4871static PyMethodDef ue_PyFbxProperty_methods[] = {
4972 { " get_name" , (PyCFunction)py_ue_fbx_property_get_name, METH_VARARGS, " " },
5073 { " get_double3" , (PyCFunction)py_ue_fbx_property_get_double3, METH_VARARGS, " " },
51- { " get_string" , (PyCFunction)py_ue_fbx_property_get_string, METH_VARARGS, " " },
74+ { " get_string" , (PyCFunction)py_ue_fbx_property_get_string, METH_VARARGS, " " },
75+ { " get_bool" , (PyCFunction)py_ue_fbx_property_get_bool, METH_VARARGS, " " },
76+ { " get_int" , (PyCFunction)py_ue_fbx_property_get_int, METH_VARARGS, " " },
5277 { " is_valid" , (PyCFunction)py_ue_fbx_property_is_valid, METH_VARARGS, " " },
5378 { " get_curve_node" , (PyCFunction)py_ue_fbx_property_get_curve_node, METH_VARARGS, " " },
5479 { NULL } /* Sentinel */
@@ -87,12 +112,14 @@ static PyTypeObject ue_PyFbxPropertyType = {
87112 0 , /* tp_getset */
88113};
89114
90- static int py_ue_fbx_property_init (ue_PyFbxProperty *self, PyObject * args) {
115+ static int py_ue_fbx_property_init (ue_PyFbxProperty *self, PyObject * args)
116+ {
91117 PyErr_SetString (PyExc_Exception, " instantiating a new FbxProperty is currently not supported" );
92118 return -1 ;
93119}
94120
95- void ue_python_init_fbx_property (PyObject *ue_module) {
121+ void ue_python_init_fbx_property (PyObject *ue_module)
122+ {
96123 ue_PyFbxPropertyType.tp_new = PyType_GenericNew;;
97124 ue_PyFbxPropertyType.tp_init = (initproc)py_ue_fbx_property_init;
98125 if (PyType_Ready (&ue_PyFbxPropertyType) < 0 )
@@ -102,13 +129,15 @@ void ue_python_init_fbx_property(PyObject *ue_module) {
102129 PyModule_AddObject (ue_module, " FbxProperty" , (PyObject *)&ue_PyFbxPropertyType);
103130}
104131
105- PyObject *py_ue_new_fbx_property (FbxProperty fbx_property) {
132+ PyObject *py_ue_new_fbx_property (FbxProperty fbx_property)
133+ {
106134 ue_PyFbxProperty *ret = (ue_PyFbxProperty *)PyObject_New (ue_PyFbxProperty, &ue_PyFbxPropertyType);
107135 ret->fbx_property = fbx_property;
108136 return (PyObject *)ret;
109137}
110138
111- ue_PyFbxProperty *py_ue_is_fbx_property (PyObject *obj) {
139+ ue_PyFbxProperty *py_ue_is_fbx_property (PyObject *obj)
140+ {
112141 if (!PyObject_IsInstance (obj, (PyObject *)&ue_PyFbxPropertyType))
113142 return nullptr ;
114143 return (ue_PyFbxProperty *)obj;
0 commit comments