Python code resolves Renderview window not found problem _python

Source: Internet
Author: User

Source from

Error:setParent:Object ' Renderview ' not found
This is a very common problem in the work, used to do special effects when there are 10% of the probability will come across, more in the open other group handover to the Maya scene file;
Use the following code when you are unable to solve the problem, whether from the File menu open or directly into Maya;

Process

This was originally a section of Mel, and I rewrote her with Python and turned it into Python code. As a development trend, Python is likely to replace Mel completely.

Import Maya.cmds as mc

exists = 0
Getpan = mc.getpanel (ScriptType = ' Renderwindowpanel ') for
item in Getpan:
   IF item = = ' Renderview ':
    print ' Renderview exists.\n '
    exists = 1
if 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 Maya script Editor, according to Ctrl+enter execution can;

Some people use the foreground rendering plug-ins to solve this problem, in fact, the role of the foreground rendering plug-ins is to solve the "only render one frame" problem.

Extended

This code can also be added to the Maya tool rack, as follows:

In some companies, they use special effects as the last step in the CG process (in fact, the special effects are modeled and then they can start synchronizing), after the model, animation, lighting, rendering open over the project documents, hand over to the special effects group will be filled with a variety of redundant nodes, and many people do not clean up the habit of the scene, This can easily lead to a variety of problems with the file.

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.