On Sat, Oct 19, 2019, 12:13 PM kiteh <kiteh.0...@gmail.com> wrote:

> Hi Justin,
>
> Many thanks for the input.
> I have one more problem, trying to change the text in the progress bar.
>
> And so, I did something like this:
> def get_progress_bar(status_text, max_value):
>     try:
>         progress_bar = mel.eval("$tmp = $gMainProgressBar")
>     except RuntimeError:
>         progress_bar = None
>
>     if progress_bar:
>         cmds.progressBar(
>             progress_bar,
>             edit=True,
>             beginProgress=True,
>             isInterruptable=False,
>             status=status_text,
>             maxValue=max_value
>         )
>     return progress_bar
>
>
> def anim_bake():
>     ...
>     main_progress_bar = get_progress_bar("Baking animation", len(ctrls)*5)
>     ...
>     ...
>     for i in something:
>         ...
>         cmds.progressBar(main_progress_bar, edit=True, step=1)
>     cmds.progressBar(main_progress_bar, edit=True, endProgress=True)
>
>
> def set_attr():
>     ...
>     main_progress_bar = get_progress_bar("Setting Attrs", len(ctrls)*5)
>     ...
>     ...
>     for i in something:
>         ...
>         cmds.progressBar(main_progress_bar, edit=True, step=1)
>     cmds.progressBar(main_progress_bar, edit=True, endProgress=True)
>
>     anim_bake()
>
>
> When running my code, it seemingly, bypass one of the status text that I
> have made. Eg. First it displays `Setting Attrs`, but as soon as it starts
> to run `anim_bake`, instead of the text to showcase it as `Baking
> Animation`, there are times it either shows up blank, or even if I moved
> `anim_bake()` as a button, the text is still not shown.
>
> At times, 'Baking animation' may be shown if I restart the tool.. Any
> ideas?
>

No too sure on that one. I would assume the call to edit the progress bar
would refresh the draw of text.

Hopefully my previous suggestion made sense and those are just placeholder
'*5' values for how many operations and step calls you really have in your
different loops.

> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/af7bdf8c-ec0d-4cd0-99c3-91ade7bc3117%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/af7bdf8c-ec0d-4cd0-99c3-91ade7bc3117%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0w5yguJ8ghiqNcExSVtMg6a8_u3wxq8PB%2BwNzmnSh0DA%40mail.gmail.com.

Reply via email to