Anyone knows how to call a function with a button inside a class? at the moment i have that code: #button calling functionsimport maya.cmds as cmdsimport maya.mel as melfrom functools import partial class B: text_entered="a" def __init__(self): self.create_window() def printText(self): print(self.text_entered) return def…
What short of script are you trying to write? when you write print(self.text_entered) in this statement it seems like there is 2 arguments or it doesn't return self.text_entered because the def create_window(self) doesn't store (self.text_entered) . maybe try print(self) sorry my scripting is a bit rusty
Sorry i was outside for a few days and i didnt has internet connection. I finally ended with a solution of make a function inside a function: import maya.cmds as cmds class B: def __init__(self): self.create_window() def create_window(self): if cmds.window("UI", exists=True): cmds.deleteUI("UI") win = cmds.window("UI")…