0%

FBX-installation

The following content is copied from https://github.com/nv-tlabs/ASE/issues/61, and fixed errors & added comments in the original texts.

  1. download and install fbx sdk & fbx python binding

    • fbx sdk
      • version
        • 202032
      • tar file download path
        • ./<YOUR_FBXSDK_PATH>/
      • instruction
        • cd <YOUR_FBXSDK_PATH>
        • tar zxvf fbx202032_fbxsdk_linux.tar.gz
        • ./fbx202032_fbxsdk_linux (install it)
        • export FBXSDK_ROOT=<YOUR_FBXSDK_PATH>
      • you should check env param
    • fbx python binding
      • version
        • 202032
      • tar file download path
        • ./YOUR_FBX_PYTHON_BINDING_PATH/
      • instruction
        • cd <YOUR_FBX_PYTHON_BINDING_PATH>
        • tar zxvf fbx202032_fbxpythonbindings_linux.tar.gz
        • ./fbx202032_fbxpythonbindings_linux (install it)
    • reference
  2. sip - build tool

  3. sdk build

    • cd <YOUR_FBX_PYTHON_BINDING_PATH>
    • python PythonBindings.py Python3_x64 buildsip
    • when get problem with lxml
      • sudo apt insatll libxml2-dev
      • python PythonBindings.py Python3_x64 buildsip
  4. modify make file and re-install

    • there is possibility of error when import fbx after first build.

      • fbx undefined symbol: xmlFree
      • that is error about link order related with libxml2.so‘s
      • you should modify the make file
      • make file modify
    • cd <YOUR_FBX_PYTHON_BINDING_PATH>/build/Python38_x64

    • make clean

    • open make file and modify line 11, “LIBS”, move “-lz, -lxml2” to the back.

      1
      2
      3
      4
      5
      6
      7
      from

      LIBS = -L/workspace/CALM/fbxsdk/lib/gcc/x64/release -lz -lxml2 /workspace/CALM/fbxsdk/lib/gcc/x64/release/libfbxsdk.a

      to

      LIBS = -L/workspace/CALM/fbxsdk/lib/gcc/x64/release /workspace/CALM/fbxsdk/lib/gcc/x64/release/libfbxsdk.a -lz -lxml2
    • make install

    • [NOTE] then, in the <YOUR_FBX_PYTHON_BINDING_PATH>/build/Python38_x64, a new “fbx.so” was generated.

    • copy the file “fbx.so” to <YOUR_FBX_PYTHON_BINDING_PATH/build/Distrib/site-packages/fbx>. After that, you can see these three files in that directory:

      • fbx.so
      • FbxCommon.py
      • fbxsip.so
  5. add sys path to your .py file

    • the package paths are not added to python sys.path, you should add path manually.

    • maybe should move<YOUR_FBX_PYTHON_BINDING_PATH/build/Distrib/site-packages/fbx> to my python site-package. and maybe don’t need this step.

      1
      2
      3
      import sys
      sys.path.append('<YOUR_FBX_PYTHON_BINDING_PATH>/build/Distrib/site-packages/fbx/')
      ...
    • now you can successfully import fbx, import FbxCommon packages.

  6. other reference