I have a UI to set the color of the controls of the autorig. When I connect the button to a function I run into a problem. The called function can't find the button that calls it.
# Error: RuntimeError: file <maya console> line 194: Object 'colorChoice' not found. #
If I put the function in the same script I get a problem because It can't query the button before the button has been created.
If I put the function in the same script after the button is created it doesn;t work because the script is being called before the script has been defined.
How do I resolve this flow of information? Is there a good tutorial for accessing objects created in another function?
Thanks for your help.
# Error: RuntimeError: file <maya console> line 194: Object 'colorChoice' not found. #
If I put the function in the same script I get a problem because It can't query the button before the button has been created.
If I put the function in the same script after the button is created it doesn;t work because the script is being called before the script has been defined.
How do I resolve this flow of information? Is there a good tutorial for accessing objects created in another function?
Thanks for your help.
def test4(): WindowID = 'test' if cmds.window (WindowID, exists = 1): cmds.deleteUI(WindowID) cmds.window(WindowID, resizeToFitChildren = 1) cmds.frameLayout( label='Choose colors' ) cmds.columnLayout() cmds.text('Choose the color of the controls') cmds.radioButtonGrp('colorChoice,' "Analyse_btw", labelArray3=['All one Color', 'Red/Blue/Green', 'Purple/Orange/Yellow' ], numberOfRadioButtons=3 , sl= 2, cc= setControlColors()) cmds.showWindow() def setControlColors(): controlColorChoice = cmds.radioButtonGrp('colorChoice', q=1,sl=1)
Larz60+ write Apr-05-2021, 10:18 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.