How to get the exact index ID numbers of Maya ramp points using Maya python commands and not API

33 Views Asked by At

Is it possible to query the Index numbers of the points of a 2D graph texture in Maya using Maya commands and Python and not API code? The points do not necessarily start at 0 and are not always sequential. enter image description here

1

There are 1 best solutions below

0
haggi krey On

This could help:

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)