# Error: RuntimeError: file <maya console> line 13: Object '<function save_snapshots at 0x000001757D101EB8>' not found. #
I am working on a script to create uv snapshots. Currently, I'm stuck on getting "save_snapshots" to get the integer that "uv_snap_res" is supposed to give.
In my UI, the 'save' button is using partial and I don't fully understand how that works. If I move save_snapshots behind 'texSizeControl' in the order of commands, it just simply doesn't run (I think?).
Was hoping to have a little help explaining how passing arguments works when using functions, and the order of operations when it comes to the "partial" thing... The only reason I'm this far is because of this site and finding examples in other areas. The whole radio buttons thing is a total challenge and I don't know if I fully have it working correctly :/ sorry.
any help or advice you have to offer I am all ears!!
## UV SNAPSHOTS
## PYTHON
import maya.cmds as mc
def get_snapshot_res(label, *args):
uv_snap_res = label
def save_snapshots(get_snapshot_res, uv_snap_res, *args):
get_snapshot_res(uv_snap_res)
print get_snapshot_res
def passValue(texSizeControl, *args):
radioCol = mc.radioCollection(texSizeControl, query=True, sl=True)
getSelectRadioVal = mc.radioButton(radioCol, query=True, label=True)
get_snapshot_res(getSelectRadioVal)
def save_snapshots_ui(*args):
myWindow = 'Create UV Snapshots'
if mc.window(myWindow, exists=True):
mc.deleteUI(myWindow)
mc.window(myWindow, title = myWindow)
mc.columnLayout(adjustableColumn=True)
mc.text(label='Choose your resolution for UV Snapshots', font='obliqueLabelFont')
texSizeControl = mc.radioCollection()
saveRadio1k = mc.radioButton(label='1024')
saveRadio2k = mc.radioButton(label='2048')
saveRadio4k = mc.radioButton(label='4096')
saveRadio8k = mc.radioButton(label='8192')
texSizeControl = mc.radioCollection(texSizeControl, edit=True, select=saveRadio2k )
mc.button(label='save', command= partial(passValue, save_snapshots, texSizeControl))
mc.setParent( '..' )
mc.showWindow()
save_snapshots_ui()