Python 如何在Maya中的复制对象上选择特定边?

Python 如何在Maya中的复制对象上选择特定边?,python,maya,pymel,Python,Maya,Pymel,我是python新手,如果我的问题看起来很傻,我很抱歉。 但是,如果有人能帮助我,我将不胜感激 我正在用Maya Python编写脚本。 我有一组重复的网格。我需要选择某些多边形边并将它们转换为曲线 我成功地编写了将多边形转换为曲线的最后一部分,但很难编写通配符选择 我想用下面的方式写: list = [list of objects I want to get edges of] for i in list: pm.select() 有点像这样,, 但说实话,我不知道我在这里做

我是python新手,如果我的问题看起来很傻,我很抱歉。 但是,如果有人能帮助我,我将不胜感激

我正在用Maya Python编写脚本。 我有一组重复的网格。我需要选择某些多边形边并将它们转换为曲线

我成功地编写了将多边形转换为曲线的最后一部分,但很难编写通配符选择

我想用下面的方式写:

list = [list of objects I want to get edges of]

for i in list:
      pm.select()
有点像这样,, 但说实话,我不知道我在这里做什么

我非常感谢你的帮助

谢谢你这里有一个例子

# list of your duplicates
myDuplicatedMeshes = ['pShpere1_dup']
# select your edges in the viewport for detecting which edges to transfer
edgeInputList = cmds.ls(sl=True)
# collect the edges ids
edgeIds = [i.split('.')[-1] for i in edgeInputList]
# loop into the duplicated
for dup in myDuplicatedMeshes:
    # give the edge ids
    targeted_edges = ['{}.{}'.format(dup, id) for id in edgeIds]
    # convert to curve
    curveBuilded = cmds.polyToCurve(targeted_edges, form=2, degree=3)

哦非常感谢你!我要试试看!如果你发现答案对你有用,那么回来标记为“接受”,这样其他通过谷歌找到答案的人就会知道这是正确的选择