In game development with Unity, sprites can be edited with 2D animation packages. This allows 3D models to be created for animations.
"Rigging" sprites with the 2D animation pack
You can find the 2D animation package under Window -> Package Manager -> 2D animation
Then select the sprite and open the Sprite Editor in the Inspector window. You can choose the Skinning Editor from the drop-down menu.
The skinning editor enables the construction of a skeleton. This is called a “rig”. The sprite is bound to this. The process is called “rigging”. The sprite is like a skin, which is how the Skinning Editor got its name. The Skinning Editor is part of the Sprite Editor. The Skinning Editor consists of three control groups:
Bones
Geometry
Weights
The automatic options must always be confirmed with "Generate" so that they can be generated for the sprite.
Bones
Preview Pose: It allows bones to be moved and routed to see which pose or animation the rigging effect will result. You can join, separate, and reset the bones. The changes are not permanent and only active during the preview. The bones can be made visible with a double click.
You can also mark selected bones by holding down the left mouse button and dragging the rectangle around the bones you need for editing. You have to go along with every change Apply take over.
For example, if you build a new bone and add geometry and weight, you can animate the figure.
Edit bone: The option allows moving, undoing, removing connections or restoring the bones.
- To move bones without breaking the connection, click on them and drag the connection tip to the destination
- To separate one bone from another, click on the bone and pull it away
CreateBone: You can create bones. When you switch from one tool to the other, a bone is a "child" of the connection of another bone. A new superordinate and subordinate order can be started in the hierarchy. If you want to create a new bone without a "parent", you can disconnect with a right click. The left mouse click places the connection from the bone at a desired location. When you create a bone, you can give it a name and define the sprite depth.
Split bone: A single bone is divided into two connected bones.
Geometry
AutoGeometry: This option automatically creates a corner mesh for the sprite. "Triangles" are assigned to the existing bones and bones are generated with weighting information. The bone weight is determined for each connection and determines how much influence a bone has on a connection. The corners are colored and the bones are marked accordingly. which they affect and the corners are often affected by more than one bone and are marked in the bone color. The tessellation of the mesh vertex is automatic and is based on the sprite geometry structure and less on the number and position of the bones. The editing mode is also opened with a double click for the geometry.
EditGeometry: This allows you to move and erase corners and edges. When you delete an edge, you create an open "mesh". Unity preserves edges and other corners. If the information is lost from a corner, the surface is closed again until the auto geometry is used.
CreateVertex: The geometric image of the sprite consists of triangles. This allows new points to be created which create new triangles. These are automatically connected to the corresponding edges.
Create Edge: This allows you to create a new edge.
Split Edge: An edge is split near the mouse and a new corner is created.
Weights
Car weights: This option opens a panel that can automatically generate, normalize or delete bone weights.
Weight slider: Selected points can be adjusted using a number of sliders. Always select a point by clicking on it or select several by holding down Ctrl and clicking the left mouse button. You can also select a group by dragging a rectangle over the desired corners. The normal weight is basically 1. It can also be less than 1, which means that the skeleton moves less. The settings must be selected according to individual needs. The weight is never more than 1.
Weight brush: This allows a bone to be selected and the area of influence to be marked using digital colors. Brush size and hardness can be selected, as in programs like Photoshop. It is important to first mark the bone and only then "paint" the area of influence. Otherwise your sprite will only be one color and it won't work as planned.
"Rigging" the sprite
Drag the sprite into the hierarchy window.
Add the Sprite Skin as a component in the Inspector window, via Add Component.
Add the Sprite Skin:
Use the Create Bones option to add the edited bones:
The bones are now displayed in the hierarchy window:
Preparations for future animations are now in place.
Then the 2D sprite shades can be animated.
Here is the article Animate 2D sprite shades
Originally posted on 2019-12-15 10:49:00.