I'm trying to find a better way to change the textfield
in multiple textFieldButtongGrps
when I press their buttons.
Currently, what I have here works, but with this, I have to make additional lines in select_Object()
for any additional textFieldButtongGrps
I make in my UI. This is because I have to declare the name in select_Object()
Is there a way to change this so that if I make 6 textFieldButtongGrps
, I can just have the select_Object()
function use something similar to self?
import maya.cmds as cmds
window = cmds.window()
cmds.columnLayout()
tsL0 =cmds.textFieldButtonGrp(ed=False, adj=1,cal=(1,"left"),cw3=(10,100,25), cl3=("left","left","left") ,
buttonLabel='Root FK',bc = 'select_Object()' )
gtF0 = tsL0
tsL1 =cmds.textFieldButtonGrp(ed=False, adj=1,cal=(1,"left"),cw3=(10,100,25), cl3=("left","left","left") ,
buttonLabel='Root FK',bc = 'select_Object()' )
gtF1 = tsL1
cmds.showWindow( window )
def select_Object():
cmds.textFieldButtonGrp(**gtF0**, edit = True, tx ='' .join(sel),buttonLabel='IK OK',backgroundColor = (.5,.8,.2))
What I'd like to achieve:
def select_Object():
cmds.textFieldButtonGrp(**self**, edit = True, tx ='' .join(sel),buttonLabel='IK OK',backgroundColor = (.5,.8,.2))