So, i have a script I’m currently working on (cant talk much about it because of company policies). I hope you folks can help me out with this. I have created 3 icons in Photoshop for the script and once I run so called script, i see the right first icon shows on the UI, but once I click another button that’s supposed to change the image, to… say, “icon 2”, as you know it doesn’t update immediately. How can I approach an instant “update” of so called icon after the button press? If I close and re-run the script, the right icon shows, so it’s more about how to approach an instant update of it
def ON_icon(*args):
ON_icon = cmds.internalVar(upd=True) + "icons/LayerTree/ON.png"
cmds.image(w=25, h=25, image=ON_icon)
def OFF_icon(*args):
OFF_icon = cmds.internalVar(upd=True) + "icons/LayerTree/OFF.png"
cmds.image(w=25, h=25, image=OFF_icon)
def EMPTY_icon(*args):
EMPTY_icon = cmds.internalVar(upd=True) + "icons/LayerTree/EMPTY.png"
cmds.image(w=25, h=25, image=EMPTY_icon)
def base_layer_icon(*args):
if (cmds.objExists('Base_layer')):
ON_icon()
elif not (cmds.objExists('Base_layer')):
EMPTY_icon()
else:
OFF_icon()
This is just my foundation for this icon system, I’m just trying to find a way to do this. I read up on the “callback” way, but im still a bit confused on how to achieve it.