Python code solves the RenderView window not found problem, pythonrenderview

Source: Internet
Author: User

Python code solves the RenderView window not found problem, pythonrenderview

Source

Error: setParent: Object 'renderview' not found
This is a very common problem at work. In the past, there was a 10% probability of encountering special effects, most of which occurred when opening Maya scenario files handed over by other groups;
You can use the following code when you cannot solve the problem by dragging the File menu Open or directly into Maya;

Process

This was originally a piece of Mel. I used Python to rewrite it and changed it to Python code ~ According to the development trend, Python may completely replace Mel.

import maya.cmds as mcexists = 0getPan = mc.getPanel(scriptType = 'renderWindowPanel')for item in getPan:  if item == 'renderView':    print 'renderView exists.\n'    exists = 1if exists == 0:  for item in getPan:    print item + '\n'     if item == 'renderWindowPanel1':      mc.deleteUI( renderWindowPanel1 )      renderPanel = mc.scriptPanel( type = 'renderWindowPanel', unParent = renderView)      mc.scriptedPanel( ex = 1, l = "renderPanel", rp = 'renderPanel')

Copy the code to the Script Editor of Maya and press Ctrl + Enter to execute it;

Some people use the frontend rendering plug-in to solve this problem. In fact, the role of the frontend rendering plug-in is to solve the problem that "only one frame can be rendered.

Extension

This code can also be added to the tool shelf of Maya. The specific steps are as follows:

In some companies, they take special effects as the last part of the CG process (in fact, after the modeling is determined, the special effects can be synchronized ), engineering files that have been opened after model, animation, lighting, and rendering are filled with redundant nodes when handed over to the special effect group. Many people do not have the habit of clearing scenes, in this way, various problems may occur in files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.