The Area http://area.autodesk.com/forum/ The Area en Copyright 2013 2013-05-22T08:28:59+02:00 FBX importer trying to load non-existing files (absolute vs relative paths) http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/fbx-importer-trying-to-load-non-existing-files-absolute-vs-relative-paths/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/fbx-importer-trying-to-load-non-existing-files-absolute-vs-relative-paths/page-last/#When:04:09:09Z Hi, I have a problem when loading some FBX file. It was exported on artist machine to E:somefolderasset.fbx. Problem is that when I load it on my machine, during FbxImporter::Import(), it tries to access E:, which unfortunately happens to be my DVD-ROM drive. If I have a DVD inside, it will successfully convert the fbx (it notices the file doesn't exist and use the relative path approach instead). However, if I have no DVD in the drive, it will open a windows dialog box complaining that I need to put a DVD in the drive (during FbxImporter::Import()), many times. Is there any options to make those file existence checks less invasive? (it should silently fail if no DVD) 2013-05-22T04:09:09+02:00 EvaluateGlobalTransform and Maya http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/evaluateglobaltransform-and-maya/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/evaluateglobaltransform-and-maya/page-last/#When:15:06:55Z One of our artists game me a file which was an exported character animation scene in Maya. I was able to view the character in its bind pose but the animation wasn't working even after modifying the GetGlobalPosition to compute the correct Global Transformation for each node. Our artist mentioned that the animation was keyed starting from frame 1 (default in Maya). I asked him to export another FBX and this time key in frame 0 and I was able to view the animation successfully. My question is, does EvaluateGlobalTransform requires the animation to be keyed starting from frame 0? 2013-05-21T15:06:55+02:00 FBX Vertex Skinning http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/fbx-vertex-skinning/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/fbx-vertex-skinning/page-last/#When:08:33:22Z Hi! I am writing a game engine and now I want to implement GPU Vertex Skinning. For this I want to get the animation data from the fbx file. So I need the weights and bone indices per vertex and the right matrices for the skinning. I have the following code, but I think I have the wrong matrices: [code] int i, j; int lSkinCount=0; int lClusterCount=0; FbxCluster* lCluster; int current_index; float current_weight; lSkinCount=pGeometry->GetDeformerCount(FbxDeformer::eSkin); std::ofstream out("animation2.txt"); //lLinkCount = pGeometry->GetLinkCount(); for(i=0; i!=lSkinCount; ++i) { animation_true = true; Bone bone; lClusterCount = ((FbxSkin *) pGeometry->GetDeformer(i, FbxDeformer::eSkin))->GetClusterCount(); //Umständlich RootNode suchen: for(j = 0; j != lClusterCount; ++j) { lCluster=((FbxSkin *) pGeometry->GetDeformer(i, FbxDeformer::eSkin))->GetCluster(j); FbxNode* pBoneNode = lCluster->GetLink(); if(!pBoneNode->GetParent()) { InvBoneInitPoseGlobalTransform = pBoneNode->EvaluateGlobalTransform(); } } //Ende umständlich RootNode suchen for (j = 0; j != lClusterCount; ++j) { lCluster=((FbxSkin *) pGeometry->GetDeformer(i, FbxDeformer::eSkin))->GetCluster(j); //lLink = pGeometry->GetLink(i); const char* lClusterModes[] = { "Normalize", "Additive", "Total1" }; int k, lIndexCount = lCluster->GetControlPointIndicesCount(); int* lIndices = lCluster->GetControlPointIndices(); lWeights = lCluster->GetControlPointWeights(); for(k = 0; k < lIndexCount; k++) { current_index = lIndices[k] ; current_weight = (float) lWeights[k]; out << current_index << "n"; int blendPointer = weight_array[current_index].pointer; weight_array[current_index].indices[blendPointer] = j; weight_array[current_index].weights[blendPointer] = current_weight; blendPointer ++; weight_array[current_index].pointer = blendPointer; } bone.transformMatrix = lCluster->GetTransformMatrix(bone.transformMatrix); bone.bindPoseMatrix = lCluster->GetTransformLinkMatrix(bone.bindPoseMatrix); bone.associateModelMatrix = lCluster->GetTransformAssociateModelMatrix(bone.associateModelMatrix); FbxNode* pBoneNode = lCluster->GetLink(); bone.BoneLocalTransform = pBoneNode->EvaluateLocalTransform(10); //bone.BoneLocalTransform = InvBoneInitPoseGlobalTransform * bone.BoneLocalTransform; bone.BoneLocalTransform = bone.BoneLocalTransform; if( pBoneNode->GetParent() ) { FbxAMatrix parentMatrix = pBoneNode->GetParent()->EvaluateLocalTransform(10); //hier muss mit der globalTransform vom Parent multipliziert werden! bone.BoneGlobalTransform = bone.BoneLocalTransform * parentMatrix; //bone.BoneGlobalTransform = bone.BoneLocalTransform; bone.BlendMatrix = bone.bindPoseMatrix.Inverse() * bone.BoneGlobalTransform; //bone.BlendMatrix = bone.BoneGlobalTransform; } bones.push_back(bone); } } [/code] The problem is also that I guess that the weights also are not correct. Are the weights for every frame the same? I thought so. There are vertices with all weights 0 and so they are not influenced by any bone, but in Maya I can see that the more vertices are influenced. Futher I don't know if the calculation of the BlnedMatrix is right. I always get as BoneLocalTransform an Identity Matrix. Can anyone help me? What exactly is the time value in evaluatelocalTransform? Is it the frame number? If not, is there a possibility to get it per frame? With frame I mean a frame in Maya. I know that I have to interpolate in my engine. The blend matrix is the one I send to my vertex shader. This is the vertex shader: I am doing it with OpenGL [code] #version 400 in vec3 inputPosition; in vec2 inputTexCoord; in vec3 inputNormal; in vec4 skinWeights; in vec4 skinIndices; out vec2 texCoord; out vec3 normal; uniform mat4 worldMatrix; uniform mat4 viewMatrix; uniform mat4 projectionMatrix; uniform mat4 bones[61]; void main(void) { vec4 skinWeights2; skinWeights2.x = skinWeights.x; skinWeights2.y = skinWeights.y; skinWeights2.z = skinWeights.z; skinWeights2.w = skinWeights.w; if((skinWeights2.x == 0) && (skinWeights2.y == 0) && (skinWeights2.z == 0) && (skinWeights2.w == 0)) { gl_Position = worldMatrix * vec4(inputPosition, 1.0f); gl_Position = viewMatrix * gl_Position; gl_Position = projectionMatrix * gl_Position; texCoord = inputTexCoord; normal = mat3(worldMatrix) * inputNormal; normal = normalize(normal); } else { vec4 newVertex; vec4 newNormal; vec4 inputPosition2 = vec4(inputPosition, 1.0f); int index = int(skinIndices.x); newVertex = (bones[index] * inputPosition2) * skinWeights2.x; newNormal = (bones[index] * vec4(normal, 1.0)) * skinWeights2.x; index = int(skinIndices.y); newVertex = (bones[index] * inputPosition2) * skinWeights2.y + newVertex; newNormal = (bones[index] * vec4(normal, 0.0)) * skinWeights2.y + newNormal; index = int(skinIndices.z); newVertex = (bones[index] * inputPosition2) * skinWeights2.z + newVertex; newNormal = (bones[index] * vec4(normal, 0.0)) * skinWeights2.z + newNormal; index = int(skinIndices.w); newVertex = (bones[index] * inputPosition2) * skinWeights2.w + newVertex; newNormal = (bones[index] * vec4(normal, 0.0)) * skinWeights2.w + newNormal; //newVertex.y = newVertex.y - 4.0f; gl_Position = worldMatrix * newVertex; gl_Position = viewMatrix * gl_Position; gl_Position = projectionMatrix * gl_Position; texCoord = inputTexCoord; vec3 temp; temp.x = newNormal.x ; temp.y = newNormal.y; temp.z = newNormal.z; normal = mat3(worldMatrix) * temp; normal = normalize(normal); } [/code] 2013-05-20T08:33:22+02:00 python fbx 2013.2: problem with osx 64bit http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/python-fbx-20132-problem-with-osx-64bit/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/python-fbx-20132-problem-with-osx-64bit/page-last/#When:09:20:50Z On OSX, the fbx python installer (2013.2) has the sip.so library for python only with i386 architecture. This precludes the use of fbx with python at 64bit. With 2013.1: $ file lib/Python26/sip.so lib/Python26/sip.so: Mach-O 64-bit bundle x86_64 $ file lib/Python31/sip.so lib/Python31/sip.so: Mach-O 64-bit bundle x86_64 With 2013.2 (also tested with 2013.3 beta): $ file lib/Python26/sip.so lib/Python26/sip.so: Mach-O bundle i386 $ file lib/Python31/sip.so lib/Python31/sip.so: Mach-O bundle i386 I'm using osx 10.8 and python is at 64bit. If I try to use python with 32bit I have this error: $ export VERSIONER_PYTHON_PREFER_32_BIT=yes $ python Python 2.7.2 (default, Jun 20 2012, 16:23:33) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import fbx Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dynamic module does not define init function (initfbx) 2013-05-17T09:20:50+02:00 Edge crease values http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/edge-crease-values/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/edge-crease-values/page-last/#When:17:58:38Z What is the mapping for crease values from Maya to FBX? In Maya, they are set with Edit Mesh->Crease Tool In FBX, they are read with: float edgeCrease = (float)m_Mesh->GetEdgeCreaseInfo(edgeIndex); Maya indicates that the maximum is two, but appears to store up to 10. The FBX SDK indicates that the crease values range from [0.0 - 1.0] 2013-05-16T17:58:38+02:00 Import with Not English formatted file path. http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/import-with-not-english-formatted-file-path/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/import-with-not-english-formatted-file-path/page-last/#When:03:19:26Z Hi. I have a question about import file. FbxImporter.Initialize() has for char* method only. but I need wchar_t*, for example that string has Japanese, Chinese, Korean and so on. Does FBX SDK not support those languages at all? If exists a way, plz tell me. If not, is there any plan to create wchar_t* method for those languages? 2013-05-04T03:19:26+02:00 work special effects http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/work-special-effects/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/work-special-effects/page-last/#When:11:40:03Z I need a professional to work with on special effects, like the examples: http://vimeo.com/22038332, http://vimeo.com/22052758, http://vimeo.com/23004482. Only the part of post produção.I have many jobs for you. 2013-05-03T11:40:03+02:00 Determine Axis System http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/determine-axis-system/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/determine-axis-system/page-last/#When:12:13:18Z I am loading an fbx file with animation using the Python FBX SDK 2014.1 using Python version 2.6.8. Is there a way to figure out what is the Axis System of the file since they can be exported from Max, Maya (YUp or ZUp), MotionBuilder, etc... 2013-05-02T12:13:18+02:00 building sample files in linux http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/building-sample-files-in-linux/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/building-sample-files-in-linux/page-last/#When:14:56:12Z hi, i'm trying to make the sample programs in linux , when i use : [color=red]$ make[/color] i get this : [code] ../../lib/gcc4/x86/libfbxsdk-2013.1.so: undefined reference to `dlopen' ../../lib/gcc4/x86/libfbxsdk-2013.1.so: undefined reference to `dlclose' ../../lib/gcc4/x86/libfbxsdk-2013.1.so: undefined reference to `clock_gettime' ../../lib/gcc4/x86/libfbxsdk-2013.1.so: undefined reference to `dlsym' ../../lib/gcc4/x86/libfbxsdk-2013.1.so: undefined reference to `uuid_generate' collect2: ld returned 1 exit status make: *** [../../bin/x86/release/Animation//Animation] Error 1 [/code] can anyone help , i'm using ubuntu 12.04 with gcc 4.6.3 , thnx 2013-04-27T14:56:12+02:00 Extracting Vertex Data (x, y, z, normalX, normalY, normalZ, s, t) from an FBX File http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/extracting-vertex-data-x-y-z-normalx-normaly-normalz-s-t-from-an-fbx-file/page-last/ http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/extracting-vertex-data-x-y-z-normalx-normaly-normalz-s-t-from-an-fbx-file/page-last/#When:02:25:19Z I have been butting my head against the wall for quite a while. I'm writing a tool to extract the vertex data from an FBX model and convert that into a file that an OpenGL game engine I wrote can load and display. I tried all sample code, and all the examples in the documentations, but I still get wrong and consistent results. I attached an image that shows how the exported model is shown in both textured and wireframe modes. It is clear that something is wrong, but I can't figure out what's wrong here. Here's the ugly code that I use to extract the data. Could you please tell me what's wrong there? [code]void ExtractPolygonInfo(KFbxMesh* pMesh) { int i, j, lPolygonCount = pMesh->GetPolygonCount(); KFbxVector4* lControlPoints = pMesh->GetControlPoints(); int vertexId = 0; for (i = 0; i < lPolygonCount; i++) { printf("ttPolygon[%d]n", i); int l; int lPolygonSize = pMesh->GetPolygonSize(i); VertexData vert; for (j = 0; j < lPolygonSize; j++) { int lControlPointIndex = pMesh->GetPolygonVertex(i, j); printf("tttVertex[%d]n", j); // co-ords float x, y, z; x = (float)lControlPoints[lControlPointIndex].GetAt(0); y = (float)lControlPoints[lControlPointIndex].GetAt(1); z = (float)lControlPoints[lControlPointIndex].GetAt(2); //printf("ttttX[%f], Y[%f], Z[%f]n", x, y, z); vert.x = x; vert.y = y; vert.z = z; for (l = 0; l < pMesh->GetElementUVCount(); ++l) { KFbxGeometryElementUV* leUV = pMesh->GetElementUV( l); KFbxVector2 UV; switch (leUV->GetMappingMode()) { case KFbxGeometryElement::eBY_CONTROL_POINT: switch (leUV->GetReferenceMode()) { case KFbxGeometryElement::eDIRECT: UV = leUV->GetDirectArray().GetAt(lControlPointIndex); float u, v; u = (float)UV[0]; v = (float)UV[1]; //printf("ttttU[%f], V[%f]n", u, v); vert.s = u; vert.t = v; break; case KFbxGeometryElement::eINDEX_TO_DIRECT: { int id = leUV->GetIndexArray().GetAt(lControlPointIndex); UV = leUV->GetDirectArray().GetAt(id); float u, v; u = (float)UV[0]; v = (float)UV[1]; //printf("ttttU[%f], V[%f]n", u, v); vert.s = u; vert.t = v; } break; default: break; // other reference modes not shown here! } break; case KFbxGeometryElement::eBY_POLYGON_VERTEX: { int lTextureUVIndex = pMesh->GetTextureUVIndex(i, j); switch (leUV->GetReferenceMode()) { case KFbxGeometryElement::eDIRECT: case KFbxGeometryElement::eINDEX_TO_DIRECT: { UV = leUV->GetDirectArray().GetAt(lTextureUVIndex); float u, v; u = (float)UV[0]; v = (float)UV[1]; //printf("ttttU[%f], V[%f]n", u, v); vert.s = u; vert.t = v; } break; default: break; // other reference modes not shown here! } } break; case KFbxGeometryElement::eBY_POLYGON: // doesn't make much sense for UVs case KFbxGeometryElement::eALL_SAME: // doesn't make much sense for UVs case KFbxGeometryElement::eNONE: // doesn't make much sense for UVs break; } } KFbxVector4 norm; int numElementNormal = pMesh->GetElementNormalCount(); if (pMesh->GetElementNormalCount() > 0) { // Get only the first KFbxGeometryElementNormal* normal = pMesh->GetElementNormal(0); KFbxGeometryElement::EMappingMode mappingMode = normal->GetMappingMode(); if (mappingMode == KFbxGeometryElement::eBY_CONTROL_POINT) { switch (normal->GetReferenceMode()) { case KFbxGeometryElement::eDIRECT: { norm = normal->GetDirectArray().GetAt(lControlPointIndex); float nx, ny, nz; nx = (float)norm[0]; ny = (float)norm[1]; nz = (float)norm[2]; //printf("ttttNx[%f], Ny[%f], Nz[%f]n", nx, ny, nz); vert.nx = nx; vert.ny = ny; vert.nz = nz; } break; case KFbxGeometryElement::eINDEX_TO_DIRECT: { int id = normal->GetIndexArray().GetAt(lControlPointIndex); norm = normal->GetDirectArray().GetAt(id); float nx, ny, nz; nx = (float)norm[0]; ny = (float)norm[1]; nz = (float)norm[2]; //printf("ttttNx[%f], Ny[%f], Nz[%f]n", nx, ny, nz); vert.nx = nx; vert.ny = ny; vert.nz = nz; } break; default: break; } } else if (mappingMode == KFbxGeometryElement::eBY_POLYGON_VERTEX) { switch (normal->GetReferenceMode()) { case KFbxGeometryElement::eDIRECT: { norm = normal->GetDirectArray().GetAt(vertexId); float nx, ny, nz; nx = (float)norm[0]; ny = (float)norm[1]; nz = (float)norm[2]; //printf("ttttNx[%f], Ny[%f], Nz[%f]n", nx, ny, nz); vert.nx = nx; vert.ny = ny; vert.nz = nz; } break; case KFbxGeometryElement::eINDEX_TO_DIRECT: { int id = normal->GetIndexArray().GetAt(vertexId); norm = normal->GetDirectArray().GetAt(id); float nx, ny, nz; nx = (float)norm[0]; ny = (float)norm[1]; nz = (float)norm[2]; //printf("ttttNx[%f], Ny[%f], Nz[%f]n", nx, ny, nz); vert.nx = nx; vert.ny = ny; vert.nz = nz; } break; default: break; } } } vertexId++; PrintAVert(vert); } // for polygonSize } // for polygonCount }[/code] 2013-04-25T02:25:19+02:00