Not too familiar with pymel, but I would guess you need to pass in a
reference to your textFieldButtonGrp to the buttonCommand callback. In this
case, you're using 'tx' + i.
import pymel.core as pm
def get_text(i):
print pm.textFieldButtonGrp("tx"+str(i),edit=True).getText()
#これだとどのボタン押しても最後のテキストがプリントされてしまう。
with pm.window(title = "gomigomi"):
for i in range(10):
with pm.columnLayout():
pm.textFieldButtonGrp("tx"+str(i), text="test"+str(i),
buttonLabel='<',
buttonCommand = pm.Callback(get_text, str(
i)))
--
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/a67bf9a1-851e-43b7-8357-c2b9a9f01bd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.