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.