Skip to content

Instantly share code, notes, and snippets.

@whaison
Created December 27, 2016 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whaison/87a77eac6da05987fe46c6ac274fa26c to your computer and use it in GitHub Desktop.
Save whaison/87a77eac6da05987fe46c6ac274fa26c to your computer and use it in GitHub Desktop.
FBX_SDK_VS_Cpp00200.cpp
// FBX_SDK_VS_Cpp00200.cpp : コンソール アプリケーションの
//エントリ ポイントを定義します。
//
#include "stdafx.h"
//assert.h
#include <assert.h>
//対策:LNK1104 ファイル 'libfbxsdk.lib' を開くことができません。
//「構成プロパティ」 → 「リンカ」 → 「全般」フルパスで指定
//C:\Maya\scripts\FBX_SDK\2017.1¥lib¥vs2015¥$(PlatformTarget)¥$(Configuration); C:\Maya\scripts\FBX_SDK\2017.1\lib\vs2015\x86\debug;
//---------------------------------------------------------
#ifdef _MSC_VER
// FBX SDKをDLL形式で使うと定義
// TIPS:fbxsdk.hをインクルードする前に定義する
#define FBXSDK_SHARED
#endif
#include <fbxsdk.h> // FBX SDKのヘッダーファイル
//---------------------------------------------------------
int main()
{
printf("main() \n");
//---------------------------------------------------------
// FBX SDKを生成・初期化
FbxManager* manager = FbxManager::Create();
assert(manager);
// 読み込み機能を生成
FbxImporter* importer = FbxImporter::Create(manager, "");
assert(importer);
if (!importer->Initialize("hoge.fbx"))
{
// 読み込み失敗
}
// 読み込み用のシーンを生成
FbxScene* scene = FbxScene::Create(manager, "");
assert(scene);
// ファイルからシーンへ読み込む
importer->Import(scene);
// FbxImporterはもう使わないのでここで破棄
importer->Destroy();
//
// シーンから必要な情報を取り出す処理を書く
//
// シーンを破棄
scene->Destroy();
// FBS SDKを破棄
manager->Destroy();
//--------------------------------------------------
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment