Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 535

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 544

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 960

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 980

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 992

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 1003

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 199

Deprecated: Creation of dynamic property Automattic\Jetpack\Connection\Manager::$error_handler is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-manager.php on line 91

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Instagram_Gallery::$is_wpcom is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-instagram-gallery.php on line 23

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Mailchimp::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php on line 17

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Tweetstorm_Gather::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-tweetstorm-gather.php on line 21

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Tweetstorm_Gather::$is_wpcom is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-tweetstorm-gather.php on line 22

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Gutenberg_Available_Extensions::$wpcom_is_site_specific_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/gutenberg-available-extensions.php on line 20

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Memberships::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php on line 23

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Memberships::$wpcom_is_site_specific_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php on line 24

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Subscribers::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/subscribers.php on line 15

Deprecated: Creation of dynamic property Automattic\Jetpack\Sync\Queue::$random_int is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 38

Deprecated: Creation of dynamic property Automattic\Jetpack\Sync\Queue::$random_int is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 38

Deprecated: Creation of dynamic property WPCOM_Widget_Goodreads::$shelves is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/modules/widgets/goodreads.php on line 33

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/twodee/blog/wp-includes/script-loader.php on line 348

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_classic_block is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 347

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 349

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block_side is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 350

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$panels_block is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 351

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$used_block_buttons is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 354

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198
» CS 491 Lecture 20 – Armature Animations

teaching machines

CS 491 Lecture 20 – Armature Animations

April 14, 2016 by . Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
gamedev3, lectures, spring 2016.


Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 3030

Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/class.jetpack.php on line 4255

Deprecated: Creation of dynamic property Jetpack_Carousel::$localize_strings is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.php on line 339

TODO

Lab

Today we’re going to animate a model that has been parented to or rigged with an armature. Our once inflexible models will at last be able to bend and contort!

If you finished your alien model, feel free to use it. Otherwise, I have made mine available.

Create a Unity project and drop your alien file (perhaps a copy) in its Assets directory. Double-click on it in Unity to open it in Blender. We want to make sure we’re editing the file that Unity is reading.

Goal

Creating step-by-step walkthroughs with images is a someday goal for this class. Before I can do that, I need more time and experience. In the meantime, here’s a snapshot of my armature:

Screen Shot 2016-04-14 at 9.07.46 AM

I’m not an experienced animator, so I probably have done a lot of terrible things from a professional’s viewpoint. But it gets the job done!

Pelvis

In Object Mode, hit Shift-A to add an Armature / Single Bone. As the first bone, it becomes the “root” bone that will be a parent to all others. If this bone moves, so do all the others. Typically the root bone is placed somewhere near a figure’s pelvis. We’ll move it in a second.

First, the bone is a little hard to see when its inside a model. Let’s turn on our x-ray vision. In the Properties panel, click on the figure in a T-pose to see the armature properties. Under Display, click X-Ray. The armature will no longer appear behind other geometry.

Now, click tab to go into Edit Mode. Click on the octahedron (called the body) between the endpoints to select the entire bone and translate it so that the wider end (the head) just appears outside the alien’s tail end. Select the narrow tip (the tail) and rotate it around the x-axis so that the bone is horizontal.

Name this bone Pelvis. You can do this in the bone properties. Get there by clicking on the button in the Properties panel with a bone icon.

Body

The rest of the armature will be an extrusion of the pelvis. In a side view, click on the narrow tail end of the pelvis. Hit E to extrude and drag the new bone’s head to right behind the mouth. Our goal when designing an armature is to span bones between joints of our model. If we want the mouth to open and close, we’ll need a joint just behind it with two bones branching at the joint for the upper and lower jaw.

Rename this bone Body.

Select the narrow tail of the Body bone. Extrude once to form the lower jaw. Name the bone Lower Jaw. Select the tail of Body again. Extrude for the upper jaw. Name the bone Upper Jaw.

View the armature from above. All these bones should be exactly centered on the x-axis. Fix any that aren’t.

Eyes

Now let’s add some bones for the limbs of our alien. This particular alien is symmetric (not all are), so we will save ourselves some effort by only creating bones on one side. I’m going to arbitrarily assume all work is done on the left side.

We’ll start by adding two bones to the eye “limb.” Click on the Body’s tail end. Extrude to the sharp bend in the eye stalk. Name the bone Stalk.L. If you’re working on the right side, name it Stalk.R. The L or R at the end is important for the mirroring that we will do later.

