Unity3d 2D bone animation plug-in Puppet2D use 2, unity3dpuppet2d

Source: Internet
Author: User

Unity3d 2D bone animation plug-in Puppet2D use 2, unity3dpuppet2d

Hello everyone, I am Sun Guangdong. Reprinted please indicate the source: http://blog.csdn.net/u010019717

More comprehensive content please see my game pretty cool address: http://www.unitymanual.com/forum.php? Mod = guide & view = my

Introduction:

Puppet2D is a tool that allows you to quickly set your 2D role animation. With this tool, you can create 2D bones, skin the bones of your characters, and create controls that are really easy to use to make the animated role a breeze.

To open the Puppet2D Window, select the Puppet2D menu and go to Window> Puppet2DWindow. This window contains all the creation tools.

To start creating your manipulated items, prepare your role to be "rigged ". Enter the scene view in unity and click the 2D button at the top of the view. Drag in your 2D role Genie and place it in the locked layer. This is useful so you don't end up accidentally clicking it when you try to draw a bone or control it. Now you are ready to start creating the skeleton.

Bone & Control Layers and scale: s

You can change the size of the Puppet2D window on the top of the control and bone. You can also specify the sorting bone to create the next layer. Once they have been created, make sure that you set this at the beginning of your skeleton and control before the creation, which will not change their layers.

Skeleton:

BoneCreation:

The skeleton is the pivot that will control how your little puppet moves.

To Create a Bone, click Create Bone Tool. This will set your bone creation mode.

You will stay in this mode until you press input or click "Finish Bone.

Use the left mouse button in the 2D view to start drawing the bones. Each Skeleton goes to the parent level no matter you choose.

Create Bone Tool button ------ start creating a skeleton

Left mouse click ------ drawn bones

Backspace key ------ Delete selected skeleton

Hold down shift key ------ move selected skeleton only

Hold down the ctrl key ------ move the selected skeleton and its child

Alt click the left mouse button ------ insert bone between the selected skeleton and its child

Right click ------ cancel selecting skeleton

Press enter/click "Finish Bone" ----------- to Finish the created Bone.

SplineCreation:

This is a special manifestation of the bone chain of a beiser curve. When you draw a widget instead of a bone, it is created in a different way than a normal bone.

To create a bone, click "CreateSpline Tool. This will set you in the spline creation mode. You will stay in this mode until you press input or click Finish Spline. At this point, we also need to wait for the bones.

Start to use the left mouse button in the 2D view, and you will start to draw the SplineControls.

You can use the slider to specify the number of bones made between each control. Start this tool before setting this.

Left mouse click ----------- draw Control

Hold Shift or Ctr ---------- mobile control

Press enter or click "Finish sample" ----------- to complete the creation of the spline control in.

RiggingSetup:

Although it may only show your role by directly rotating the joint animation, it may be tricky to perform animation processing, especially when it comes to keeping your feet on the ground. Using Puppet2D to create custom controls is a very fast process for your role, and it makes animation processing more intuitive and easier.

Global Control

When you create a control for the first time, you will see that gloabl_ctrl is also created in the hierarchy. This is the basis for execution from the scripts of all controls. Disabling this script disables all controls. You will want to add your animation to this game object, move it, and move your role.

Start Rotation Y-allow you to change the y axis plane of your role

IK handles-All Ik handles of this role (in execution order)

Parent Controls-all the Parent & Orient for this character (in execution order)

Control Visibility-Turns controlsvisibility, enable and disable

Bones Visibility-this will switch the Visibility of all the Bones, the parent level of global_Ctrl (Make sure you press the refresh button of your parent bone for the first time)

Combine Meshes-This combines all the grids that share a texture (so a draw call once) into a grid

Flip-use this to flipthe character in the x-axis

Auto Refresh-auto orders the executionorder of the controls

Refresh Global Control-click this whenyou change something in the rig-such as delete a control or change thehierarchy in some way.

You can use the flip check box to flip a role on the x axis.

IKControls (IK Control)

Is the control you need for any of your character's limbs (IE arm or leg. This gives you a single-ended control where you can use animations to show their limbs. This will mean your feet will stay on the ground when you move its body.

To Create an IK Control, select the end of the three bone chains and click "Create IK Control. For example, if you have a leg bone, such as thighBone> kneeBone> footBone. Select and click the button

You can click the "flip" check box in the checker to flip the knee "flip" face. This can also be used for animation processing.

If you think you can have "stretchy limbs" by clicking the "Squash and Stretch" check box.

Parent & Orient Controls

One problem with direct animation of bones is that they started from awkward rotations and positions. This means that you cannot quickly reset them through zero-bit adjustment. Puppet2D allows you to create controls to easily select and start at zero position and rotate, so you can easily reset them. The position and rotation affected by the Parents control, while the orient control only rotates.

To Create a parent Control, select a bone, Control it, and click Create Parent Control"

