简体   繁体   中英

How to monitor a maya program running in my computer?

I wrote some codes in Maya using Maya Python to render over 2,000 pictures. Since there are a lot of work for Maya to finish, during the long process of rendering, Maya may get crashed. So I have to make a module to monitor Maya. If Maya get stuck, the module has to keep Maya going and modify the mistakes. I want to know what tools can I use to achieve this function. What kind of language should I use to code this module?

The cheap solution is just to write out a log to a text file as your main script runs, and to use a separate monitoring process to check that file when it changes. Here's a StackOverflow question that shows how to do it in Python. In your case you could just keep polling the file and forcibly restart the process if a long period goes by without an update to the log file.

使用一些渲染农场程序作为截止日期或其他东西。

  1. If you need a ready to use application for your need than go with RenderBOX - Advanced Rendering Manager its Free.

  2. If you want to monitor maya program is running in your pc than you can use psutil python library.

    psutil (process and system utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python. It is useful mainly for system monitoring, profiling and limiting process resources and management of running processes.

all you need to do is : look for "maya.exe", "mayabatch.exe", "render.exe" in running process. and the quick way to get name and status of running process is :

import psutil

process_id_list = psutil.pids()

for process_id in process_id_list:
    process = psutil.Process(process_id)
    name = process.name()
    status = process.status()
    print name, status

This is a cross-platform library so this will work in all operating system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM