(hairSimulation/CFX) 同时选择具有自己的副本和混合形状的多条曲线

(hairSimulation/CFX) selecting multiple curves with its own duplicate and blendShape at the same time

我在maya中模拟头发,我想锁定抖动的曲线。我复制了这些曲线来制作混合形状,但是有太多的曲线无法单独混合形状。有没有办法编写脚本来解决这个问题?我认为方法是切片以获得曲线的 name/number 并使用循环将所有曲线混合变形。但由于我是脚本新手,所以我需要帮助。

您可以使用此命令获取毛囊:

fols = cmds.ls(type='follicle')

之后,找到模拟的曲线:

crvs = cmds.ls(fols, dag=True, type='nurbsCurve')

遍历这些曲线并使用:

dup = cmds.duplicate(c)[0] # where c is the iterator of the for loop on crvs

然后 :

bs = cmds.blendShape(dup, c)

您在每个命令上都有很少的标志,但它应该可以帮助您喜欢名称、重量等等。 我有几周没有使用 Maya,希望它能对您有所帮助

编辑: 并不是说毛囊曲线设置为中间曲线,对于混合变形,您可能需要临时设置它们:

cmds.setAttr(c+'.io', 0)
bs = cmds.blendShape(dup, c)
cmds.setAttr(c+'.io', 1)