Works like a charm, thank you!

On Friday, October 19, 2012 9:14:08 AM UTC-7, damonshelton wrote:
>
> 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]<javascript:>
> > 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

Reply via email to