Friday, October 25, 2013

Exposing mip shaders inmenatl ray

Run the code below in mel editor and restart maya. optionVar -intValue "MIP_SHD_EXPOSE" 1;

Thursday, September 12, 2013

Maya increasing decimal places

1) Open Channel Box. 2) Go to Edit->Settings->Change Precision. 3) Enter the decimal place you want.

Wednesday, September 4, 2013

How to connect four blendshapes to a Box controller.

1)Make a controller and blendshapes with names: Happy, Sad, Angry and Surprise. 2)set the limits in X and Z from range -1 to 1. 3)select blendshapes from blendshape editor. 4) Open Expression editor. 5) select each blend shape on left in expression editor and paste these code under each (Happy,Sad,Angry,Surprise). ###################################################################### Happy = clamp(0,1,-ControlCurve.translateX+1)*clamp(0,1,ControlCurve.translateZ) Sad = clamp(0,1,ControlCurve.translateX+1)*clamp(0,1,ControlCurve.translateZ) Angry = clamp(0,1,clamp(0,1,-ControlCurve.translateX+1) * -ControlCurve.translateZ ) Surprise = clamp(0,1,clamp(0,1,ControlCurve.translateX+1) * -ControlCurve.translateZ )

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)

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);
}
}

Sunday, December 4, 2011

PLayback Shotcut in mAya

Hello friends.
Maya timeline playback shortcut is: ALT+v

Thanks to my friend Rishi for showing me this shotcut.