You can run cmds.refresh() right after you set the text label to change the
first time, will auto refresh when complete
I don't use pymel but have done this method before with standard calls
def script_wrapper():
pm.text(label='Starting script')# is this is an edit call or a creation
call?
cmds.refresh()
long_running_script() # could take up to 3 seconds to execute
pm.text(label='Script complete')
On Thu, Oct 18, 2012 at 1:58 PM, isherman <[email protected]> wrote:
> I have a button that triggers a script that can take anywhere from 1 to 3
> seconds to execute.
>
> I'd like to show some immediate feedback to the user when the button is
> pressed, and then another message when the script is complete. However any
> UI command I include at the beginning of my script wrapper won't be visible
> until the script is complete.
>
> Is there a convention for dealing with this? (preferably without spinning
> off another thread)
>
> ## EXAMPLE
> import pymel.core as pm
>
> def script_wrapper():
> pm.text(label='Starting script')
> long_running_script() # could take up to 3 seconds to execute
> pm.text(label='Script complete')
>
> pm.button(label='Run Script', command=script_wrapper)
>
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe