Getting value dynamically from QLineEdit

32 views
Skip to first unread message

Nazmi Yazıcı

unread,
May 28, 2018, 3:21:01 PM5/28/18
to Python Programming for Autodesk Maya
Hello, i have a .py file which contains all the functions i need and at the very bottom this class is laying which converting the .ui file etc.

def headBuild(*arg):
...
cmds
.matchTransform('head_L_eye_bindDummy_JNT', leyeGeo)
...


class nyBipedUI(form_class, base_class):
...

 
self.connectSignals()


 
def connectSignals(self):
 
#GET THE STRINGS FROM TEXT BOXES
 
global bodyGeo
 bodyGeo
= str(self.body_TB.text())
 
global leyeGeo
 leyeGeo
= str(self.leye_TB.text())
 
global reyeGeo
 reyeGeo
= str(self.reye_TB.text())


 
#CONNECT SIGNALS

 
self.connect(self.legBuild_BTN, QtCore.SIGNAL('released()'), legBuild)
 
self.connect(self.headBuild_BTN, QtCore.SIGNAL('released()'), headBuild)
 
....

legBuild and headBuild functions are working on the UI but headBuild requires inputs as strings(leyeGeo and reyeGeo). If i type A to the line edit from the QtDesigner, it raises an error: couldn't find object:A, then i type B from the UI on Maya it's still raising the same error(couldn't find object A). I tried connecting signals from QtDesigner textEdited > setText to line edits' itself but no result. I hope that made sense. 

Justin Israel

unread,
May 28, 2018, 3:40:44 PM5/28/18
to python_in...@googlegroups.com
What does your legBuild or headBuild slot callback look like? I am not sure from your reduced example, but it seems like you are getting the values from the text boxes once and storing them in globals. You should remove the use of globals and have your button callback look up the text box values locally. 

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bf5b895f-a0ab-4a98-a710-c829b7970a31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nazmi Yazıcı

unread,
May 29, 2018, 3:39:35 PM5/29/18
to Python Programming for Autodesk Maya
I added the functions to the class and i can call them as i wanted to right now as you've suggested. I guess i should've done that at first but i'm fairly new to this. I also started watching your awesome tutorials, so thank you twice!:D

28 Mayıs 2018 Pazartesi 22:40:44 UTC+3 tarihinde Justin Israel yazdı:
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Justin Israel

unread,
May 29, 2018, 3:42:46 PM5/29/18
to python_in...@googlegroups.com


On Wed, May 30, 2018, 7:39 AM Nazmi Yazıcı <beyaz...@gmail.com> wrote:
I added the functions to the class and i can call them as i wanted to right now as you've suggested. I guess i should've done that at first but i'm fairly new to this. I also started watching your awesome tutorials, so thank you twice!:D

Good luck, and use classes! :) 

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/81af7c5a-109d-4c70-9615-4585530f43ee%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages