迟来的六一节节日问候!
我们今天用代码来制作一个儿童动画的demo视频
用到的项目代码:https://github.com/facebookresearch/AnimatedDrawings
背后的论文在这里:《一种为儿童绘制的人体动画制作的方法》
项目网站:http://www.fairanimateddrawings.com
激活 Python 虚拟环境,安装 Animated Drawings
# 创建python虚拟环境
conda create --name animated_drawings python=3.8.13
conda activate animated_drawings
# git下载项目,并使用pip安装
git clone https://github.com/facebookresearch/AnimatedDrawings.git
cd AnimatedDrawings
pip install -e .
conda activate animated_drawings
cd {location of AnimatedDrawings on your computer}
python3
from animated_drawings import render
render.start('./examples/config/mvc/interactive_window_example.yaml')
如果一切安装正确,屏幕上将出现一个交互式窗口。(使用空格键暂停/取消暂停场景,使用箭头键在时间上前后移动,使用 q 关闭屏幕。)
幕后角色、动作、场景等都由配置文件控制,也可以以在此处了解有关配置文件的更多资讯。
这里解释一下动画所需要的配置文档
看到配置文件有3种:角色、动画、场景。格式为yaml语法。
里面字段如下,包含height,skelton,lon,name,parent:
texture.png
与mask.png
文件char_cfg
的高度char_cfg
的宽度null
。在配置里面还有3个角色文件如下
每个图像如下:
这包含有关用于驱动动画绘图的动作的信息。目前,仅支持 BVH(BioVision Hierarchy)文件。
end_frame_idx
包括 0 和 )。start_frame_idx+1
和 BVH 帧数之间的一个整数(包括在内)。start_frame_idx
。+y
和+z
包含将运动配置指定的运动应用到角色配置中指定的动画绘图角色所需的信息。以下是配置部分截图
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。