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.