For every function? I don’t think so, as it depends on what the function is
doing.

For example, consider this.

def cache():
  count = 10
  while True:
    count -= 1
    if count < 0:
      break

This would run until done, and there’s no way to determine how long it will
take unless you knew the source.

For some functions, such as Maya’s geometry caching? Maybe, if it got
implemented that way. I’d think that if it visually moves the timeline,
there must be a way, however hacky. Otherwise you’re at the mercy of
whatever notification mechanism got built into the function to start with.

subscribers = []
def cache():
  count = 10
  while True:
    for func in subscribers:
      func("%i loops left" % count)
    count -= 1
    if count < 0:
      break
def update_my_widget(status):
  # widget.setText(status)
  print(status)

subscribers.append(update_my_widget)

cache()

​

On 21 August 2015 at 10:10, Colas Fiszman <[email protected]> wrote:

> Hi Alex,
> One solution to print some custom info on cache progression with maya in
> command line is to create a expression that will call a mel or python
> function that will print whatever info you want.
> Greets,
> Colas
>
> 2015-08-20 20:50 GMT+01:00 Alex Rideout <[email protected]>:
>
>> Hey all,
>>
>> I am curious if there is a way that one can display the progress of some
>> built in maya commands that don't output this information by default. Some
>> of maya's commands have either progress bars or print out current
>> completion status information, but there are plenty that don't that could
>> benefit from it if you are sending large amounts of data through them and
>> have no way of gauging how long it will take.
>>
>> Primarily, I am looking for a way to track the progress of writing out
>> cache files for dynamics especially in the cases of running a command line
>> Maya instance. Currently I can look at output cache files to see what
>> frames have been cached out, though it would be nice to see this in an
>> output window. I looked into scriptJobs utilizing timeChanged events in
>> hopes that as the cache function changes time in maya, that these script
>> jobs would trigger (no such luck). Any ideas?
>>
>> Alex
>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/6062e220-eed6-488f-8916-488e25d5ab5a%40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/6062e220-eed6-488f-8916-488e25d5ab5a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CABwp0vP6qtU1p1c_c3ayaZDoO2qR-bSc0neyneTUxcYFp-AKnw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CABwp0vP6qtU1p1c_c3ayaZDoO2qR-bSc0neyneTUxcYFp-AKnw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCZrPc8jKEo%2BjdK7o7D1GTqcaG0uEWWOCh_Wb1qVzVivg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to