Wednesday, June 20, 2012
Fix Maya Error: setParent: Object 'renderView' not found.
Fix Maya Error: setParent: Object 'renderView' not found.
I started to face this problem in Maya 2012 version, and it happens frequently, however it can be solved easily with one click, all you have to do as follow:
1- open Scrip Editor in Maya
2- Paste the following code:
$exists=0;
for ($item in `getPanel -scriptType "renderWindowPanel"`) {
if ( $item == "renderView" ) {
print "renderView exists.\n";
$exists=1;
}
}
if ( $exists == 0 ) {
for ($item in `getPanel -scriptType "renderWindowPanel"`) {
//print ( $item + "\n");
if ( $item == "renderWindowPanel1" ) {
deleteUI renderWindowPanel1;
$renderPanel = `scriptedPanel -type "renderWindowPanel" -unParent renderView`;
scriptedPanel -e -label `interToUI $renderPanel` $renderPanel;
}
}
}
3- on Script Editor go to File -> Save Script to Shelve, make sure that you have chosen the Render Shelf so that the script is saved there.
4- Name the script "Fix Rendering" for example, then click to run it.
you can run the script each time you face this problem by just clicking on the icon created in the shelve
Original Link:
Saturday, April 7, 2012
Lost Animation when loading Referenced Rigs
import pymel.core as pm
import maya.cmds as cmds
cSet,type=pm.ls(sl=True,st=True)
refNode=cSet.referenceFile().refNode
if not type=='character':
raise StandardError('You must select a CharacterSet to reconnect')
if not refNode:
raise StandardError('Given characterSet is not from a referenced file')
animCurves=refNode.listConnections(type='animCurve',s=True)
cSetPlugs=pm.aliasAttr(cSet,q=True)
for plug in cSetPlugs[::2]:
for anim in animCurves:
if anim.split(':')[-1].endswith(plug):
print '%s >> %s' % (anim,plug)
pm.connectAttr('%s.output' % anim,'%s.%s' % (cSet,plug),force=True)
import maya.cmds as cmds
cSet,type=pm.ls(sl=True,st=True)
refNode=cSet.referenceFile().refNode
if not type=='character':
raise StandardError('You must select a CharacterSet to reconnect')
if not refNode:
raise StandardError('Given characterSet is not from a referenced file')
animCurves=refNode.listConnections(type='animCurve',s=True)
cSetPlugs=pm.aliasAttr(cSet,q=True)
for plug in cSetPlugs[::2]:
for anim in animCurves:
if anim.split(':')[-1].endswith(plug):
print '%s >> %s' % (anim,plug)
pm.connectAttr('%s.output' % anim,'%s.%s' % (cSet,plug),force=True)
Tuesday, February 14, 2012
UV TRansfer
/*
cbMassUVTransfer v 1.0b
"""""""""""""""""""""""""
//----------------------------------------------------------
What?_
This script allows the user to transfer UV's to multiple
objects in one action.
//----------------------------------------------------------
Who?_
Author: Christer Bjørklund
Website: www.christerb.com
eMail: christer@christerb
Copyright ©2006 Christer Bjørklund - All Rights Reserved.
//----------------------------------------------------------
Why?_
I got tired of selecting, transferring, reselecting, tranferring..
and so on and so forth...
//----------------------------------------------------------
How?_
Place the cbMassUVTransfer.mel file in your Maya scripts
directory, source the file (or reboot Maya) and run
cbMassUVTransfer();
I have also included an icon for shelf usage.
( cbMassUVTransferShelfIcon.bmp )
Shelfbutton example:
source "C://Documents and Settings//userName//My Documents//maya//X.X//scripts//cbMassUVTransfer.mel";
cbMassUVTransfer();
//----------------------------------------------------------
Information_
Version(s):
1.0 - First release
Known issues:
- Nothing.. I think.. well maybe except the.. no.. nevermind.
Compability:
Tested and working in Maya 7.0, but should run in earlier
versions as well.
Usage:
Use at your own risk. I will not stand responsible for
any damage caused by this script.
//----------------------------------------------------------
A quick "how to"..
""""""""""""""""""
//----------------------------------------------------------
1. Select the objects you want to transfer UV's to.
2. Add the object with the UV you want to transfer from to the
selection.
3. Run the script.
//----------------------------------------------------------
*/
global proc cbMassUVTransfer()
{
$selLast = `ls -sl -tl 1`;
$selRest = `ls -sl`;
for ($i in $selRest)
{
if ($i != $selLast[0])
polyTransfer -vc 0 -uv 1 -v 0 -ao ($selLast) ($i);
}
}
cbMassUVTransfer v 1.0b
"""""""""""""""""""""""""
//----------------------------------------------------------
What?_
This script allows the user to transfer UV's to multiple
objects in one action.
//----------------------------------------------------------
Who?_
Author: Christer Bjørklund
Website: www.christerb.com
eMail: christer@christerb
Copyright ©2006 Christer Bjørklund - All Rights Reserved.
//----------------------------------------------------------
Why?_
I got tired of selecting, transferring, reselecting, tranferring..
and so on and so forth...
//----------------------------------------------------------
How?_
Place the cbMassUVTransfer.mel file in your Maya scripts
directory, source the file (or reboot Maya) and run
cbMassUVTransfer();
I have also included an icon for shelf usage.
( cbMassUVTransferShelfIcon.bmp )
Shelfbutton example:
source "C://Documents and Settings//userName//My Documents//maya//X.X//scripts//cbMassUVTransfer.mel";
cbMassUVTransfer();
//----------------------------------------------------------
Information_
Version(s):
1.0 - First release
Known issues:
- Nothing.. I think.. well maybe except the.. no.. nevermind.
Compability:
Tested and working in Maya 7.0, but should run in earlier
versions as well.
Usage:
Use at your own risk. I will not stand responsible for
any damage caused by this script.
//----------------------------------------------------------
A quick "how to"..
""""""""""""""""""
//----------------------------------------------------------
1. Select the objects you want to transfer UV's to.
2. Add the object with the UV you want to transfer from to the
selection.
3. Run the script.
//----------------------------------------------------------
*/
global proc cbMassUVTransfer()
{
$selLast = `ls -sl -tl 1`;
$selRest = `ls -sl`;
for ($i in $selRest)
{
if ($i != $selLast[0])
polyTransfer -vc 0 -uv 1 -v 0 -ao ($selLast) ($i);
}
}
Subscribe to:
Posts (Atom)