To Create an orient Control, select a bone, Control it, and click Create Orient Control"

By moving the slider to the desired scale, you can adjust the widget size in your scenario.

In the rigging installer at the bottom of the drop-down menu, you can select which sort layers to put the control on. It is a good idea to have a "Control" Sort layer so you can intuitively look at characters and bones.

Skinning

There are three ways to get the bone to affect your genie; by parenting, parenting, or FFD.

Parenting

You can manually parent the bones of your genie, but there is a button to speed up the Puppet2D job for all the objects you have ever been. Select all bones and all genie or objects, and click "Parent Object to bones ".. This will parent all objects of your closest bone.

Skinning

Skinning allows a single object to receive more than one bone. To do this, the genie needs to be converted to a grid.

To do this, select your genie (make sure it has no parent level) and click "Convert Sprite To Mesh ". You can choose how to segment the grid you want from the "Typeof Mesh" drop-down menu.

You can add a polygon2Dcollider component to the number of vertices in the sprite's changed mesh for the first time. You can use this to delete and add vertices that have previously been converted to a grid.

To Bind the mesh to the bone, select all the bones and skins, and click Bind Smooth Skin ".. You can select the number of Bones that you want to bind to the default Skin using the "num Skin Bones" drop-down menu. Your mesh should now have a skin mesh Renderer component for it .~ If you move the skeleton mesh, it should move accordingly.

To draw skin Weights, select your grid and click "PaintSkin Weights ".. Now, you can select the desired bone to draw the strength of each bone on the mesh vertex, and click the left mouse button to draw the weight of the bone.

You can use the slider to change the size and intensity of the paint brush or hold the size of the paint brush B and the intensity of N.

Left Click-Add Weights

Hold ALT-Subtract weights

Hold SHIFT-Smooth Weights

Hold B-change brush size

Hold N-Change brush strength

Click Finish Edit Skin Weights to complete painting weight.

You can also manually edit the skin weight by clicking the EditSkin Weights button. You will see a bunch of vertices from the parent level to the grid. If you choose the vertex that you will see the impact of the skeleton, then the vertex of their weight list. To edit the weight or impact, you only need to change the value in the checker. If you want to change multiple vertices once, change the value and click the "Update Skin Weights" button in the checker.

Click Finish Edit Skin Weights and the vertex is deleted.

By moving the slider to the desired scale, you can adjust the vertexHandles size in your scenario.

FFD

This is the most flexible method, because it allows you to deform the role. And its bones.

To create an FFD, select your genie and click "CreateFFD Tool ".. You can now draw on your character FFD. First, you should start to bind the nodes around the role. Then, you can add any internal parts if you need it. Click "Finish FFD" to create the new FFD Mesh.

Create FFD Tool-start creating FFDControls

Left Click-draw FFD Controls

Hold Shift or Ctrl-move selected FFDControl

Right Click-Close Current FFD loop andstart creating a new loop

Press Enter/Click "Finish FFD"-Finishescreating FFD

You can parent them or skin them to obtain the dynamic bones of the FFD control. (Basically you can treat them as if they are a grid .)

FFD Parenting

Parent they select the FFD control and the bone, and then click "ParentObject to bones" -- the FFD parent splits the parent bone.

FFD Skinning

To peel them apart, select the FFD control and bone, and then click "BindSmooth Skin ". You can also set the peel value to 1 or 2 (do not use 4 (FFD), which requires another function ).

Using the FFD on another Mesh

You can also embed it into other grids of the same FFD. To do this, you need to set the Num skin skeleton to 4 (FFD ). Make sure that the new mesh falls on FFD. Select the FFD control and grid, and click Bind Smooth Skin ".

You must be aware that in order to make this work, you need to create the original mesh with the FFD visible. You should skin the surroundings for the future.

Animation:

To start an animation, you only need to create an animation clip on global_Ctrl. You can move/zoom the rotation control and set the key frame in the animation window.

If you want to optimize the animation script by removing all controls-you can bakes to the skeleton animation.

To use bake animation and global_ctrls animation that you want to use bake, open a scene. Click bake Animation ------ this will make all your animations and the Puppet2d> Animation> Baked folder in the repeated bake. These will be used as key frame animations on the bones rather than controls. You will also note that your Puppet2d will disable the globalCtrl script. Now you can add a thesis animation to your animation controller and they can replace all the control animations.

You can use the rendering animation and the rendered Alpha to make your animation a png sequence. You can use the background of alpha and composite in the external editing package.

Help animation you can save the pose and load them.

To Save the Selection, select the items in your scenario and click Save Selection "..

To load, right-click a Server Load balancer and hover over Select Objects ".

Right-click the delete slot and select "Remove Selection"

Add to Server Load balancer, select what you want to add, and then select "APPEND selection"

Load "Load Pose" and click

Save "Save Pose" and click


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.