mixamo.adoc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. = Animating Blender Models With Mixamo
  2. :revnumber: 2.1
  3. :revdate: 2020/07/24
  4. == Using Mixamo For Model Animation
  5. With very little effort, you can use Adobes Mixamo to fully animate your Blender models. Once you understand the process that is.
  6. This guide requires:
  7. * link:https://www.blender.org/download/[Blender version 2.78c+] with its default settings. The exception being `Select With:`, under `menu:File[User Preferences > Input]` is set to `Left Click`.
  8. * Blender FBX file Importing and Exporting, enabled.
  9. * A Modest amount of Blender knowledge.
  10. * A link:https://www.mixamo.com/[Mixamo] account.
  11. == Prepare to Export
  12. To properly animate your models there are a few rules you should follow.
  13. * Read the link:https://helpx.adobe.com/creative-cloud/faq/mixamo-faq.html[Common Questions] guide before you do anything else.
  14. * Clean up your Blender file prior to exporting. This means you have a game ready model that will become the base for all your animations. Do this in a copy of your file so you have the original as a backup. The following checklist is provided for your convenience.
  15. [%interactive]
  16. - [ ] You have no Animations.
  17. - [ ] You have applied a triangulate modifier. Some exporters other than Ogre, have an option to apply the modifier on export. This would be the preferred method.
  18. - [ ] You have UV Mapped your model. It isn't required by Mixamo, just for loading your models into jme.
  19. - [ ] Your models origin is at the base of the mesh.
  20. - [ ] You have your materials and textures done for your model. It isn't required by Mixamo, just for loading your model into jme.
  21. - [ ] You have xref:how-to/modeling/blender/blender_buffer_clearing.adoc[cleared your buffers]. It isn't required by Mixamo, just makes your models cleaner for jme.
  22. - [ ] You have applied the Location, Rotation, and Scale to your model.
  23. - [ ] *MOST IMPORTANT OF ALL*, in the `menu:Properties Panel[Scene Tab > Units Panel]` set the btn:[Unit of Measure] to Meters and the Length to Metric. Adobe uses centimeters for the FBX exporter and if this is not set the models scale will be unusual to say the least. JME3 uses 1 WU = whatever you determine but meters will make things easier for all aspects of your modeling. If you are doing this now, you may have to re-scale your model before proceeding.
  24. [TIP]
  25. ====
  26. See xref:how-to/modeling/blender/blender.adoc[Creating assets in Blender3D] for help on creating jME3 compatible models.
  27. ====
  28. == Blender FBX Export
  29. . In the `3d Viewport`, select your model, it will be high-lighted in orange.
  30. . In the `Info` header, select `menu:File[Export > FBX]`.
  31. . Enter a file path to export to, usually the same folder as your `.blend` file for simplicity.
  32. . Enter a file name.
  33. . In the `Export FBX` panel, located in the bottom left of the export dialog:
  34. Main Tab::
  35. - [x] Selected Objects
  36. - Scale = 1
  37. +
  38. [IMPORTANT]
  39. ====
  40. Click the button next to scale to deselect btn:[Scale all data]. Failure to do so will destroy the scale of your model. If the button is selected, it will be dark in color.
  41. ====
  42. - Forward = -Z Forward
  43. - Up = Y Up
  44. - Which kind of object to export = Mesh
  45. Geometries Tab::
  46. - [x] Apply Modifiers
  47. . When you are done, click the btn:[Export FBX] button to export the file.
  48. [TIP]
  49. ====
  50. You can save these FBX export settings by clicking the btn:[+] button next to btn:[Operator Presets].
  51. ====
  52. == Mixamo FBX Import
  53. . Create an link:https://www.mixamo.com/#/[Mixamo] account and login.
  54. . From the `Default Character` panel, select `Upload Character`.
  55. . Navigate to the file to be uploaded or drag and drop it onto the file up-loader.
  56. . Select `Open`.
  57. [NOTE]
  58. ====
  59. Generally, if at any time during the import and rigging process the model does not appear within the time specified in the dialog that is showing, something has gone wrong and you will have to restart the process over.
  60. ====
  61. == Mixamo Auto-Rigger
  62. If everything went well the `Auto-Rigger` will open and your model will be facing you. If not, fix your model in Blender before proceeding.
  63. . If the model is facing you, click btn:[Next].
  64. . In this panel you will rig your model. Place the markers as shown in the Auto-Rigger dialog image.
  65. +
  66. [NOTE]
  67. ====
  68. Remember that the model is facing you so its right is on your left.
  69. ====
  70. . Select the LOD you are after. This is based off how many bones you want the hand of the model to have. Feel free to cycle through the options to see what each one does.
  71. . When you are through click the btn:[Next] button to rig your model.
  72. . When the model appears, if satisfied with the results, click `Finish`.
  73. == Mixamo Animations
  74. . In the far right panel select btn:[Find Animations].
  75. . After deciding on an animation, click the animation to have it applied to your model.
  76. . After the animation is applied to your model, toggle the btn:[In Place] checkbox if it's a moving animation.
  77. +
  78. [TIP]
  79. ====
  80. You can make small adjustments to the animation by using the sliders. The most common adjustment you will make is the `Character Arm-Space`. If you find the models hands are clipping through the model then use this slider to remedy the situation.
  81. ====
  82. . When satisfied with the animation, select the btn:[Download] button and follow the `Mixamo Download` instructions below.
  83. If you wish to add more animations, after the download, remove the animation by clicking on the btn:[X] button located next to the animations name. Add your new animation and when satisfied, download the new animation. Repeat as often as is necessary.
  84. == Mixamo Download
  85. When downloading `*Animations*` from Mixamo:
  86. . Make sure the btn:[In Place] checkbox is selected if it's a moving animation.
  87. . In the `Download Settings` dialog use the default settings.
  88. * Format = FBX
  89. * Skin = With Skin
  90. * Frames per second = 30
  91. * Keyframe Reduction = none
  92. . Click btn:[Download] and save it to your computer.
  93. When downloading `*Characters*` from Mixamo:
  94. . In the `Download Settings` dialog the `Format` is FBX and `Pose` is TPose.
  95. . Click btn:[Download] and save it to your computer.
  96. == Creating Blender Animations
  97. Download your TPose model using the instructions for downloading `*Characters*` given above. We will use it as our newly rigged model for Blender. To keep things organized we will create a `.blend` file for every animation and later use a separate `.blend` file to combine all animations into one jME3 compatible animation.
  98. The following steps apply to any animation you want to add in the future.
  99. . Start Blender if it is not already open.
  100. . In the `Info` header, at the top of the program, select `menu:File[New > Reload Startup]`.
  101. . Select the default cube and delete it.
  102. Scene Tab::
  103. * In the `Properties` panel, located at the bottom right, select the `Scene` tab.
  104. * In the `Units` panel, change the `Units of measure` to `Meters` and `Length` to `Metric`. You must *always* have these settings when importing from or exporting to Mixamo.
  105. +
  106. [TIP]
  107. ====
  108. You should create and save a default startup file in Blender. `menu:File[Save Startup File]`. This way you will not have to constantly redo things. Setting your `Units of measure` is the least you should do. You can always restore the default startup file by selecting `menu:File[Load Factory Settings]` at any time.
  109. ====
  110. . In the `Info` header, select `menu:File[Import > FBX]`.
  111. . Select the FBX file you downloaded earlier.
  112. . In the `Import Fbx` panel located at the bottom left of the import dialog, leave all settings at their defaults.
  113. Main::
  114. - Scale = 1
  115. - [x] Import Normals
  116. - [x] Import Animations
  117. - Armature offset = 1
  118. - [x] Image Search
  119. - Decal offset = 0
  120. - [x] Use pre/post rotation
  121. Armatures::
  122. - Nothing checked
  123. . When ready click btn:[Import FBX].
  124. . After Blender imports the file, both the armature and model are selected, in this order, select `menu:Object[Apply > Rotation]`. Repeat this for the `Location` and `Scale`. Alternatively, select the armature and model individually and repeat the process.
  125. . Select the Armature.
  126. . In the `Timeline`, determine the Length of the animation by btn:[RMB] selecting the last keyframe in the timeline. +
  127. Set `End:` to this value.
  128. . Click the btn:[|xref:] button to reset timeline back to the first frame.
  129. . In the `Info` header, change the `Default` screen layout to `Animation`.
  130. . In the `Dope Sheet Editor`, change the `Dope Sheet` mode/context to `Action Editor`. The `Linked Action` will now show the action name of the animation you imported.
  131. . Rename this to the name of the imported animation. In this instance it was TPose.
  132. .  Select the btn:[F] button to save the action.
  133. .  Save your file with the same name as the action.
  134. [NOTE]
  135. ====
  136. Mixamo sets the rotation mode of bones to `Quaternion` as is appropriate for preventing link:https://en.wikipedia.org/wiki/Gimbal_lock[`Gimbal Lock`]. Keep this in mind if you decide to modify your animation. Blender defaults to `XYZ Euler` so you will need to change this setting prior to inserting new keyframes.
  137. ====
  138. == Creating The Rigged Animation File
  139. It's good practice to have a separate file for combining animations. Things can go wrong, animations may change, and you don't want to destroy your original model file by accident. Our plan of attack has been we create a .blend file for every animation and then use this separate rigged file to combine them into one. To keep it simple we will use a copy of the first animation we downloaded and created a `.blend` file for.
  140. You create a rigged animation file only one time per model.
  141. . If you have closed the TPose.blend file, open it. In the `Info` header select `menu:File[Save As]` and save the file using the models name with the word `Rigged` added. This will be the only file we add animations to, for this model, from now on. It has our default TPose action which will allow us to start our animation track for `Ogre` animation exporting.
  142. . Select your `Armature`.
  143. Object Tab::
  144. .. In the `Properties` panel, navigate to the `Object` tab. In the `Display` panel toggle `X-Ray` on.
  145. . With your mouse inside the `3d Viewport`, press kbd:[Num Pad 1] followed by kbd:[Numpad 5].
  146. . kbd:[Tab] into `Edit Mode`.
  147. . Set the `3d Cursor` to the models origin.
  148. . Select `menu:Add[Single Bone]`.
  149. +
  150. [IMPORTANT]
  151. ====
  152. The models origin and the `Root` bone origin must be at the same location.
  153. ====
  154. . Scale the bone down or up as needed by selecting the `Tip` (ball at the narrowest part of the bone) and dragging the `Z` arrow (blue arrow) of the manipulator up or down until you are satisfied with its scale. *DO NOT CHANGE THE ANGLE OR MOVE THE BASE OF THE BONE FROM CENTER*.
  155. . When satisfied with the scale, select the body of the bone to select the entire bone.
  156. Bone Tab::
  157. .. In the `Properties` panel, navigate to the `Bone` tab.
  158. .. Rename the bone to `Root`.
  159. .. Deselect the `Deform` panel checkbox.
  160. . In the `3d Viewport`, select the body of the armatures `Hip` bone, the lowest bone in the center of the armature, to select the entire bone.
  161. . While holding kbd:[Shift] down, btn:[LMB] select the `Root` bone.
  162. . Press kbd:[Ctrl] + kbd:[P].
  163. . In the `Make Parent` dialog choose `Keep Offset`.
  164. . With the mouse inside the 3d Viewport, kbd:[Tab] out of `Edit Mode`.
  165. . Select your model.
  166. Data Tab::
  167. .. In the `Properties` panel, navigate to the `Data` tab and make sure the `Mesh` has the same name as your model.
  168. Material Tab::
  169. .. In the `Properties` panel, navigate to the `Material` tab and make sure there is one `Material` in the `Material List` and it is the same name as your model.
  170. .. In the `Transparency` panel, move the `Alpha` slider to 1.
  171. +
  172. [IMPORTANT]
  173. ====
  174. There appears to be a bug where the FBX importer adds an `Alpha` map texture to your model. If the `Alpha` slider is not at one, and you use the Blender importer of the SDK, or convert a .blend file, it will be transparent. `Ogre` export is unaffected.
  175. ====
  176. .. Deselect the checkbox of the `Transparency` panel.
  177. Texture Tab::
  178. .. In the `Properties` panel, navigate to the `Texture` tab, you will note that your texture has duplicate names in the `Texture List`. The bottom texture is actually a transparent `Alpha` texture and appears to be a bug. Select the *second* texture in the `*Texture List*` to highlight it.
  179. .. While holding down the kbd:[Shift] key, press the btn:[X] button next to the `*Texture Data Block*` to delete it.
  180. .. Select your remaining texture in the `Texture List` to highlight it. You will note the `Texture Data Block` is now red due to no texture being assigned.
  181. .. Click on the btn:[Browse Texture to be linked] button next to the `Texture Data Block` and select your texture.
  182. .. In the `Image` panel, click the btn:[Small Box] button located next to your texture's path to pack the image file.
  183. . In the `Info` header, change the layout from `Animation` to `UV Editing`.
  184. . With your mouse inside the `3d Viewport` and the model still selected, kbd:[Tab] into edit mode. If your model is not completely orange press kbd:[A] until all vertices are selected. You will see your UV Mapped mesh appear in the `UV Image Editor` window.
  185. . In the `UV Image Editor`, click the btn:[Browse Image to be linked] button and select your UV image.
  186. . kbd:[Tab] out of `Edit Mode`.
  187. . In the `Info` header, change the layout from `UV Editing` to `Default` and then click the btn:[+] button to create a new layout.
  188. . Rename this new layout `NLA Editing`.
  189. . Click the `Current Editor Type` button, located at the bottom left (small box) of the `3d Viewport`, and change it from `3d View` to `NLA Editor`. Our TPose action is now visible.
  190. +
  191. NOTE: If the action is not visible, navigate to the `Dope Sheet Editor` and from the `Action Editor` context, select the `Action`.
  192. . Click the icon:angle-double-down[] button to push the action down into the stack.
  193. . Beneath the TPose strip you will see a slider. Drag this slider to the right until your strip is nested up against the left margin of the window.
  194. . Save your file.
  195. == Export
  196. Your rigged file is now ready to export. Export your model using one of the <<ROOT:getting-started/features.adoc#supported-external-file-types,Supported External File Types>> of your choice.
  197. == Appending Blender Animations
  198. Follow the directions for <<mixamo-animations,custom Mixamo Animations>>, <<mixamo-download,Mixamo Download>>, <<creating-blender-animations,Creating Blender Animations>>, <<how-to/modeling/blender/blender.adoc#action-baking,Blender Action Baking>> and <<how-to/modeling/blender/blender_buffer_clearing.adoc#the-linked-action-buffer,Clearing The Linked Action Buffer>> for all animations you wish to append to your *rigged* animation file.
  199. . If your `Rigged` file is closed, open it.
  200. . From the `Info` header, change the Layout to `Default`.
  201. . In the `3d Viewport`, select the armature of the model.
  202. . From the `Info` header, select `menu:File[Append]`.
  203. . Navigate to, and select the `.blend` animation file you want to append.
  204. . From the folders list select the `Action` folder, followed by your action.
  205. . When ready, select the btn:[Append From Library] button to finalize your selection.
  206. . From the `Info` header, change your layout to `Animation`.
  207. . In the `Dope Sheet Editor`, change the context to `Action Editor` if not already selected.
  208. . Click the btn:[Action to be linked] button and select your append action from the list.
  209. . Select the btn:[F] button to save the action.
  210. . From the `Info` header, change the layout from `Animation` to the `NLA Editing` layout we created in the <<creating-the-rigged-animation-file,Creating The Rigged Animation File>> section of this tutorial. You will see your append `Action` at the top of the list.
  211. . From the `NLA Editor` header, select `menu:Add[Add Tracks]`. A new track has now been added to the top of the list.
  212. . Click the icon:angle-double-down[] button next to the `Action` to push it down into the stack.
  213. . btn:[LMB] select the strip to make it the only strip selected.
  214. . btn:[LMB] drag the selected strip to the right until there is at least a 4 keyframe gap between the furthest strip to the right in the list and the append strip you are dragging.
  215. +
  216. [TIP]
  217. ====
  218. When the strip is in drag mode it will be purple. While in drag mode you do not need to keep the btn:[LMB] pressed.
  219. ====
  220. . When you are satisfied with the position, btn:[LMB] click the strip to finalize your selection. Your append strip should now be the furthest strip to the right in the list.
  221. +
  222. [TIP]
  223. ====
  224. You can use the mouse scroll wheel to shrink or expand the strip window to bring all strips into the view.
  225. You can drag the slider, at the bottom of the strip window, to the right or left to position the strips against the side of the window.
  226. ====
  227. . With the mouse inside the strip window, press the kbd:[N] key to open the properties window.
  228. . In the `Active Strip` panel, under `Strip Extents`, you will see the `End Frame` number. In the `Timeline`, set `End:` to this number. Every time you append an `Action` you must increase this number to equal the total length off all strips combined, including the gaps between strips.
  229. . Save your file.
  230. Your file is now ready to xref:jme3/advanced/mixamo#export,export].
  231. [IMPORTANT]
  232. ====
  233. Prior to export:
  234. In the `NLA Editor` make sure no `Actions` are waiting to be pushed down into the stack. If there are, it must be removed or made into a strip prior to export.
  235. In the `Dope Sheet Editor` make sure no `Actions` are selected in the `Action Editor` context. If one is selected, it will be sitting at the top of the `NLA Editor` stack.
  236. An `Action` that has not been pushed down into the `NLA Stack` will block your `NLA Strip` from playing.
  237. Some export methods bake your actions automatically on export, others don't. Test the animation in-game and if your animations are all messed up, try <<how-to/modeling/blender/blender.adoc#action-baking,baking them>> or use a different exporter.
  238. ====
  239. Your NLA strip should look something like this:
  240. image::how-to/modeling/blender/MixamoNLA.png[MixamoNLA.png,width="",height=""]
  241. == Notes
  242. * See xref:tutorials:beginner/hello_animation.adoc[Hello Animation] and xref:core:animation/animation.adoc[Animation in JME3] to learn how to use your animated model.