Tuesday, February 14, 2012

Resurfacing In Maya (Set Up Process)

In this video we will take a look at a set up process that I use to resurface meshes inside of Maya. I have created the process as a mel script. I will post the contents of the script in the comments section.

Peace-NickZ. :)


NickZ. said...

//This script will set up a scene for resurfacing a high resolution mesh.

//This section will take your selected mesh rename it, duplicate it and rename the new mesh.

rename makeMeLive_show;

duplicate -rr;

rename makeMeLive_hide;

//This section will take your models, group them and rename the group.


select -r null1 ;

rename Geometry;

//This section will take your meshes and parent them to the Geometry group.

select -r makeMeLive_show makeMeLive_hide ;

select -add Geometry ;


select -cl ;

//This section will create two layers. One to hold the "live" mesh and one that will hold the mesh that will will be visible.

createDisplayLayer -name "makeLive_hide_LAYER" -number 1 -empty;

createDisplayLayer -name "makeLive_show_LAYER" -number 1 -empty;

//This section takes your meshes and assigns them to the correct layers and sets the layers attributes.

select -r makeMeLive_show ;

layerEditorAddObjects makeLive_show_LAYER;

setAttr makeLive_show_LAYER.displayType 2;


select -r makeMeLive_hide ;

layerEditorAddObjects makeLive_hide_LAYER;

setAttr "makeLive_hide_LAYER.visibility" 0;

//This section will take your mesh and make it live.

select -r makeMeLive_hide ;


//This section is for setting up a shader that will be assigned to our HiResolution mesh. This also makes the shader 50 percent transparent then it sets the

createRenderNodeCB -asShader "surfaceShader" blinn "";

select -r blinn1 ;

rename blinn1SG "makeLiveSG";

rename blinn1 "makeLive_MAT";

select -r makeMeLive_show ;

hyperShade -assign makeLive_MAT;

setAttr "makeLive_MAT.transparency" -type double3 0.5 0.5 0.5 ;

select -r makeMeLive_show ;

setAttr makeMeLive_showShape.backfaceCulling 3;

//Clears the last selection.

select -cl ;

//Selects shader and adds keyframes to the timeline to control trasnsparency.

select -r makeLive_MAT ;

currentTime 1 ;

setAttr "makeLive_MAT.transparency" -type double3 1 1 1 ;

setKeyframe { "makeLive_MAT.it" };

currentTime 24 ;

setAttr "makeLive_MAT.transparency" -type double3 0 0 0 ;

setKeyframe { "makeLive_MAT.it" };

currentTime 12 ;

NickZ. said...

//This script will set up a mesh as your new resurfaced surface

//This section will take your selected mesh rename it, duplicate it and rename the new mesh.

rename resurfaceMeshLeft;

setAttr "resurfaceMeshLeftShape.overrideEnabled" 1;

setAttr "resurfaceMeshLeftShape.overrideShading" 0;

setAttr "resurfaceMeshLeftShape.backfaceCulling" 3;

instance; scale -r -1 1 1;

select -r resurfaceMeshLeft1 ;

rename resurfaceMeshRight;

por said...

This is a really good resurfacing in Maya tutorial NickZ. Thank you so much especially back face culling and shading override attribute.