Extrude from the stalk to the eyeball. Name the bone Eye.L.

With the way the stalk is parented to the body, when the stalk bends, some of the body will bend with it. But we’d really like just the stalk to move. We need to “loosen” up the connection of the stalk bone to the body bone. Select the stalk bone and in the bone properties panel, uncheck Connected. Translate the stalk’s head on all three axes to where the stalk joins the alien’s body. Check its placement from all views.

Legs

In a side view, select the pelvis’ tail. Extrude to the alien’s knee. Name the bone Thigh.L. Extrude to the ankle. Name the bone Shin.L. Extrude to the toes. Name the bone Foot.L. (You may want two bones, one for each toe.)

Disconnect the thigh from the the pelvis and move the thigh head to where the thigh joins the alien’s body.

Mirroring

Now it’s time to generate the bones on the opposing side of the model. We will duplicate the left bones and mirror them. This isn’t nearly as automatic as the mirror modifier for geometry, probably because we usually want the bones to operate independently when we pose them.

First, we must establish the mirroring pivot point. Center the 3D cursor with Shift-S. In the 3D editor’s toolbar, change the pivot point to 3D cursor.

Select all the *.L bones, but none of the centered bones. Duplicate them with Shift-D. Move the mouse to affirm that you do indeed have duplicates, but hit Escape to restore their location so that they exactly overlap the source bones. Before doing anything else and losing your selection, select Mirror / X Global in the Armature menu.

With the right bones still selected, select Armature / Flip Names. This will rename all bones ending in .L so that they end in .R.

Let’s establish a link between the left and right bones. In the tools panel on the left, click on the Options tab. Check X-Axis Mirror. If you modify a .L bone in Edit Mode, it will automatically adjust the corresponding .R bone, and vice versa.

Parent

Switch to Object Mode. Select the alien model first. Then select the armature. Hit Control-P to parent the armature to the model with Automatic Weights. Now when you move a bone in Pose Mode, the surrounding geometry will move with it!

Idle

Let’s make an idle animation now. We’ll use the three-key sandwich approach.

With only the armature selected, head into Pose Mode. On the timeline, set the end frame to something like 96. (Most animations run at 24 frames per second by default. This means one cycle of our idle animation will take 4 seconds. Feel free to alter the speed if this feels too slow.)

Switch the timeline to the dope sheet. Switch the toolbar to show the Action Editor tools. Add a new animation and name it Idle. Click F to add a fake reference so that Blender doesn’t garbage collect it. Scrub to frame 1.

Grab the pelvis bone and translate it so that the alien’s feet rest on the origin. The rest of the alien should follow along with it given the way the bones are parented.

Set the pivot point to from 3D Cursor to Median Point. Now rotate various bones to make the alien feel like its shifting around in boredom. Maybe move an eye. Twist the body. Lift the tail. Close the mouth. Take creative license.

To confine the rotation to be around a particular axis, operate in a view along one of the cardinal axes, use the rotation transform manipulator, or use sequences like rx or rz.

Once you’re satisfied with the alien’s idleness at this frame, select all the bones with A. (Don’t forget this step.) Hit I to insert a Visual LocRot keyframe.

Scrub to frame 97 and insert an identical keyframe.

Scrub to frame 48. Manually invert the rotations that you applied in the surrounding keyframes. Once you’re satisfied, select all the bones and insert another keyframe.

Hit Alt-A or Option-A in the 3D editor to check your animation. Adjust and re-record as needed. Make sure you’re still in the Idle animation clip.

Importing into Unity

Save and head back to Unity. Does the Idle animation appear in the model’s import settings in the Inspector? Hopefully. Make sure it’s set to loop. Drag the alien into the scene.

Create an Alien Animator Controller asset and drop it onto the alien game object. Double-click on the animator controller and drop the Idle animation clip into the state machine.

Playtest. Does the alien play it’s idle animation?

Death

Back in Blender create another animation clip of the alien dying. You can reset the bone poses by selecting all in Pose Mode and hitting Alt-R or Option-R to reset the rotations. (Alt-G or Opt-G will reset their locations, which you don’t want to do to the pelvis. We intentionally moved it so that the feet were at the origin.) What body theatrics might you employ? Record keyframes to portray an agonizing demise.

Test it back in Unity. Add the clip to the state machine and create a trigger parameter that transitions to it.

Playtest. When you invoke the trigger through the state machine, does the alien die?