Summary of possible problems in model animation in unity & Maya

Summary of possible problems in model animation in unity & Maya


problem overview

1. The position of the model cannot be changed when the animation is playing (the position cannot be changed, it is fixed at a certain position)
2. The size of the model can be changed when the game is not running, but the model size Scale cannot be changed during runtime
3. Two models use The same animation file (with the same bone or structure), but one model in unity is normal, and the animation of one model is not normal
4. Use the bound bones in Maya to make an animation file, but when exporting the fbx file, the model in the model The animation is lost (there is still animation on the skeleton, but it is not attached to the skeleton of the character, and the skeleton of the character is not animated)
5. In unity, after the model is pasted with textures, there are white/black borders at the seams (in short That is, the model is pasted and not fully displayed).
6. When the normal of the model in Maya is normal and the normal is not changed, after the model is exported to unity, the normal of the model is reversed (that is, the light shines on the front of the model, and the model has light on the back in unity, but no front) Lighting, normals are disordered)
7. There is no "subtle sliding/floating" in the animation made in Maya or other 3D software to observe the legs, but there will be slight shaking of the feet in Unity (I don't know How to describe it)
8. When baking animation in Maya, there will be an error and the project will crash and close the project directly.
9. When the animation is baked in Maya, there is no problem in viewing it in Maya, but the animation is lost or partially lost after exporting.


1. When the model is playing animation, the position cannot be changed (the position cannot be changed, it is fixed at a certain position)

Reason Analysis
The problem that the Animator cannot modify the transform after playing the animation in Unity

Solution
Method ①
In unity, check Apply Root Motion in Animator
insert image description here


Method ② In Maya, disconnect/unlock the restriction information of translation and rotation in the attribute editor of the model! [Insert picture description here](https://img-blog.csdnimg.cn/3d2e5600f33744b28b9578388d9bc3ef.png? x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAQeacrQ==,size_20,color_FFFFFF,t_70,g_se,x_16)

insert image description here

2. The model size can be changed when the game is not running, but the model size Scale cannot be changed during runtime

Solution
Disconnect the limit information Scale in the model's attribute editor in Maya
insert image description here


3. The two models use the same animation file (with the same skeleton or structure), but one model in unity is normal, and the animation of the other model is not normal

Solution
Method ①
Check whether the units in the source project are consistent when the two model files are exported.
For example, two models with the same skeleton, but different uvs and the same model, share an animation file in unity, one model plays the animation normally, and the other model does not play the animation normally; at this time, you need to check the two Whether the units in the Maya file are all meters or centimeters when a model is produced.

Method ②
See if you can adjust the model to be consistent with the value of model——Scene Factor in the import settings of the model


4. Use the bound bones in Maya to make an animation file, but when exporting the fbx file, the animation in the model is lost (there is still animation on the skeleton, but it is not attached to the character's bone, and the character's bone has no animation of)

Solution
①. First, copy the original file bound with constraints, and make corresponding animations in the copied file.
②. Copy the source file of the animation file above, and then open and copy it out. file, in this project, bake the joint animation (keyframe-baking simulation, set the start of the keyframe for baking), so that the constraint ring will break away from the constraint model, and then delete the constraint ring (at this time The constraint ring has lost the binding to the model, and the purpose of deleting and exporting is to not export useless things), export the model and animation.
③. Create a new empty Maya project, and import the model you just exported into the project. At this time, you will find that there are also some missing bound bones. Clean up these useless bone skeletons again, and the rest can be Export the model and animation directly (the model file exported in this step has no redundant discarded skeleton, and the animation is also bound to the character)


5. In unity, after the model is pasted with textures, there are white/black borders at the seams (in short, the model is not fully displayed).

Reference 1 original text .

Solution
①. If in the scene, no matter how far or near the camera is, the model is like a rice dumpling, first check whether the uv of the model is correct.
②. The second situation is that when the model is close to the camera, these white/black borders disappear, and when the distance is farther, the white/black borders at the seam appear. The first method isto uncheck Geberate Mip Maps (texture filtering) in the import settings of the texture in unity. (Check this check box to allow Mipmap generation, and uncheck it to disallow MipMap generation) The second method is to change the Aniso Level parameterin the import settings of the texture in unity), the specific value depends on the project situation. (This method is relatively better, because there is still texture filtering, which can not only solve the problem, but also consume less performance than the first method of directly removing MipMap. This value can also be dynamically changed by code) The reason is that it is performed during rendering . With texture filtering (MipMap), the higher the rendering quality of objects closer to the camera is, the texture of the model will be filtered if the distance is farther away, resulting in white/black edges at the seams of the model. The essence of knowledge extension rendering: texture filtering (Texture filtering) technology . Mipmap detailed explanation (with or without Mipmap difference, principle, advantages, disadvantages, optimization) .
insert image description here

insert image description here





6. When the normal of the model in Maya is normal and the normal is not changed, after the model is exported to unity, the normal of the model is reversed (that is, the light shines on the front of the model, and the model has light on the back in unity, but no front) lighting, normal confusion)

Solution
In the import of the model, set the Normals of the Inspector 's Model moduleto Calculate . (That is, change the default setting from Import to Calculate)Of course, the best way is to export the normal information correctly when exporting in Maya (you can also try baking and exporting the normal map to get the correct normal information) expand

insert image description here

Normals (Defines if and how normals are calculated. This is useful for optimizing game size.)

  • Import: Import normals from a file. This is the default option. If the file does not contain normals, normals will be calculated.
  • Calculate: Calculates normals based on the Normals Mode, Smoothness Source and Smoothing Angle__ (below) properties.
  • None: Disables normals. Use this option if the mesh is neither properly mapped nor affected by realtime lighting.

7. The animation made in Maya or other 3D software does not show "slight sliding/floating" when observing the legs, but when placed in unity, the feet will shake slightly

Solution
In unity, in the import settings of the model -> Animation, find the default setting of Anim.Compression (animation compression) Keyframe Reduction changed to Off
insert image description here
reason
When the model is imported, unity will compress the model animation, resulting in Observe in unity that the feet should not move, but there is shaking in unity. (At first, I thought it was caused by the difference in background algorithm analysis between animation files and 3D software for animation files. I was really ignorant).


8. When baking animation in Maya, there will be an error and the project will be closed directly.

Solution
Try some controllers, bones without baking. For example, the controller of the constraint of the parent node of the character model is not baked, and the skeleton of the subset is selected for baking.


9. When the animation is baked in Maya, there is no problem in viewing it in Maya, but the animation is lost or partially lost after exporting.

The characters are animated and exported, and the clothes are animated, but there is no animation on the human body, and the human body mesh seems to have lost weight. (The face of the character used is also bound, but the animation of the face is not used.)
The solution is
to select the mesh -> edit -> delete by type -> non-deformer history, and then bake and export.

Guess you like

Origin blog.csdn.net/Poggio742/article/details/121698516