mccollom73
10-17-2011, 06:09 AM
Hey everyone!
I am trying to put the selected attribute from the textScrollField into a textField and I'm having some trouble. My controller is named ikfk_ctrl, my ikfk attrribute is "ikfk, and I want the name "ikfk_ctrl.ikfk" in the textField to be my end result. The attributes name will be put into the list, but I'm not sure how get the final result ikfk_ctrl.ikfk
Here is what I have so far.
import maya.cmds as c
def ikfkSnapWindow():
# WINDOW
win=c.window(title="IKFK Snap GUI", widthHeight=(300,500))
#LEFT TAB
left=c.formLayout()
lf_ikfkText=c.text('lf_ikfkLabel', label="IKFK Attr")
lf_ikfkField=c.textField('lf_ikfk',w=140, editable=True)
lf_ikfkBtn = c.button(label="Load", c="loadWin('lf_ikfk')")
c.showWindow(win)
def loadWin(ikfk):
win=c.window(title="IKFK Attr")
panel=c.paneLayout()
attr=c.listAttr(r=True, k=True)
sel=c.ls(sl=True)
textScroll=c.textScrollList( numberOfRows=8, allowMultiSelection=False, append=attr, showIndexedItem=4 )
ikfkField = c.textField(ikfk, edit=True, text=sel[0])
c.showWindow(win)
ikfkSnapWindow()
Thanks!
Josh
I am trying to put the selected attribute from the textScrollField into a textField and I'm having some trouble. My controller is named ikfk_ctrl, my ikfk attrribute is "ikfk, and I want the name "ikfk_ctrl.ikfk" in the textField to be my end result. The attributes name will be put into the list, but I'm not sure how get the final result ikfk_ctrl.ikfk
Here is what I have so far.
import maya.cmds as c
def ikfkSnapWindow():
# WINDOW
win=c.window(title="IKFK Snap GUI", widthHeight=(300,500))
#LEFT TAB
left=c.formLayout()
lf_ikfkText=c.text('lf_ikfkLabel', label="IKFK Attr")
lf_ikfkField=c.textField('lf_ikfk',w=140, editable=True)
lf_ikfkBtn = c.button(label="Load", c="loadWin('lf_ikfk')")
c.showWindow(win)
def loadWin(ikfk):
win=c.window(title="IKFK Attr")
panel=c.paneLayout()
attr=c.listAttr(r=True, k=True)
sel=c.ls(sl=True)
textScroll=c.textScrollList( numberOfRows=8, allowMultiSelection=False, append=attr, showIndexedItem=4 )
ikfkField = c.textField(ikfk, edit=True, text=sel[0])
c.showWindow(win)
ikfkSnapWindow()
Thanks!
Josh
