For some functions, as they operate on large numbers of objects can be
wrapped in another iterative function to give you the ability to provide
progress.
def centerPivots():
sel=pm.ls(sl=1)
count=0
for obj in sel:
pm.makeIdentity(s,apply=True,t=1,r=0,s=0,n=0,pn=1)
count+=1
print str(count)+' of '+str(len(sel))
Though unfortunately in the instance of a cache function, it only operates
usually on one object and doesn't have any discernible way of catching how
far along the progress is. When watching a cache happen in GUI instances,
you can see the timeline update as the function goes through. So as Marcus
said, I am looking for a kind of hacky way of perhaps utilizing this fact
to call functions.
Another hacky way of automatically checking cache progress might be to have
a function that checks the cache directory for output files and uses that
to show progress.
I have also built a function for printing out to the output window opposed
to maya's internal script editor output in hopes to use that for writing
out messages (for purposes of seeing progress during command line operation
and as a result, farm job reporting).
def printWindow(message):
mayaOut=sys.stdout
sys.stdout=sys.__stdout__
print message
sys.stdout=mayaOut
--
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/76bca305-f8ec-4caf-9ddf-9d56ed9db822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.