Hot answers tagged

8

The FBX documentation is painful at times, and this is definitely one of them. There are two ways I've used to access animation data. The first is used in the ImportScene sample that comes with the SDK, and it's the way you seem to be trying to do things. In your sample, now that you have a valid lAnimCurve, you would need to query the number of keyframes ...


7

The range [-1 ; 1] x [-1 ; 1] x [0 ; 1] mentioned in the tutorial refers to the canonical view volume. It is the final coordinate space vertex data gets mapped to before everything is rasterized to your screen. To understand what exactly this means, it helps to take a look at what a rendering pipeline typically looks like. Coordinate spaces A coordinate ...


5

In general you don't use any such format directly as an asset in production. It's fine to add code for loading them, and to use them as an intermediate format for development, but for production you don't really go down that route. Instead, for production you want to use e.g. a model format that you can load fast and directly; e.g. and in OpenGL, you'd ...


5

Simply drag the .fbx file to the project assets folder.


4

Found it! The FBX Converter can be downloaded from the FBX Plug-Ins, Converter, and QuickTime Viewer Downloads page. One opened there's an "Add FBX Viewer" button which can display FBX contents and animations.


4

The advantages of binary FBX over ASCII FBX are most immediately; speed of reading and the size of the file. Another significant advantage would be that it is possible to build your own parser and asset importer for the ASCII flavour. The binary format has never been (officially) publically documented. I would also challenge the degree of advantage ASCII ...


3

XNB is a binary container for all your content in programs that use the XNA content pipeline, this includes models, but also textures, fonts, audio, and sprites. While it is possible to extract information from an XNB file (see for example this plugin for paint.net that extracts the textures in an XNB file: ) I do not know of any programs that extract ...


3

Binary files load much faster than ASCII files -- // open it FILE *fin = fopen( "binary.fbx", "r" ) ; // get size in bytes fseek( fin, 0, SEEK_END ) ; size_t size = ftell( fin ); rewind( fin ) ; unsigned char* bytes = (unsigned char*)malloc( size ) ; fread( bytes, size, 1, fin ) ; // THAT'S ALL FOLKS! Meanwhile, an ascii fbx parser is pretty significant ...


3

To load up a 3D model in run time from a server, you need to use AssetBundles. You create an AssetBundle and upload it to a server. You can then download that AssetBundle with the unity WWW class. There is a another way to do it, which is suggested here. In this solution you read the text file construct the model from that. Very difficult and time consuming....


3

