The necessary plugin is usually enabled by default, but you can check that in the plugin manager. Removing bones in the same FBX file, and re-running code above - normals correctly match what is in Maya.You can export graphics from Maya in the FBX format. Normal2: X: 0.246448 Y: 0.378525 Z: -0.892179 W: 1Īs seen above - a unit sphere in bind pose should have Normals close to that of the Position X/Y/Z - where above normals are just flat out wrong. Here is output: Vertex Count: 0 Vertex Index: 20 Importer->Initialize("C:\\Projects\\FbxSamples\\SphereWithBones.fbx", -1, sdkManager->GetIOSettings()) Īuto fbxScene = FbxScene::Create(sdkManager, "Scene") Ios->SetBoolProp(IMP_FBX_GLOBAL_SETTINGS, true) Īuto importer = FbxImporter::Create(sdkManager, "") Ios->SetBoolProp(IMP_FBX_ANIMATION, true) Ios->SetBoolProp(IMP_FBX_MATERIAL, true) Int id = normals->GetIndexArray().GetAt(vertexCount) įbxMesh->GetPolygonVertexNormal(polygonId, j, normal2) įbxManager* sdkManager = FbxManager::Create() įBXSDK_printf("Error: Unable to create FBX Manager!\n") įBXSDK_printf("Autodesk FBX SDK version %s\n", sdkManager->GetVersion()) įbxIOSettings* ios = FbxIOSettings::Create(sdkManager, IOSROOT) ![]() Normal = normals->GetDirectArray().GetAt(vertexCount) Normal = normals->GetDirectArray().GetAt(id) Ĭase FbxGeometryElement::eByPolygonVertex: Int id = normals->GetIndexArray().GetAt(vertexIndex) Normal = normals->GetDirectArray().GetAt(vertexIndex) Int meshControlPointsCount = fbxMesh->GetControlPointsCount() Īuto normals = fbxMesh->GetElementNormal() įor (int polygonId = 0 polygonId GetPolygonSize(polygonId) įor (int j = 0 j GetPolygonVertex(polygonId, j) Īuto position = meshControlPoints Ĭase FbxGeometryElement::eB圜ontrolPoint: Int triangleCount = fbxMesh->GetPolygonCount() Īuto meshControlPoints = fbxMesh->GetControlPoints() Void FbxSample::ImportMesh(FbxNode& node, int depth)Īuto log = std::ofstream("C:\\Projects\\FbxSamples\\log.txt") Īuto& globalTransform = node.EvaluateGlobalTransform(FBXSDK_TIME_INFINITE) įbxMesh* fbxMesh = (FbxMesh*)node.GetNodeAttribute() Here is the code used to produce issue, again using FBX SDK 2020 (most recent lib) namespace test I've tried with a different model, - a unit sphere with bones, and same problem happens, except this time normals are way off. My process has basically been to drag / drop the FBX into Maya, and put the model into Bind Pose, and view data in Maya's Component Editor.īelow is a picture of Normals from the fbx file from my Importer using FBX SDKīelow is a picture of the same vertex but as seen in Maya's Component EditorĪs seen above there is some error in the Nomal values in the hundreds decimal place, while the Position values are basically identical.īelow is another picture of the same data, but after deleting the Skeleton, and re-exporting from Maya to a new FBX file My problem I have currently, is that when I am importing the Normals from FBX SDK, they appear to be slightly off compared to that of Maya for skinned meshes only (aka meshes that are bound to a skeleton) and have animation data. ![]() I am currently writing a FBX Importer using FBX SDK 2020, and I've been validating that the data I have is correct, by dragging and dropping the FBX into Maya, and viewing what Maya's Component Editor shows the data to be.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |