如何使用 Maya python 命令而不是 API 获取 Maya 斜坡点的准确索引 ID 号

问题描述 投票:0回答:1

是否可以使用 Maya 命令和 Python 而不是 API 代码来查询 Maya 中 2D 图形纹理的点的索引号?这些点不一定从 0 开始,也不总是连续的。

python textures maya
1个回答
0
投票

这可能有帮助:

import maya.cmds as cmds
indices = cmds.getAttr("ramp1.colorEntryList", mi=True)
for i in indices:
    p=cmds.getAttr("ramp1.colorEntryList[" + str(i) + "].position")
    print(p)
    c=cmds.getAttr("ramp1.colorEntryList[" + str(i) + "].color")
    print(c)
© www.soinside.com 2019 - 2024. All rights reserved.