Export Fbx from Blender To Unity - animation

I have a complete blender file which has an animated character with two actions and I want to export it as an fbx so i can view it in unity. I did it and for some reason it is only exporting my actions and not the mesh or camera or anything else only exports the actions. Why is it not exporting my mesh I have everything selected and i have apply modifiers and include animation selected. Thanks for the help

Sounds like you are exporting in Blender with Selected Objects options set. In this case you have to select the mesh itself in object mode to export both. Selecting the armature will export animations only.
If you do have a mesh in Unity3D but can't see it in the scene, you have to fix the scale factor. It's set to 0.01 by default. So change it to 1 to see the mesh in its original size.

Related

three.js / A-Frame ObjectLoader does not load Texture and positions Meshes wrongly

We have an issue with exporting our 3D Assets and animations correctly so that three.js can correctly display them.
All our 3D artists work with Cinema4D so we need to go through blender to export a three.js compatible JSON. They export the scene as FBX and then import it to blender. This seems to work fine. The model looks good there (with Material View set in Preview Window) and the simpler models we exported even worked with textures and animations.
But we now have a scene where, when we load the resulting JSON, some of the meshes are flipped 180° (but only some - the trees) and one of the models (Santa model) is not textured. They all look fine in blender.
When loading the JSON in https://threejs.org/editor/ you will immediately see the issues:
Is this an export problem? Can we fix it by tweaking the export params? Will we need to adjust the model in blender?
I would advise a couple things here:
File a bug on three.js including the .blend file
Try freezing transforms in Blender or C4D before export
Perhaps try a different three.js-compatible blender exporter, like glTF-Blender-Exporter.

Three JS Blender JSON EXPORTER smooth / flat shading

Blender has the ability to set a material to Flat or Smooth.
In the Blender exporter for three.js, when I check "Export Normals" to JS model, I always export all materials as Smooth. The exported file is twice bigger.
Is there a way to export models with Flat Shaded and Smooth shaded faces without need to set it manually in three.js ?
There is no flatshading/noshading/smoothshading equivalent in blender. However as few other features (blending, depthwrite, depthtest) it could be proposed in the 'threejs' part of the material pannel.
You could do it yourself by editing the following files in the addon :
constants.py,
__init__.py,
exporter/material.py,
exporter/api/material.py
(copy the way blending types work for example)
You would just pay attention that the blender io-three addon yet has a shading field for materials, used to define phong or lambert materials. You would just have to chose an other name.
Finally you would also have to edit threejs so the JSONLoader can parse the new property you add.
That said, it is a bit longer than setting your materials properties in your code, since you will always need to write material=new THREE.Mesh****Material(properties)...

How do I animate attributes and export it as a fbx-file?

I have made a pipe in Maya, on which I have animated the thickness (Below is an example of 4 of the keyframes in the animation). Unfortunately when I export it as an fbx file, the animation of the of the thickness is not saved. Is there a way to save an animation that would be something similar to this one or some help on getting this solution to work?
I'm fairly new to Maya so there might be something I'm missing. Hope you can help me.
Default FBX won't export the changes in the geometry - it will give you the position, rotation and scale of the object over time but not changes to vertex positions within the object.
You can turn on the 'Geometry Cache' option in the fbx export dialog:
Vertex Animation stored in FBX file without using Point Cache?
However not all applications that use FBX support geometry caches - you'll have to see what your target software supports. Other options might be to export a series of .OBJ files (1 per frame) and use the vertex data from those, or to use an animated geometry specific format like Alembic

3dsmax to Unity export animation

I'm having some difficulty exporting animated meshes from 3dsmax to Unity3d.
I've succeeded in getting transform animations to export ok, for instance if something is moving. But animated parameters on something dont seem to export, for instance the height of box.
Here are my fxb export settings
I'm guessing they are losing this information when they are turned from boxes to meshes and i must bake the animations on manually somehow but I have no idea how.
Vertex animation is not supported.
Use bones, skin the mesh and animate that way instead.

Maya Mel Scripted Animation Not Animating as FBX

I've acquired a great quad model. I skinned and animated it to a rig build by a
Mel script. It works great as far as editing the animation using sliders and parameters
in Maya. When I export the file as an FBX file to Unity3D, it does not animate. Is something
being lost in the translation from Mel to the rig? Unity needs a boned rig, is this procedural rig not the equivalent of a rig built and animated with the skeleton tools in Maya? I've check that I have a 'Reference' folder, I've set keys, changed root name to "Hips".
Thanks for any insight on this question.
dDuane
If you are transferring the file with no errors and there is no animation then there are three issues to look at.
First, you may have accidentally not exported the keyframes. Make sure the box is checked to export animation on the FBX export UI.
Second, it's possible that the object that contains the actual keyframes is not being exported. When you animate using the MEL scripted GUI, find out where the actual keyframes are on the rig and make sure that object is exporting with the rest of the character.
Third, the object might be transferring fine but depending on the rig setup the connections/constraints/whatever might not be working or supported in Unity. You might consider baking the animation to the skeleton before transferring to the engine. To do this, select the skeleton, click [Edit -> Keys -> Bake Simulation].
I don't know what Maya you are using, but I've always used 2010. This is the workflow that we used for a small unity 3D game project:
Export all of the
animations in one scene as a .fbx. Be sure you just select the geometry (it
usually helps to have it all grouped, but if you can't for some reason that's
okay) and hit export selected.
These FBX export options should be checked:
Geometry:
Edge smoothing,
Tangents and Bi-normals
Animation:
Animation,
Bake Animations,
Bake Animations,
(range of animation),
step = 1
Deformed Models:
Deformed Models,
Skins,
Blend Shapes (if using these),
Curve Filters,
Resample as Euler Interpolation,
Input Connections,
Instances to Objects,
Referenced Containers Content (if using any references),
FBX File Format
Binary
FBX200900
When you bring this into Unity, set animation generation
to "store in root." If all of your
animation is in this one file (which it should be). The "split
animations" box should be checked and define the names and range of these in the
chart below. When you eventually create an animation blending script, drag
and drop it on the animation object within the player prefab, not the prefab
itself.

Resources