AutoWrap | BS2Bone
# AutoWrap | BS2Bone
# AutoWrap
本工具可通过选择少量顶点的方式快速将源模型包裹到目标模型上。
本工具无独立UI,适用于TA侧作为功能集成使用。

数据说明
源模型需使用superman模板中的proxy_head模型(如metahuman需LOD3-7,0-2暂时会因为精度问题导致任务失败),目标模型可自由定制无拓扑UV限制条件,如需自定义源模型,可提交源模型数据给到我们,我们对服务端进行配置后即可使用自定义源模型。
测试样例
启动后,载入相关模型资源,选择目标模型的5处顶点(左内眼角,左外眼角,鼻尖,嘴唇左角,下巴),执行以下代码进行功能测试(相关参数需根据场景情况自行修改):
from maya_superman_auto_wrap.test import test_auto_wrap
# source_mesh: 源模型名,根据模型资源自行修改,progressUI: 是否显示进度条,upAxis: 朝上方向轴
test_auto_wrap.test_auto_wrap(source_mesh='proxy_head',progressUI=True,upAxis='y')
1
2
3
2
3

# 功能集成
其中test_auto_wrap函数代码如下(可作为嵌入自研工具使用):
from superman_common.dcc.maya import mesh
from maya_superman_auto_wrap import auto_wrap
import pymel.core as pm
import maya.cmds as cmds
# 正式调用代码,可作为功能集成用途
# source_mesh: 源模型名,progressUI: 是否显示进度条,upAxis: 朝上方向轴
def test_auto_wrap(source_mesh='proxy_head', upAxis='y', progressUI=True):
if not cmds.objExists(source_mesh):
cmds.warning('No found: {}'.format(source_mesh))
return
# 获取目标模型与5个采样点信息
target_mesh, marked_points = mesh.get_marked_data(upAxis)
if not cmds.objExists(target_mesh):
cmds.warning('No found: {}'.format(target_mesh))
return
if not marked_points: return
params = {
'source_mesh': source_mesh,
'target_mesh': target_mesh,
'target_marked_points': marked_points,
'upAxis': upAxis,
'progressUI': progressUI,
}
# 调用wrap服务
wraped_data = auto_wrap.AutoWrap(**params).do()
# 传递顶点信息
pm.PyNode(source_mesh).setPoints(wraped_data)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# BS2Bone
该工具可将美术制作的变形目标体(如表情)序列,通过矩阵分解的方式,将变形效果智能转换到若干骨骼上,从而简化美术资产,提升游戏效能。
# 启动方式
进入Superman工具能看到如下启动入口,双击对应版本图标即可启动Maya同时加载插件包。

待菜单栏出现Superman Blade后,执行Blendshape to Bone Converter即可启动工具

