Hi all, there's probably a really simple answer for this, but I don't know
what it is. I'm trying to get a list of the setAttr commands on a plug via
Python. The Maya API gives you the ability to do this via:
MPlug::getSetAttrCmds(…)
Among other things, the function needs an MStringArray reference to be sent
in. How would I do this in Python when Maya-Python doesn't support MStrings
(and consequently MStringArrays)? So if I do this:
# NOTE: Code below assumes existence of an attribute named 'fSmoo' on a node
named 'pSphere1'
import maya.OpenMaya as om
import maya.cmds as cmds
cmds.select( 'pSphere1.fSmoo', r=True )
selList = om.MSelectionList()
om.MGlobal.getActiveSelectionList(selList)
itList = om.MItSelectionList(selList)
myPlug = om.MPlug()
itList.getPlug(myPlug)
if om.MItSelectionList.kPlugSelectionItem == itList.itemType():
print myPlug.name()
myPlug.getSetAttrCmds(sCmds)
What would 'sCmds' be?
Thank you for your time,
Ravi
--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan.
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---