[2020.3.7][Linux] FBX PythonBindings + Python 3.11 issues with FbxAxisSystem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone!
I'm using FBX SDK + Python Bindings with Unreal Engine. The latest version comes with Python 3.11.
Unfortunately some of my code no longer works - this is the primary suspect https://github.com/python/cpython/issues/100458.
In previous Python versions I used to create an FbxAxisSystem object by passing integers to the constructor.
Example:
FbxAxisSystem(3, -2, 1)
Python 3.11 however demands enums. And it's fine and below code works ok:
FbxAxisSystem(FbxAxisSystem.EUpVector.eZAxis, FbxAxisSystem.EFrontVector.eParityOdd, FbxAxisSystem.ECoordSystem.eLeftHanded)
The issue is that there are no negative counterparts for these enums. Currently there is no way to specify a sign when passing an argument.
Adding a sign before the enum also doesn't work anymore:
FbxAxisSystem(-FbxAxisSystem.EUpVector.eZAxis,...,...)
I noticed in SDK header files a static function in fbxaxissystem.h that could do the job, but it looks like it's not supported by sip most likely. It cannot be used from python code.
static bool ParseAxisSystem(const char * pAxes, FbxAxisSystem& pOutput);
Does anyone else have the same issue and perhaps a possible solution or workaround?
I guess the easiest way to address this would be to just expand the enums if Autodesk team got involved.
enum EFrontVector
{
eParityEven = 1,
eParityOdd = 2
};
||
\/
enum EFrontVector
{
eParityOddNegative = -2,
eParityEvenNegative = -1,
eParityEven = 1,
eParityOdd = 2
};