Created
February 29, 2020 12:39
-
-
Save fereria/eea61531a530efa799d343331d305214 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
main() { | |
auto stage = UsdStage::CreateInMemory(); | |
ClassTest* hoge = new ClassTest("D:/work/data_sample/xbot.fbx"); | |
FbxArray<FbxMesh*>* meshArray = new FbxArray<FbxMesh*>(); | |
hoge->getAllMesh(*meshArray); | |
// 取得してきた情報でPrimを作る | |
for (int i = 0; i < meshArray->Size(); i++) { | |
USDMeshData* data = new USDMeshData(); | |
hoge->getMeshData(meshArray->GetAt(i), data); | |
SdfPath meshPath = SdfPath(data->sdfPath); | |
UsdGeomMesh usdMesh = UsdGeomMesh::Define(stage, meshPath); | |
usdMesh.CreatePointsAttr(VtValue(data->vtxPoints)); | |
usdMesh.CreateFaceVertexCountsAttr(VtValue(data->polyVtx)); | |
usdMesh.CreateFaceVertexIndicesAttr(VtValue(data->polyIndex)); | |
} | |
stage->GetRootLayer()->Export("D:/test.usda"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment