当前位置:网站首页>Unity3d plug-in anyportrait 2D bone animation
Unity3d plug-in anyportrait 2D bone animation
2022-06-26 21:56:00 【Peter_ Gao_】
One 、 Preface
AnyPortrait It's a creation 2D Character animation Unity Extend the editor plug-in .
AnyPortrait Many functions are provided , So that you can be in Unity Inside, the animation is completed .
Use AnyPortrait Plug ins are easy to create 2D grid , And realize various animation technologies .
AnyPortrait Key features :
User created grid
Through analysis PSD
Automatically create character vertex deformation animation
Color and transform animation
Combined state control using control parameters
Bone manipulation animation
Tension based vertex physical effect keyframe animation
Provide backup for users 、 Export data / Import 、 Capture and other functions .
Support 8 Languages ( English 、 Korean 、 French 、 German 、 Spanish 、 Danish language 、 Japanese and Chinese )
Let's put up an image :
This is the second article in this series :
【Unity3D plug-in unit 】( One ) Use AnyPortrait Plug in making shrem animation (AnyPortrait Plug in tutorial )
【Unity3D plug-in unit 】( Two ) Use AnyPortrait Plug in to make character animation (AnyPortrait Plug in tutorial )
Two 、 Tutorial sharing
This tutorial is based on... In the plug-in package PSD file .
Learn how to pass PSD File to create a grid group .
And how to add bones and create animation .
2-1、 Import PSD file
Let's create a new scene , After saving the scene , Choose... From the menu bar “Windows→AnyPortrait→2D Editor”, Click new portrait , Name it PeacockTheAria:
Press down Import PSD file Button to import a new PSD file :
Make sure that the file opens properly , And then click Next Button :
Go to the second page ,“ Layers ” page , The loaded layer image will appear , Then select the file layer :
Next , Need to put PSD Several pictures in the file are made into resources :
Set up the atlas Atlas after , Click on Complete Button :
You can see all the images 、 Meshes and mesh groups are created automatically :
Use PSD file , Automatically create meshes and mesh groups , Very convenient .
2-2、 Edit the mesh of the skeleton animation
Because the automatically created mesh is rough , So we need to optimize the grid .
Select the mesh to optimize , Delete all vertices :
next , Just reset the grid :
Repeat the above operation , Reset all meshes :
2-3、 Shear layer
After opening the grid group , You can see an arrow shaped icon in the hierarchy list ,Teeth and Tongue, If you select these two meshes , You can see that the mesh is only partially rendered , This is because Teeth and Tongue Has the cut layer attribute :
The following image demonstrates the effect of the clipping layer attribute , You can see the hidden part of the picture :
The clipping function is to render part of a mesh by specifying another mesh as a mask .
Mainly used for eyes 、 Mouth, etc .
however , Please pay attention to the following points :
The clipping function causes the process to slow down , So it slows down Game. Use only where necessary .
If you create and use a custom shader , You must also write code related to the editing function .
2-4、 Add bones
AnyPortrait Support bones IK( Inverse kinematics ) And support bone slots .
Next , Show me how to add bones to bone animation :
Add a bone at the center of gravity of the body , Direction is not very important :
Change the name and shape of this bone :
Continue adding bones , Name it Bone Spine 1:
Continue adding bones , Name it Bone Spine 2, The color and size are similar to that of a bone :
Add a bone to the ear of the character's hat :
Repeat the above steps , Create the bone style set in the following picture :
Next you need to connect the bones together , So you can move like a real person :
such ,Bone Spine 1 became Bone Pelvie The child object of .
In the same way , Connector and arms , Ears, etc :
2-5、 Use the bind modifier
After setting up the bones , You can use the binding modifier , The binding modifier is used to connect vertices to the mesh . Enter different weights for the bones at the vertices , So the vertices will follow the bone .
In the left figure above , The weight of all vertices is 1:0.0, So it doesn't rely on green bone movement .
On the right , The weight of the vertices increases to the green bone in turn , You can see the green bones moving smoothly .
That is to say, the binding modifier is to set the vertex + The process of connecting weights of bones .
below , Just add a binding modifier :
take Hood The vertices of the mesh are added to the binding modifier :
Click the start binding button in the lower left corner , Start binding vertices and bones , Select all vertices , And then choose Bone Head bones :
Set vertex weights :
2-6、 Create animation clips
Then add a modifier associated with the animation :
Select add animation clip from the left menu , Then set the name of the animation , Then select the grid group PeacockTheAria:
Be careful : The animation name is used to play the animation during the game , Duplicate name or error cannot be deleted .
Animation clip attributes :
Names of animation clips and mesh groups
Start and end frames of animation clips
Whether to circulate
Frames per second
Animation Events
export / Import animation file
2-7、 Add the time
To create keyframe animation , You must add a timeline to the animation clip :
Added transform ( Animation ) time axis :
Next , Add a bone to the timeline animation :
Click Edit to start , Add keys at key positions :
When you turn on edit mode and select a key , You can transform objects . This state is recorded in the keyframe .
Next , In the generated keyframes , Move the selected bone and record it :
Play animation :
2-8、 Animation curve settings
Interpolation is the most important principle in understanding keyframe animation .
Interpolation is the process of calculating the form between key frames .
According to the interpolation method , Even if you have the same keyframes , The results of animation may also be different .
This section introduces the interpolation method for animation curve processing .
Select a key frame , Set animation curves :
Set animation curves :
2-9、 Create bone animation
Next , According to the above , Do a skeleton animation .
Create a new animation between clips , Delete animation keys created between first :
Selecting all the bones and adding them to the timeline is cumbersome , You can add all bones to the timeline at once :
All the bones are on the timeline :
Set the animation loop :
If there are multiple time axes in one frame of animation , This setting is troublesome , It can be used at this time Add keys to all layers , Batch create keyframes :
Move the time slider to all positions of the generated keyframe , Open edit mode , animation .
After the animation is finished , You need to move the animation into the scene , Set the root directory first :
After setting the root node , Choose animation , And play the animation , You can see the animation after setting :
Click bake , Bake animation into the scene :
Run the program , You can see the animation .
3、 ... and 、 an account of happenings after the event being told
You can see it AnyPortrait The plug-in is still very powerful .
Can do a lot of effects and animation .
however , If you want to make fine animation , We also need professional artists to make .
————————————————
https://blog.csdn.net/q764424567/article/details/120408847
边栏推荐
- Convolutional neural network (CNN) explanation and tensorflow2 code implementation
- DLA模型(分类模型+改进版分割模型) + 可变形卷积
- 在哪家证券公司开户最方便最安全可靠
- leetcode:6107. 不同骰子序列的数目【dp六个状态 + dfs记忆化】
- Word chess based on heuristic search
- SAP Spartacus 中的依赖注入 Dependency Injection 介绍
- YOLOv6:又快又准的目标检测框架开源啦
- Is it safe for CICC fortune to open an account? I want to open an account to speculate in stocks.
- Leetcode(763)——划分字母区间
- How to create an OData service with the graphical modeler on the sap BTP platform
猜你喜欢

DAST 黑盒漏洞扫描器 第五篇:漏洞扫描引擎与服务能力

【题解】剑指 Offer 15. 二进制中1的个数(C语言)

Unity: 脚本缺失 “The referenced script (Unknown) on this Behaviour is missing!“

矩阵求导及其链式法则
![[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]](/img/8a/f5847eef7318f3db54aa2d4405b06a.jpg)
[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]

关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)

【图像处理基础】基于matlab GUI图像直方图均衡化系统【含Matlab源码 1924期】

BN(Batch Normalization) 的理论理解以及在tf.keras中的实际应用和总结

360手机助手首家接入APP签名服务系统 助力隐私安全分发

The importance of using fonts correctly in DataWindow
随机推荐
In 2022, where will the medium and light-weight games go?
leetcode:152. Product maximum subarray [consider DP of two dimensions]
【题解】剑指 Offer 15. 二进制中1的个数(C语言)
Introduction of classic wide & deep model and implementation of tensorflow 2 code
leetcode:141. 环形链表【哈希表 + 快慢指针】
Netease Yunxin officially joined the smart hospital branch of China Medical Equipment Association to accelerate the construction of smart hospitals across the country
vulnhub之DC9
Data governance does everything
Godson China Science and technology innovation board is listed: the market value is 35.7 billion yuan, becoming the first share of domestic CPU
BN(Batch Normalization) 的理论理解以及在tf.keras中的实际应用和总结
Word chess based on heuristic search
在Flutter中解析复杂的JSON
curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
数据治理啥都干
Which securities company is the most convenient, safe and reliable for opening an account
SAP Spartacus 默认路由配置的工作原理
Is there any risk in registering and opening an account for stock speculation? Is it safe?
random_ normal_ Initializer uses
Pass note 【 dynamic planning 】
DLA model (classification model + improved segmentation model) + deformable convolution