{"id":8522,"date":"2024-03-10T15:37:31","date_gmt":"2024-03-10T15:37:31","guid":{"rendered":"https:\/\/www.katsbits.com\/codex\/?p=8522"},"modified":"2024-03-10T15:37:31","modified_gmt":"2024-03-10T15:37:31","slug":"rig-animate-game-asset","status":"publish","type":"post","link":"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/","title":{"rendered":"Rig &#038; Animate a Game Asset (Gate\/Door)"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a0902fd6f59f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a0902fd6f59f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#description\" >Description<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#origin-as-pivot\" >Origin as Pivot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#grid-centre\" >Grid Centre<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#armature-bone\" >Armature &#038; Bone<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#vertex-groups\" >Vertex Groups<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#auto-keying-insert\" >Auto Keying (Insert)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.katsbits.com\/codex\/rig-animate-game-asset\/#timestamps\" >Timestamps<\/a><\/li><\/ul><\/nav><\/div>\n<div style=\"background-color: black; position: relative; padding-bottom: 56.25%; padding-top: 25px; height: 0; overflow: hidden; max-width: 100%;\"><center><iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" src=\"https:\/\/www.youtube.com\/embed\/FICsSPsBVIg?rel=0\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center><\/div>\n<h3><span class=\"ez-toc-section\" id=\"description\"><\/span>Description<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In this exercise we take a look at animating a simple medieval style gate in Blender using an Armature to rig and animate the object with a focus on what needs to be kept in mind when doing so. First, the object has to be prepped for animation so it pivots or rotates correctly around its origin and, optionally, edited to prevent gaps and wholes that might occur when animated. An Armature is then added and various bones extruded to set up a skeletal hierarchy that controls the mesh using Vertex Groups before everything is then animated in the <strong>Action Editor<\/strong>.<\/p>\n<blockquote><p><strong>Design note<\/strong>: some additional considerations to keep in mind for simple animated objects that don&#8217;t deform, i.e. &#8216;furniture&#8217;, environment assets and so on;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"origin-as-pivot\"><\/span>Origin as Pivot<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>As a general rule of thumb, when prepping a mesh for animation, preference should be given to positioning objects [1] relative to their Origin point [2]. While this is not crucial &#8211; <em>the location, rotation and scaling of objects, how they move or deform, is relative to bone influence<\/em> &#8211; it can be helpful with workflow if both Mesh Origin and Armature Origin both match. <a href=\"https:\/\/www.katsbits.com\/codex\/origin\/\">Adjusting or modifying an objects Origin<\/a> can be done in <strong>Edit Mode<\/strong> [3] or <strong>Object Mode<\/strong> by moving everything relative to the <strong>Origin<\/strong> [4], or moving the Origin relative to the object.<\/p>\n<div style=\"background-color: #eeeeea; color: #000; width:98.5%; padding: 1.0em;\">For more on repositioning, adjusting or correcting the location of a mesh relative to its Origin, or adjusting the Origin relative to the mesh, see &#8220;<a href=\"https:\/\/www.katsbits.com\/codex\/origin\/\">(Re)Set Origin<\/a>&#8220;.<\/div>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/object-origin-prep.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/object-origin-prep.jpg\" alt=\"Object position relative to Origin\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Gate shown with mesh &#8216;incorrectly&#8217; positioned [1] relative to the objects Origin [2]. To aid rigging and animation, especially where something pivots or rotates around a fixed point, objects should be positioned relative to their Origins.<\/i><\/p>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/object-origin-edit-mode.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/object-origin-edit-mode.jpg\" alt=\"Editing object Origin\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Changing the object in <strong>Edit Mode<\/strong> [3] by moving the entire mesh into position relative to the <strong>Origin<\/strong> [4], which aligns the object with the pivot point.<\/i><\/p>\n<h4><span class=\"ez-toc-section\" id=\"grid-centre\"><\/span>Grid Centre<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Unless objects are to be animated in situ, positioned as part of a larger scene, they should be located at grid centre &#8211;  <strong>X: 0.000<\/strong>, <strong>Y: 0.000<\/strong>, <strong>Z: 0.000<\/strong> (<strong>0,0,0<\/strong>) [5]. Generally, this is done to prevent an offset being saved to the project file during export that may be, inadvertently, used when imported in to other sources. <em>This should be done before rigging with Armature and animating<\/em>. To do this, with object selected, in the <strong>Item<\/strong> [6] tab of the <strong>Sidebar<\/strong> (<span class=\"shortcutkey\">N<\/span>), zero-out the <strong>X<\/strong>, <strong>Y<\/strong> and <strong>Z<\/strong> values under <strong>Location<\/strong>, or similarly in <strong>Object Properties<\/strong> [7].<\/p>\n<div style=\"background-color: #eeeeea; color: #000; width:98.5%; padding: 1.0em;\">Object location is defined relative to the selected objects <strong>Origin<\/strong> so a mesh may appear offset even though it&#8217;s correctly placed relative to the grid. In practice, make sure mesh and object Origin are properly positioned with respect to each other.<\/div>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/object-location.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/object-location.jpg\" alt=\"Object location\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>To avoid problems when animating, and on import into other sources, it&#8217;s best to position objects relative to grid centre [5]. This can be done using XYZ <strong>Location<\/strong> data in the <strong>Sidebar<\/strong> [6] or similarly <strong>Object Properties<\/strong> [7].<\/i><\/p>\n<h4><span class=\"ez-toc-section\" id=\"armature-bone\"><\/span>Armature &#038; Bone<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>When adding an Armature to a scene Blender defaults to placing them at the location of the <strong>3D Cursor<\/strong>. With this in mind, if mesh or Armature needs to be moved or realignment with respect to each other, this should be done before completing the rig or animating to avoid issues. With this in mind, <a href=\"https:\/\/www.katsbits.com\/codex\/origin\/\">move the 3D Cursor<\/a> to where it needs to be [9], typically <a href=\"https:\/\/www.katsbits.com\/codex\/snap\/\">snapped to the selected object<\/a>, and once placed &#8211; <strong>Add \u00bb Armature<\/strong> [8] &#8211; use the transform tools, Move and Rotate in particular, to position the Armature [10] relative to the mesh, or move the mesh relative to the Armature.<\/p>\n<div style=\"background-color: #fc0; color: #000; width:98.5%; padding: 1.0em;\"><strong>Important<\/strong>: an objects Origin defines where objects are located, rotated or scaled in relation to 3D space and grid centres &#8211; all coordinate systems have a 0,0,0 grid centre. Origins also determine how objects generally are positioned relative to each other.<\/div>\n<div style=\"background-color: #eeeeea; color: #000; width:98.5%; padding: 1.0em; margin-top:1em;\">When moving objects, meshes or Armatures, ensure this is done while in <strong>Object Mode<\/strong> unless repositioning the selection relative to its own Origin.<\/div>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/armature-location.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/armature-location.jpg\" alt=\"Armature location\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Blender positions Armatures at the 3D Cursors location, so once added [8] it may need to be moved [9] to align with the object its going to animate [10], e.g. at grid centre.<\/i><\/p>\n<h4><span class=\"ez-toc-section\" id=\"vertex-groups\"><\/span>Vertex Groups<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Where an Armature and its bones are the mechanism of control, <strong>Vertex Groups<\/strong> are the link between the two. Here, naming and labels are critical as they need to correspond with bone names to create the association needed for the Armature know what part of the mesh each bone is supposed to articulate [11]. To this end the default name &#8220;<strong>Group<\/strong>[.n]&#8221; can be changed in <strong>Object Data Properties<\/strong> by changing the label in the <strong>Vertex Groups<\/strong> list [12]. To do this double-click an entry and type. Alternatively, in the <strong>Outliner<\/strong> select the mesh and under the Vertex Groups subheading [13] similarly double-click an entry and type.<\/p>\n<div style=\"background-color: #fc0; color: #000; width:98.5%; padding: 1.0em;\"><strong>Important<\/strong>: because Vertex Groups create the link between mesh and bone, labelling needs to match <em><strong>exactly<\/strong><\/em>, &#8220;<strong><em>h<\/em>andle<\/strong>&#8221; is not the same as &#8220;<strong><em>H<\/em>andle<\/strong>&#8220;.<\/div>\n<div style=\"background-color: #eeeeea; color: #000; width:98.5%; padding: 1.0em; margin-top:1em;\">There a number of ways to &#8216;rig&#8217;, that is match the mesh to bones in the Armature. For example, while selected areas can be manually assigned to different <strong>Vertex Groups<\/strong> in <strong>Edit Mode<\/strong>, the same can be done using <strong>Envelopes<\/strong> when <strong>Parenting<\/strong>, or using <strong>Weight Paint<\/strong> mode to paint bone influence as colour.<\/div>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/vertex-group-names.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/vertex-group-names.jpg\" alt=\"Vertex Groups names\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Meshes are controlled by bones [11], which are linked using Vertex Groups. It&#8217;s crucial therefore, to ensure corresponding groups and bones match names or labels, which can be changed in <strong>Object Data Properties<\/strong> [12] or the <strong>Outliner<\/strong> [13].<\/i><\/p>\n<h4><span class=\"ez-toc-section\" id=\"auto-keying-insert\"><\/span>Auto Keying (Insert)<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Keyframes generally have to be manually placed in the timeline using <strong>Insert<\/strong> (<span class=\"shortcutkey\">I<\/span>), which can be repetitious for long or complex sequences. To alleviate this Blender can be set to insert keyframes automatically whenever it detects a bone or object has been moved or manipulated in some way. This is done using <strong>Auto Keying<\/strong>, which drops a keyframe or pose marker into the timeline that saves all, or specific, types of coordinates data, typically <strong>Location &#038; Rotation<\/strong> (LocRot) or <strong>Location, Rotation &#038; Scale<\/strong> (LocRotScale). <\/p>\n<div style=\"background-color: #fc0; color: #000; width:98.5%; padding: 1.0em;\"><strong>Important<\/strong>: the <em>Auto Keying<\/em> and <em>playback<\/em> buttons (transport controls) are only accessible from the main <strong>Timeline<\/strong> editor Header.<\/div>\n<p>To enable, in the main Timeline editor click the <em>record<\/em> or <strong>Auto Keying<\/strong> [14] button in the Header, then in the <strong>Keying<\/strong> menu [15] set the <strong>Keying Type<\/strong>, the <em>type of data<\/em> saved to the timeline, by clicking the <strong>Active Keying Set<\/strong> input field [16] and selecting an option from the list, e.g. <strong>Location &#038; Rotation<\/strong> to store linear and rotational movement &#8211; Keying \u00bb [Keying Type] \u00bb [option]. Switch back to the <strong>Action Editor<\/strong> and pose the Armature, with Auto Keying enabled any bone poses will be automatically marked in the timeline at the scrubbers location.<\/p>\n<div style=\"background-color: #eeeeea; color: #000; width:98.5%; padding: 1.0em;\">Playback functions can be activated from within other editors using the following shortcut keys;<\/p>\n<p><strong>Windows OS<\/strong><br \/>\n<span class=\"shortcutkey\">Space<\/span> &#8211; Start\/Stop<br \/>\n<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">Ctrl<\/span> + <span class=\"shortcutkey\">Space<\/span> &#8211; Play Reverse<br \/>\n<span class=\"shortcutkey\">Up Arrow<\/span> (<span class=\"shortcutkey\">\u2191<\/span>) &#8211; Next Keyframe<br \/>\n<span class=\"shortcutkey\">Down Arrow<\/span> (<span class=\"shortcutkey\">\u2193<\/span>) &#8211; Previous Keyframe<br \/>\n<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">Left Arrow<\/span> (<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">\u2190<\/span>) &#8211; Jump to Start<br \/>\n<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">Right Arrow<\/span> (<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">\u2192<\/span>) &#8211; Jump to End<\/p>\n<p><strong>MacOS<\/strong><br \/>\n<span class=\"shortcutkey\">Space<\/span> &#8211; Start\/Stop<br \/>\n<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">Command<\/span> + <span class=\"shortcutkey\">Space<\/span> (<span class=\"shortcutkey\">\u21e7<\/span> + <span class=\"shortcutkey\">\u2318<\/span> + <span class=\"shortcutkey\">Space<\/span>) &#8211; Play Reverse<br \/>\n<span class=\"shortcutkey\">Up Arrow<\/span> (<span class=\"shortcutkey\">\u2191<\/span>) &#8211; Next Keyframe<br \/>\n<span class=\"shortcutkey\">Down Arrow<\/span> (<span class=\"shortcutkey\">\u2193<\/span>) &#8211; Previous Keyframe<br \/>\n<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">Left Arrow<\/span> (<span class=\"shortcutkey\">\u21e7<\/span> + <span class=\"shortcutkey\">\u2190<\/span>) &#8211; Jump to Start<br \/>\n<span class=\"shortcutkey\">Shift<\/span> + <span class=\"shortcutkey\">Right Arrow<\/span> (<span class=\"shortcutkey\">\u21e7<\/span> + <span class=\"shortcutkey\">\u2192<\/span>) &#8211; Jump to End\n<\/div>\n<p><a href=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/timeline-keying-set.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 98.5%; height: auto;\" src=\"https:\/\/www.katsbits.com\/images\/tutorials\/animation\/timeline-keying-set.jpg\" alt=\"[descriptive alt image text here]\" width=\"900px\" height=\"500px\" border=\"0\" \/><\/a><br \/>\n<i>Enabling <strong>Auto Keying<\/strong> [14] will automatically save bone data to the Timeline. This can be set [15] to save a specific data &#8216;set&#8217; [16], typically <strong>Location, Rotation &#038; Scale<\/strong>.<\/i><\/p><\/blockquote>\n<h3><span class=\"ez-toc-section\" id=\"timestamps\"><\/span>Timestamps<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Times are approximate;<br \/>\n&#8211; 00:00 : Overview &#038; Object Setup<br \/>\n&#8211; 04:30 : Armature &#038; Rig Setup<br \/>\n&#8211; 13:00 : Mesh Setup &#038; Vertex Groups<br \/>\n&#8211; 22:00 : Mesh Adjustments<br \/>\n&#8211; 36:30 : Action Editor &#038; Animation<br \/>\n&#8211; 51:30 : Summery<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":8584,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,230],"tags":[217,622,725,974,726,1076,852,536,411,761,766,685],"class_list":["post-8522","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blender","category-tutorials","tag-action-editor","tag-animation","tag-armature","tag-auto-keying","tag-bones","tag-envelopes","tag-game-assets","tag-origin","tag-pivot","tag-rigging","tag-skeletal-animation","tag-vertex-groups"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts\/8522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/comments?post=8522"}],"version-history":[{"count":68,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts\/8522\/revisions"}],"predecessor-version":[{"id":8595,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/posts\/8522\/revisions\/8595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/media\/8584"}],"wp:attachment":[{"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/media?parent=8522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/categories?post=8522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.katsbits.com\/codex\/wp-json\/wp\/v2\/tags?post=8522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}