Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6e3d5985 authored by Robin Adili's avatar Robin Adili
Browse files

initcommit

parents
No related branches found
No related tags found
No related merge requests found
build/
This diff is collapsed.
#Usage
#Build
install script will install an old version of sip
Conda env or container with the current version of sip uninstalled is recommended
dependencies
```lib1g-dev
libxml2-dev
make
gcc
python3-pip
```
`./build.sh`
build.sh 0 → 100644
#!/bin/sh
set -xe
origdir=$(pwd)
cd $(dirname $0)
scdir=$(pwd)
builddir="$scdir"/build
[ -d "$builddir" ] || mkdir "$builddir"
cd "$builddir"
wget -i "$scdir"/reqs.txt
ls -1 *.tar.gz|xargs -L 1 tar -xvf
rm *.tar.gz
fbxsdkdir=fbxsdk
mkdir $fbxsdkdir
./fbx*fbxsdk_linux $fbxsdkdir
fbxpydir=fbxpy
mkdir $fbxpydir
./fbx*fbxpythonbindings_linux $fbxpydir
sipdir="sip-4.19.3"
cd $sipdir
python3 configure.py
make
make install
cd "$builddir/$fbxpydir"
cp "$scdir/PythonBindings.py" .
export FBXSDK_ROOT="${builddir}/$fbxsdkdir"
export SIP_ROOT="${builddir}/$sipdir"
python3 PythonBindings.py Python3_x64
cd "$origdir"
from fbx import *
import sys
def InitializeSdkObjects():
# The first thing to do is to create the FBX SDK manager which is the
# object allocator for almost all the classes in the SDK.
lSdkManager = FbxManager.Create()
if not lSdkManager:
sys.exit(0)
# Create an IOSettings object
ios = FbxIOSettings.Create(lSdkManager, IOSROOT)
lSdkManager.SetIOSettings(ios)
# Create the entity that will hold the scene.
lScene = FbxScene.Create(lSdkManager, "")
return (lSdkManager, lScene)
def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False):
lExporter = FbxExporter.Create(pSdkManager, "")
if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount():
pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat()
if not pEmbedMedia:
lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount()
for lFormatIndex in range(lFormatCount):
if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex):
lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex)
if "ascii" in lDesc:
pFileFormat = lFormatIndex
break
if not pSdkManager.GetIOSettings():
ios = FbxIOSettings.Create(pSdkManager, IOSROOT)
pSdkManager.SetIOSettings(ios)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True)
result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings())
if result == True:
result = lExporter.Export(pScene)
lExporter.Destroy()
return result
def LoadScene(pSdkManager, pScene, pFileName):
lImporter = FbxImporter.Create(pSdkManager, "")
result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings())
if not result:
return False
if lImporter.IsFBX():
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True)
result = lImporter.Import(pScene)
lImporter.Destroy()
return result
File added
https://www.autodesk.com/content/dam/autodesk/www/adn/fbx/2020-0-1/fbx202001_fbxsdk_linux.tar.gz
https://www.autodesk.com/content/dam/autodesk/www/adn/fbx/2020-0-1/fbx202001_fbxpythonbindings_linux.tar.gz
https://www.riverbankcomputing.com/static/Downloads/sip/4.19.3/sip-4.19.3.tar.gz
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment