Hello! I'm pretty new to python and I have this problem with a UI Window in
order to translate the points of a Lattice Deformer using a Slider. Here is
what I've been doing till now. I would really need some help connecting the
slider with the selected vertexes. This is in face where I get the error.
#Select vertices to translate on x
all_vertices=cmds.ls(selection=True, flatten=True)
print all_vertices
for vertex in all_vertices:
current_vertexposition = cmds.getAttr('{0}'.format(vertex))
print current_vertexposition
#Make window
if cmds.window("chWin", exists=True):
cmds.deleteUI("chWin")
def close_window(*args):
window.destroy(args[0].LatticeWindow, LatticeWindow=True)
#Var1=range(-2.5, 2.5)
# get Lattice deformer atributes in order to change position of selected
vertices
LatticeWindow = cmds.window("LattWindow", title="Make your OWN SeaUrchin",
widthHeight=(300,300))
cmds.columnLayout(adj=True)
imagePath=cmds.internalVar(userPrefDir=True)+"icons/seaurchin_maya.jpg"
cmds.image(w=300, h=113, image=imagePath)
cmds.separator(h=10)
cmds.text("Transform Lattice")
cmds.separator(h=10)
cmds.attrFieldSliderGrp( min=-2.50, max=2.50, at='%s.tx' % vertex[0])
cmds.showWindow(LatticeWindow)
# Error: line 1: Could not find attribute named f.tx
# Traceback (most recent call last):
# File "<maya console>", line 8, in <module>
# RuntimeError: Could not find attribute named f.tx #
In fact I would like the UI window to also have a button to Apply and Close
but I just cannot understand what the command of this button should look
like.
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/26022f57-95b0-4ac6-bf6c-ebfec72d4e82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.