Your device states are probably wrong. This often happens when mixing 2D and 3D (for example the overload for SpriteBatch.Begin() which takes no arguments sets some device states that are incompatible with 3D rendering. No worries though, all you have to do is to make sure that the following device states are set the way you want them: BlendState, ...


3

if you still want to use 3DS Max for your animation takes you can use this: http://www.turbosquid.com/FullPreview/Index.cfm/ID/701878


3

It looks to me like lighting is your problem. According to this the default lighting in 3DS Max is essentially a headlamp (a directional light coming from the viewport), so the faces pointing towards you will appear the brightest. Your Unity preview has a directional light shining towards the bottom right (I could have said "located in the top left", but ...


3

Regarding #1: The method GetTextureUV of FbxMesh should get the trick done. EDIT: The following code is untested and rougly copied from here: int polygonCount = mesh->GetPolygonCount(); for (int i = 0; i < polygonCount; ++i) { FbxLayerElementArrayTemplate<KFbxVector2>* uvVertices= 0; mesh->GetTextureUV(&uvVertices, KFbxLayerElement::...


3

In supplemental to Syntac_'s example, here's how you could also load some keyframe and skeletal animation data. For a start, given you have an Fbx scene object initialized, you could pass fbxScene->GetRootNode() to a method like this: void MyFbxScene::LoadNode(FbxNode* fbxNode) { int numAttributes = fbxNode->GetNodeAttributeCount(); for (int i = ...


3

You will get materials attached when you import FBX from Blender into Unity but it will assign unity's standard material/shader. What you won't have is the texture assigned into the diffuse/albedo slot of the Unity standard material. Unfortunately, you will have to save the texture in Blender separately, then import it into unity before assigning it into the ...


3

I experienced this problem as well but since no one actually answered the question I'll say what I did to solve it. You are correct that it seems to be a version issue, I fixed it by simply making a new project in an older version (2018.4.7f1 specifically), and then I dragged the fbx file into the project. Once I imported it, I then exported it as a unity ...


3

FBX is indeed a file format for 3d models. Besides mesh data and materials it can also contain an animation rig and animation sequences for that rig. However, the models from this asset pack do not seem to contain an animation rig. So if you want to animate them, you have two options: Import the models into a 3d animation program of your choice and add a ...


2

Getting texture coordinates for models with one UV set Using FBX SDK 2013: // UV Container std::vector<float[2]> UVList; // Loop for each poly for ( int Poly(0); Poly < fbxMesh->GetPolygonCount(); Poly++ ) { // Get number of verts in this poly const int NumVertices = fbxMesh->GetPolygonSize( Poly ); // Loop for each vert in poly ...


2

I am no expert in FBX but I have some experience with it, here are my suggestions How do I get the texture coords? Is there a project in the .fbx samples which only display a scene (including animation and texture; I couldn't find one myself)? I would suggest going over the example in $(FBXSDK)\samples\ImportScene This will show you how to get the UV ...


2

You can get the the texture information by following steps, FbxNode -> FbxSurfaceMaterial -> FbxLayeredTexture or FbxTexture -> Texture name (and other properties) The code looks like, int mcount = node->GetSrcObjectCount<FbxSurfaceMaterial>(); for (int index=0; index<mcount; index++ ) { FbxSurfaceMaterial *material = (FbxSurfaceMaterial*)...


2

As an alternative to adding textures to your model, you can stop the default BasicEffect from looking for them when drawing. //foreach BasicEffect basicEffect in model.mesh[n].effects .... basicEffect.TexturesEnabled = false; //begin effect pass...


2

Regarding errors it looks like you have declarations but forgot to add definitions of virtual methods in derived class. I don't know how you import fbx file content into your project but you can do the following (works in VS2012, I don't have access to VS2010 to check it): add fbx files as assets in build customization add MeshContentTask from ...


2

I'm not sure exactly what you want to do but you can always export it from 3ds max in ascii format instead of binary and open it later in a text editor (notepad).


2

You probably don't need .obj if you want to use .fbx. _D usually indicates a diffuse texture, _N is a normal map. You must create a new material and assign those textures into it.


2

FBX supports a whole range of texture properties per surface material: diffuse, specular, etc.. The property names are stored in static char* fields in SDK classs FbxSurfaceMaterial. You can get a pointer to such a material by iterating across all materials of an FbxNode using functions GetMaterialCount() and GetMaterial(index). To load a texture, you first ...


2

I don't know about Unity 5, but in 4, you can click on your model in the Scene window. On the Mesh Renderer properties, there should be at least one material. To start, set the shader to "Diffuse", and click on "select" to select the texture. The character should appear textured. If you want to save these settings for future use, drag the object from the ...


2

You shouldn't be loading the model every frame. Just load it once and render it over and over as needed. Also, you should create the DGSLEffectFactory and CommonStates once and reuse it. The design is for you to implement your own IEffectFactory and then you can return your own custom IEffect for custom shaders. You can also control the individual subset ...


2

Merging multiple FBX files is actually fairly easy. You first need to bring all of the FBX files into Maya. As I have found out, this is fairly simple. Just open an empty scene, and drag and drop the files from a file explorer. Position all of the objects in Maya. If you are unfamiliar with Maya, itself, the basic transformation principles actually work ...


2

Inside the import settings inspector for your model, change from "Use Embedded Materials" to "Use External Materials (Legacy)". You will then have a Materials Folder to modify.


Only top voted, non community-wiki answers of a minimum length are eligible