maya贴图路径找回脚本

maya贴图路径找回脚本
maya贴图路径找回脚本

/* This file downloaded from https://www.360docs.net/doc/403727847.html,

''

'' https://www.360docs.net/doc/403727847.html, File Information:

''

'' Script Name: FileTextureManager

'' Author:

'' Last Updated: Nov 18, 2008

'' Update/Change this file at:

'' https://www.360docs.net/doc/403727847.html,/maya/downloads/mel_scripts/rendering/misc/1012.html

''

'' Please do not alter any information above this line

'' it is generated dynamically by https://www.360docs.net/doc/403727847.html, and will

'' be changed automatically on any updates.

*/

///////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////

///

/// Procedure Name : FileTextureManager

///

/// Updated : July 10, 2007

/// In celebration of Hongkong's returning to China for ten years.

///

/// Author : Crow Yeh

/// Contact : crow@https://www.360docs.net/doc/403727847.html,

///

/// History :

/// v3.3 Fixed a bug that dselects needed file nodes when user checks

/// checkBoxes not supposed to be checked.

/// v3.2 Fixed a bug that fails to recognise '\' as path separator

/// under OS other than Windows.

/// Extra functions now supports mentalray.

/// v3.1 Adds support (only basic functions) for Maya

/// psdFileTex node type and mentalray mentalRayTexture

/// node type.

///

/// Description :

///

/// File Texture Manager works on Windows/IRIX/Linux/MAC, manages file textures in a handy way.

/// FTM's basic functions:

/// 1. Analyse scene file textures and give texture existence report.

/// 2. Copy or move the original texture files to user defined path (customizable).

/// 3. Update file textures' path info.

/// 4. Handle path strings. eg. replace string, add prefix, append suffix...

/// FTM's extra fuctions:

/// 1. Substitute file texture's path root string. eg. redirecting sourceiamges...

/// 2. Memory efficiency setup for textures. (BOT for Maya and .map for mentalray.)

/// 3. Filter type batch set.

/// 4. Texture file format conversion.

///

/// How to use :

///

/// Put the script in your scripts folder then start Maya. Type

/// and execute "FileTextureManager" in command line or Script

/// Editor, an UI window will appear. Then follow the help in the UI

/// window to finish your job. Have fun!

///

/// Inputs : None

///

/// Return : None

///

/// All Rights Reserved .

///////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////

///////////////////

// SCRIPT Starts //

///////////////////

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

//

// Procedure to check selection

//

proc int FTM_SelCheck(string $nodes[]){

int $sel = 0;

if (size($nodes))

$sel = 1;

else

confirmDialog -t "File Texture Manager" -m "At least one file texture node must be selected!" -b "OK";

return $sel;

}

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

// Procedure to remind user that job finished.

//

proc FTM_END(){

confirmDialog -t "File Texture Manager" -m "Job finished.\nRefer to Script Editor for details." -ma center -b "OK";

}

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

//

// Procedure to give logs

//

proc FTM_Log (string $type, string $node, string $log) {

string $finLog;

if (size($node))

$log = $node + "\n";

else

$log = "\t" + $log + "\n";

switch ($type) {

case "start":

$finLog = "\n**************************************************************************** ***********************************\n\

File Texture Manager Log starts...\n\

******************************************************************************* ********************************\n";

break;

case "end":

$finLog = "****************************************************************************** *********************************\n\

File Texture Manager Log ends...\n\

******************************************************************************* ********************************\n";

break;

default:

$finLog = $log;

break;

}

print $finLog;

}

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

//

// Get the right format of path(folder) to match current OS.

//

proc string FTM_GetPath (string $FTM_FileOrPath, string $FTM_OldPath)

//$FTM_FileOrPath Input type: file or path

//$FTM_OldPath The input

{

//Do not use 'fromNativePath' here

//that only works on Windows!

$FTM_OldPath = `substituteAll "\\\\" $FTM_OldPath "/"`;

//Only want the path.

if ($FTM_FileOrPath == "file")

$FTM_OldPath = `dirname $FTM_OldPath`;

//Get rid of the slash at the end.

$FTM_OldPath = `substitute "/*$" $FTM_OldPath ""`;

//Get the right path.

string $FTM_RightPath = `toNativePath ($FTM_OldPath + "/")`;

return $FTM_RightPath;

}

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

//

// Get the right format of input file's fullname (including path) to match current OS.

// Return a string array, the first element is the right format of the input file's

// fullname (including path), the second element is the shortname of input file (without path). //

proc string[] FTM_GetFile (string $FTM_OldFullPath)

{

string $FTM_RightPath[];

string $FTM_PathElements[];

int $FTM_PathElementsSize;

// fullname

$FTM_OldFullPath = `substituteAll "\\\\" $FTM_OldFullPath "/"`;

$FTM_RightPath[0] = `toNativePath $FTM_OldFullPath`;

$FTM_PathElementsSize = `tokenize $FTM_OldFullPath "/" $FTM_PathElements`;

$FTM_RightPath[1] = $FTM_PathElements[$FTM_PathElementsSize - 1];

return $FTM_RightPath;

}

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

//

// Analyse all the file texture nodes in current scene.

//

proc string[] FTM_FileTextureAnalyst ()

{

// All the file texture nodes maybe point to texture files in different paths(folders).

// Here I use "group" to indicate different paths , which means there are n "groups" of

// different paths if the file texture nodes point to files in n different paths.

// The trick is to have an string array $FTM_Groups[], within which every element has corresponding

// path and nodes pointing to that path are concatenated togather with a "*", which is not supposed to appear in path or name.

// Every element has a form style of "path*node1*node2*node3..."

// Leave $FTM_Groups[0] for empty path, which means node's texture file was not specified.

// Leave $FTM_Groups[1] for files without path, which means only texture file's short name was presented but path info was missing.

// All the file texture nodes found in current scene.

global string $lsCmd;

string $FTM_Files[] = eval($lsCmd);

// Different groups.

string $FTM_Groups[];

int $FTM_GroupsSize;

if (size($FTM_Files)){

$FTM_Groups[0] = "FTM_EmptySocket_FTM";

$FTM_Groups[1] = "FTM_MissingPathSocket_FTM";

}

// Figure out how many "groups" there are in current scene, and put each file texture node // into proper "group".

for ($eachFile in $FTM_Files)

{

$FTM_GroupsSize = size($FTM_Groups);

// Get the path of current file texture node

string $FTM_CurrentFullPath = substituteAll ("\\\\", `getAttr ($eachFile + ".fileTextureName")`, "/");

string $FTM_CurrentPath = dirname ($FTM_CurrentFullPath);

// File texutre was specified.

if (size($FTM_CurrentPath))

{

// Compare current path to all "groups" have been found. If matches then append current node

// to current "group" and exist the compare loop immediately.

// Remember that socket [0] is kept for nodes without texture file specified

// Remember that socket [1] is kept for nodes with texture file specified but with the path info missing

for ($j=2; $j<$FTM_GroupsSize; $j++)

{

string $buffer[];

tokenize $FTM_Groups[$j] "*" $buffer;

// Get the path of current "group".

string $FTM_OldPath = $buffer[0];

string $cmp1 = $FTM_CurrentPath;

string $cmp2 = $FTM_OldPath;

// Windows is not case sensitive to path

if (`about -nt`) {

$cmp1 = tolower($FTM_CurrentPath);

$cmp2 = tolower($FTM_OldPath);

}

// Compare current path to all "groups" have been found.

if ($cmp1 == $cmp2)

{

// Append current node to current group

string $tmp = $FTM_Groups[$j];

$tmp += "*" + $eachFile;

$FTM_Groups[$j] = $tmp;

break;

}

}

// No "group" matches means new "group" was found.

if ($j >= $FTM_GroupsSize)

{

// Create a new "group" and append current file texure node.

$FTM_Groups[$FTM_GroupsSize] = $FTM_CurrentPath + "*" + $eachFile;

continue;

}

}

// File texture was specified but the path info was missing

else if (size($FTM_CurrentFullPath)){

string $tmp = $FTM_Groups[1];

$tmp += "*" + $eachFile;

$FTM_Groups[1] = $tmp;

}

// File texture was not specified yet. Append current node to the first socket of groups

else{

string $tmp = $FTM_Groups[0];

$tmp += "*" + $eachFile;

$FTM_Groups[0] = $tmp;

}

}

select -cl;

return $FTM_Groups;

}

///////////////////////////////////////////////////////

///////////////////////////////////////////////////////

//

// Edit the UI Controls after they've been built

//

proc FTM_EditUIControl (string $FTM_OptionColumn, string $FTM_HelpForm)

{

// Operation mode

radioButtonGrp -e -on1 ("textFieldButtonGrp -e -en 0 -tx \"\" " + $FTM_OptionColumn + "|FTM_SourceDirectoryField")

-on2 ("textFieldButtonGrp -e -en 1 -tx \"\" " + $FTM_OptionColumn + "|FTM_SourceDirectoryField")

($FTM_OptionColumn + "|FTM_OperationMode");

// Set source directory

textFieldButtonGrp -e -bc ("FTM_BrowseCmd \"file\" \"" + $FTM_OptionColumn + "|FTM_SourceDirectoryField\" \"Set_S.D.\" 0")

($FTM_OptionColumn + "|FTM_SourceDirectoryField");

// Set target directory

textFieldButtonGrp -e -bc ("FTM_BrowseCmd \"path\" \"" + $FTM_OptionColumn + "|FTM_TargetDirectoryField\" \"Set_T.D.\" 4")

($FTM_OptionColumn + "|FTM_TargetDirectoryField");

// Make new folder

checkBoxGrp -e -on1 ("textFieldGrp -e -en 1 -text \"\" " + $FTM_OptionColumn + "|FTM_NewFolderNameField")

-of1 ("textFieldGrp -e -en 0 -text \"MyTextureFiles\" " + $FTM_OptionColumn + "|FTM_NewFolderNameField")

($FTM_OptionColumn + "|FTM_MakeFolderChecker");

// Add prefix

checkBox -e -onc ("textField -e -en 1 -text \"\" " + $FTM_OptionColumn + "|FTM_AddPrefixRow|FTM_PrefixField")

-ofc ("textField -e -en 0 -text \"prefix_\" " + $FTM_OptionColumn + "|FTM_AddPrefixRow|FTM_PrefixField")

($FTM_OptionColumn + "|FTM_AddPrefixRow|FTM_AddPrefixChecker");

// Add suffix

checkBox -e -onc ("textField -e -en 1 -text \"\" " + $FTM_OptionColumn +

"|FTM_AddSuffixRow|FTM_SuffixField")

-ofc ("textField -e -en 0 -text \"_suffix\" " + $FTM_OptionColumn + "|FTM_AddSuffixRow|FTM_SuffixField")

($FTM_OptionColumn + "|FTM_AddSuffixRow|FTM_AddSuffixChecker");

// Replace string

checkBoxGrp -e -on1 ("textFieldGrp -e -en 1 -text \"\" " + $FTM_OptionColumn + "|FTM_OldStringField; textFieldGrp -e -en 1 -text \"\" " + $FTM_OptionColumn + "|FTM_NewStringField")

-of1 ("textFieldGrp -e -en 0 -text \"OldString\" " + $FTM_OptionColumn + "|FTM_OldStringField; textFieldGrp -e -en 0 -text \"NewString\" " + $FTM_OptionColumn + "|FTM_NewStringField")

($FTM_OptionColumn + "|FTM_ReplaceStringChecker");

// Help description field

string $FTM_HelpDescription = "\n[Description]:\n";

$FTM_HelpDescription += " File Texture Manager works on Windows/IRIX/Linux/MAC, manages file textures in a very handy way.\n";

$FTM_HelpDescription += " FTM basic functions:\n";

$FTM_HelpDescription += " 1. Analyse scene file textures.\n";

$FTM_HelpDescription += " 2. Copy or move the original texture files to user defined path.\n";

$FTM_HelpDescription += " 3. Update file textures' path.\n";

$FTM_HelpDescription += " 4. Mentalray texture node is supported too.\n";

$FTM_HelpDescription += " FTM extra functions:\n";

$FTM_HelpDescription += " 1. Substitute file texture path's root string. eg. redirecting sourceiamges...\n";

$FTM_HelpDescription += " 2. Memory efficiency setup/unset for file textures according to their resolution. Textures larger than Threshold (in either x or y) will be set to use renderer prefered format (BOT for Maya and .map for mentalray) in setup mode. Corresponding memory-efficient file will be automatically generated if needed. When unset, all textures smaller than threshold in both x and y will be set to use normal textures, from which file the memory efficient texture was generated. BOT unset assume normal texture exist in the same directory. Mentalray .map unset will first check if the normal texture exist. If not, FTM will try to extract one from the .map file. Nodes pointing to sequences will be ignored.\n";

$FTM_HelpDescription += " 3. Set filter type to specified type for selected file nodes.\n";

$FTM_HelpDescription += " 4. Convert texture file format from \"From\" to \"To\" for selected file nodes. If \"From\" is not \"*\", only file nodes whose texture files format match \"From\" will be handled. For file nodes use image sequence as texture files, the range for conversion need to be specified, so only print out corresponding commands instead of really do the jobs. This function use Maya \"imgcvt\" and mentalray \"imf_copy\" ultility to do the conversion, so make sure them can be found in system executable path.\n\n";

$FTM_HelpDescription += "[Work Flow]:\n";

$FTM_HelpDescription += " Step 1. Analyse scene file textures.(optional)\n";

$FTM_HelpDescription += " Step 2. Select scene file textures (nodes) you want to manage by checking on the related checkers in the UI. You can also do this by your own method, Eg. select them in Hypershade.\n";

$FTM_HelpDescription += " Step 3. Set options as needed.\n";

$FTM_HelpDescription += " Step 4. Do copy, move or set by pressing related button.\n\n";

$FTM_HelpDescription += "[Tips]:\n";

$FTM_HelpDescription += " 1. Always keep 2 different version for each texture file. Eg. \"abc_LowRes.tga\" is in low resolution while \"abc_HighRes.tga\" is in high resolution. Do your job using low-res textures to speed the interactant. Just remember to use FileTextureManager to reset each file texture to point to the related high-res texture before rendering. (Add prefix, add suffix or even replace string.)\n";

$FTM_HelpDescription += " 2. The FileTextureManager's UI does not update dynamically like what Attribute Editor does, so it is better to re-analyse scene file textures each time you finish an FTM job. This is not necessary if you do not use the Analyse function at all.\n\n";

$FTM_HelpDescription += "[Notes]:\n";

$FTM_HelpDescription += " 1. Final target directory will be equal to target directory plus new folder, if user decide to make a new folder.\n";

$FTM_HelpDescription += " 2. Add suffix function has limitation on the texture file name. To be sure it work as desired, the file name must be in a regular format, Eg. \"filename.ext\", \"filename.[#...#].ext\", \"filename.ext.[#...#]\", etc.\n";

$FTM_HelpDescription += " 3. Add prfix, add suffix and replace string can be executed at the same time to each file texture. Replace string is caculated first, then add suffix, and add prefix last.\n";

$FTM_HelpDescription += " 4. It is highly recommended not to contain \".\" in prefix, suffix, old string and new string.\n";

$FTM_HelpDescription += " 5. Sometimes process fails. The reason may be various. The most possible reason could be one of or both the following two: a. Texture file is not found in the source directory; b. Permission denied on reading or writing or deleting.\n\n";

$FTM_HelpDescription += "[Details]:\n";

$FTM_HelpDescription += " 1. Analysing scene file textures let you know how many file textures there are in the scene, where there are, whether they exist or not, etc. It also allows user select all the texture files point to same path by only one simple click.\n";

$FTM_HelpDescription += " 2. How to choose operation mode depends on different source directory status. If file is there where it point to, use Automatic mode, otherwise use Manual mode.\n";

$FTM_HelpDescription += " 3. Other functions are pretty definite as marked in the UI.\n";

scrollField -e -text $FTM_HelpDescription ($FTM_HelpForm + "|FTM_HelpField");

}

/////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////

//

// judge if the input string is format extension, sequence or just part of file basename //

proc int FTM_FCWhatIs(string $string)

{

int $isWhat;

// 0 - format extension

// 1 - sequence number

// 2 - nothing, is just file basename

// 3 - bot

global string $FTM_FCAllFormats[];

$string = tolower($string);

if (stringArrayCount($string,$FTM_FCAllFormats))

$isWhat = 0;

else if (size(match("[0-9]*",$string)) == size($string))

$isWhat = 1;

else if ($string == "bot")

$isWhat = 3;

else

$isWhat = 2;

return $isWhat;

}

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

//

// judge texture file format, only according to the possible extension name

//

proc string[] FTM_FCFileRegularName(string $file)

{

$file = substituteAll ("\\\\", $file, "/");

string $fileRegularName[] = stringToStringArray(basename($file,""),".");

// try to make it like below

// [0] - file name

// [1] - the sequency number if presented, or ""

// [2] - the extension if presented, or ""

string $fileName;

string $seqNum;

string $fileFormat;

switch (size($fileRegularName))

{

case 0: // sick!!!

break;

case 1:// only file name presented

$fileName = $fileRegularName[0];

break;

case 2:// the second/last element could be sequence number, format extension or nothing;

if (FTM_FCWhatIs($fileRegularName[1]) == 0)

{

$fileName = $fileRegularName[0];

$fileFormat = $fileRegularName[1];

}

else if (FTM_FCWhatIs($fileRegularName[1]) == 1)

{

$fileName = $fileRegularName[0];

$seqNum = $fileRegularName[1];

}

else // FTM_FCWhatIs($fileRegularName[1]) = 2, which means the second/last element is just part of file basename, sick!!!

$fileName = basename($file,"");

break;

default: // there are 3 or more pieces. consider the last 2 only.

string $lastPiece = $fileRegularName[size($fileRegularName)-1];

if (FTM_FCWhatIs($lastPiece) == 0)

{

$fileFormat = $lastPiece;

$fileName = basenameEx($file);

// strip the last piece to judge again

$lastPiece = $fileRegularName[size($fileRegularName)-2];

if (FTM_FCWhatIs($lastPiece) == 1)

{

$seqNum = $lastPiece;

$fileName = basenameEx($fileName);

}

}

else if (FTM_FCWhatIs($lastPiece) == 1)

{

$seqNum = $lastPiece;

$fileName = basenameEx($file);

// strip the last piece to judge again

$lastPiece = $fileRegularName[size($fileRegularName)-2];

if (FTM_FCWhatIs($lastPiece) == 0)

{

$fileFormat = $lastPiece;

$fileName = basenameEx($fileName);

}

}

else if (FTM_FCWhatIs($lastPiece) == 3) //bot

{

$fileFormat = $fileRegularName[size($fileRegularName)-2] + ".bot";

if (size($fileRegularName) == 3)

$fileName = $fileRegularName[0];

else

{

$lastPiece = $fileRegularName[size($fileRegularName)-3];

if (FTM_FCWhatIs($lastPiece) == 1)

{

$seqNum = $lastPiece;

$fileName = basenameEx(basenameEx(basenameEx($file)));

}

else

$fileName = basenameEx(basenameEx($file));

}

}

else // really sick!!!

$fileName = basename($file,"");

break;

}

$fileRegularName[0] = $fileName;

$fileRegularName[1] = $seqNum;

$fileRegularName[2] = $fileFormat;

return $fileRegularName;

}

/////////////////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////////////////

//

// check string $inputString,replace the first (count backwards) matching string $targetPattern with string $newPattern

//

proc string FTM_FCSubstituteLastPattern(string $inputString, string $targetPattern, string $newPattern)

{

$inputString = substituteAll("\\\\", $inputString, "/");// avoid to handle "\" in the path

//strip everything behind the last string $targetPattern's existence

string $exp1 = "^.*" + $targetPattern + "+";

string $noTail = match($exp1,$inputString);

//replace the last $targetPattern in $noTail with $newPattern

string $exp2 = $targetPattern + "+$";

string $newNoEnd = substitute($exp2,$noTail,$newPattern);

//replace $noTail part in $inputString with $newNoEnd

// substitute all special characters

string $badChar[] = {"+",".","^","$","[","]","(",")"};

for ($char in $badChar)

$noTail = `substituteAllString $noTail $char ("\\"+$char)`;

string $exp3 = "^" + $noTail + "+";//take care of "\", so encode string.

string $outputString = substitute($exp3,$inputString,$newNoEnd);

$outputString = toNativePath($outputString);

return $outputString;

}

////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////

//

// to analyse the number of digits for input filename

//

proc int FTM_FCDigitsNumber(string $fileName)

{

string $fileRegularName[] = FTM_FCFileRegularName($fileName); $fileName = FTM_FCSubstituteLastPattern($fileName,$fileRegularName[1],"*"); string $filesInSeq[] = `getFileList -fs $fileName`;

int $digiNum = 0;

for ($i=0;$i

{

string $tmp[] = FTM_FCFileRegularName($filesInSeq[$i]);

if ($digiNum <= size($tmp[1]))

$digiNum = size($tmp[1]);

}

return $digiNum;

}

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////

//

// the file format converter

//

proc FTM_FCGo(int $progressUI, string $sourceFormatUI, string $targetFormat, int $handleSeq, int $updatePath, int $removeOrig)

//int $progressUI - need progress UI; 0 - No UI for progress, which is designed for command line uses.

//string $sourceFormatUI - format convert from

//string $targetFormat - format convert to

//int $handleSeq - handle sequence textures; 0 - do not handle sequence textures.

//int $updatePath - update path info; 0 - do not update path info.

//int $removeOrig - remove original textures; 0 - do not remove original textures.

{

if (FTM_SelCheck(`ls -sl -typ file -typ mentalrayTexture`)) {// if (0)

waitCursor -state on;

FTM_Log "start" "" "";

// list for file nodes to be handled

string $fileNodesList[] = FTM_FCGetMatches($sourceFormatUI);

int $isSeq[];// if it is using an image sequence as texture

int $isOneOfSeq[];// if it is using only one image of a whole sequence as texture.

string $file;// current file to be converted

string $fileFC;// current file in suitable naming for FC use

string $fileUpdatePath;// current file in suitable naming for updatePath use

string $fileRemove;// current file in proper naming for removing

// build progress feedback only in UI mode

if ($progressUI) {

// base of progress feedback setup

int $progress = 0;

int $percentage = 0;

progressWindow -t "FTM Working..." -pr $progress -ii 1 -min 0 -max `size($fileNodesList)`;

}

// executes cooresponding commands for each file node specified.

// the core process.

for ($i=0;$i

FTM_Log "" ($fileNodesList[$i]+":") "";

// build progress feedback only in UI mode

if ($progressUI){

// Check if the dialog has been cancelled

if ( `progressWindow -q -ic` ){

FTM_Log "" "User cancelled." "";

break;

}

$progress = $i+1;

$percentage = $progress * (100/size($fileNodesList));

progressWindow -e -pr $progress -st ("Handling " + $fileNodesList[$i] + " ...... " + $percentage + "%");

}

$file = toNativePath(substituteAll("\\\\",`getAttr ($fileNodesList[$i] + ".fileTextureName")`,"/"));

$fileFC = $file;

$fileRemove = $file;

string $fileRegularName[] = FTM_FCFileRegularName($file);

string $isBOT = `match "bot" $fileRegularName[2]`;

if (size($isBOT)) {

FTM_Log "" "Texture file is a BOT file. Skipped!" "";

continue;

}

string $targetFile = FTM_FCSubstituteLastPattern($file,$fileRegularName[2],$targetFormat);

// it is bad that a file has no extension to indicate its format, so add one if needed.

if (!size($fileRegularName[2]))

$targetFile += "." + $targetFormat;

$fileUpdatePath = $targetFile;

string $cmp1,$cmp2;

$cmp1 = $fileUpdatePath;

$cmp2 = $fileRemove;

if (`about -nt`) {

$cmp1 = toNativePath(tolower($cmp1));

$cmp2 = toNativePath(tolower($cmp2));

}

// skip all process if the file node was already handled before.

if($cmp1 == $cmp2)

FTM_Log "" "" "This file node was already handled before. Process skipped.";

else{ //else (1)

$isSeq[$i] = 0;

$isOneOfSeq[$i] = 0;

if (`nodeType $fileNodesList[$i]` == "file" && size($fileRegularName[1])) {

if (`getAttr ($fileNodesList[$i] + ".useFrameExtension")`)

$isSeq[$i] = 1;

else

$isOneOfSeq[$i] = 1;

}

//commands to execute

int $isMR_c = 0; //create .map file

int $isMR_x = 0; //extract .map file

if ($fileRegularName[2] == "map" && $targetFormat != "map")

$isMR_x = 1;

else if ($fileRegularName[2] != "map" && $targetFormat == "map")

$isMR_c = 1;

string $cmdFC = "system(\"";

if ($isMR_c)

$cmdFC += "imf_copy -p -r";

else if ($isMR_x)

$cmdFC += "imf_copy";

else

$cmdFC += "imgcvt -t " + $targetFormat;

string $cmdUpdatePath = "setAttr -typ \"string\" " + $fileNodesList[$i] + ".fileTextureName ";

string $cmdRemoveOrig = "sysFile -del \"";

if (!$handleSeq && $isSeq[$i])

FTM_Log "" "" "Sequence was not selected to be handled. Skipped.";

else { //else (2)

// need to handle sequence textures

if ($handleSeq && $isSeq[$i]){

string $padding = "";

for ($j=0;$j

$padding += "@";

$targetFile = FTM_FCSubstituteLastPattern($targetFile,$fileRegularName[1],$padding);

$fileFC = FTM_FCSubstituteLastPattern($file,$fileRegularName[1],$padding);

$fileRemove = FTM_FCSubstituteLastPattern($file,$fileRegularName[1],"*");

//command for sequence

if (!$isMR_c && !$isMR_x)

$cmdFC += " -n startIn endIn stepIn -N startOut endOut stepOut";

}

$cmdFC += " \\\"" + encodeString($fileFC) + "\\\" \\\"" + encodeString($targetFile) + "\\\"";

if ($isMR_c || $isMR_x)

$cmdFC += " " + $targetFormat + "\")";

else

$cmdFC += "\")";

// only do the convertion when target file doesn't exist,

// or convertion has been done before for other file node that shares the same texture.

if (`file -q -ex $fileUpdatePath`)

FTM_Log "" "" "Convertion skipped. New format texture exists, maybe convertion has been done before.";

else{ //else (3)

if (!$isSeq[$i]){

// system feedback

string $cmdFCFeedback = eval($cmdFC);

if (size($cmdFCFeedback))

FTM_Log "" "" $cmdFCFeedback;

if (`file -q -ex $fileUpdatePath`)

FTM_Log "" "" ("Convertion succeeded. Converted from \"" + $fileFC + "\" to \"" + $targetFile + "\".");

else

FTM_Log "" "" "Convertion failed. Could be file permission problem, disk capacity problem or source texture is of unknown/unsupported format.";

}

else { // for sequence, only print out command to execute.

if (!$isMR_c && !$isMR_x)

FTM_Log "" "" ("Sequence specified. Command to execute (format conversion):" + $cmdFC);

else

FTM_Log "" "" "Sequence specified. Use \"imf_copy\" to convert your tetures. A simple loop might be needed.";

}

}// else (3)

// need to update path info

if ($updatePath) {// if (1)

$cmdUpdatePath += "\"" + encodeString(toNativePath($fileUpdatePath)) + "\";";

$cmdRemoveOrig += encodeString($fileRemove) + "\";";

if (!$isSeq[$i]){// if (2)

if (`file -q -ex $fileUpdatePath`){ // if (3)

if(catchQuiet(eval($cmdUpdatePath))) {

FTM_Log "" "" "WARNING: Attribute \"fileTextureName\" is locked/connected and can NOT be modified!";

FTM_Log "" "" "WARNING: Path updating failed. So

Original Texture Removing will not be done even if it was selected to.";

}

else {// else (3)

FTM_Log "" "" ("Path updating succeeded. Set to \"" + (toNativePath($fileUpdatePath)) + "\".");

// need to remove old textures

// only remove old textures when updatePath is selected and updating succeeds

if ($removeOrig){ //if (4)

if ($isOneOfSeq[$i])

FTM_Log "" "" "Only one file of a whole sequence is used as texture, no file in the sequence is supposed to be removed.";

else if (!$isSeq[$i]){ // else if (1)

if (!eval($cmdRemoveOrig))

FTM_Log "" "" "Original texture removing failed, could be file permission problem.";

else

FTM_Log "" "" ("Original texture removing succeeded. Removed \"" + $fileRemove + "\".");

} // else if (1)

} // if (4)

}// else (3)

} // if (3)

else

FTM_Log "" "" "Convertion failed, Path Updating and Original Texture Removing will not be done even if they were selected to.";

} // if (2)

// for sequence, only print out command to execute

else { //else (4)

FTM_Log "" "" ("Sequence specified. Command to execute (update path info):" + $cmdUpdatePath);

if ($removeOrig)

FTM_Log "" "" ("Sequence specified. Command to execute (remove original textures):" + $cmdRemoveOrig);

}// else (4)

} // if (1)

} //else (2)

} // else(1)

} // for loop (1)

// feedback ends

if (!size($fileNodesList))

FTM_Log "" "No texture is of specified format." "";

// build progress feedback only in UI mode

if ($progressUI){

// finish progress feed back

progressWindow -ep;

FTM_Log "end" "" "";

// job done

FTM_END;

}

waitCursor -state off;

} // if (0)

}

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////

//

// analyse all possible file nodes to find out those match user's specification

//

global proc string[] FTM_FCGetMatches (string $formatUI)

{

string $fileNodesList[]; // list for file nodes to be handled

string $tmpNodesList[] = `ls -sl -typ file -typ mentalrayTexture`; // list for all (selected) file nodes, which need to be analyse.

if (`FTM_SelCheck $tmpNodesList`) {

string $tmpNode; // each single file node in the list

string $tmpFile; // file that $tmpNode point to.

string $format = `optionMenu -q -v $formatUI`;

if ($format!="*") {// format from specified, so only handle files with that format for ($tmpNode in $tmpNodesList) {

$tmpFile = `getAttr ($tmpNode + ".fileTextureName")`;

string $tmpFileRegularName[] = FTM_FCFileRegularName($tmpFile);

if (tolower($tmpFileRegularName[2]) == tolower($format))// extension matches, this file node need to be handled

$fileNodesList[size($fileNodesList)] = $tmpNode;

}

}

else // "*" was selected as format from, which means to handle all (selected) file nodes $fileNodesList = $tmpNodesList;

}

return $fileNodesList;

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////

//

// info transfer, just to make sure FTM_FCGo can be run in command line.

//

global proc FTM_FCGatherInfo(string $FTM_ExtraFunctionColumn)

{

string $sourceFormatUI = $FTM_ExtraFunctionColumn + "|FTM_FCRow|FTM_FCSourceMenu";

string $targetFormat = `optionMenu -q -v ($FTM_ExtraFunctionColumn + "|FTM_FCRow|FTM_FCTargetMenu")`;

int $handleSeq = `checkBox -q -v ($FTM_ExtraFunctionColumn + "|FTM_SeqCheck")`;

int $updatePath = `checkBox -q -v ($FTM_ExtraFunctionColumn + "|FTM_UpdateCheck")`;

int $removeOrig = `checkBox -q -v ($FTM_ExtraFunctionColumn + "|FTM_RemoveCheck")`;

FTM_FCGo 1

$sourceFormatUI

$targetFormat

$handleSeq

$updatePath

$removeOrig;

}

//////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////

//

// Command for Filter Setup

//

global proc FTM_FilterSetup(string $FTM_ExtraFunctionColumn)

{

string $Nodes[] = `ls -sl -typ file`;

if (`FTM_SelCheck $Nodes`) {

waitCursor -state on;

FTM_Log "start" "" "";

int $filterType = `optionMenu -q -sl ($FTM_ExtraFunctionColumn+"|FTM_FilterTypeRow|FTM_FilterTypeMenu")` -1;

string $filter = `optionMenu -q -v ($FTM_ExtraFunctionColumn+"|FTM_FilterTypeRow|FTM_FilterTypeMenu")`;

int $progress = 0;

int $percentage = 0;

progressWindow -t "FTM Working..." -pr $progress -ii 1 -min 0 -max `size $Nodes`;

for ($i=0;$i

FTM_Log "" ($Nodes[$i]+":") "";

if ( `progressWindow -q -ic` ){

Maya粒子特效-流水

Maya粒子特效-流水 本节主要学习粒子系统中基础特效水与火的制作过程。 Step01选择多边形模块面板(F3),创建- 标准nurbs-平面(注意,把“交互式构建”前面的勾去掉)如图1。 Step02这时坐标中心就出现了一个平面,选择平面在其层级面板中将缩放x、y、z值改为24,如图2,使平面与画布一样大。然后将平面沿z轴旋转-30,如图3,让平面与栅格呈30度的夹角,如图4,这个平面作为水滴落的挡板。 图1 图2 图3 图4 Step03 回到动力学模板(F5),选择粒子菜单-从对象发射,打开发射器选项,设置发射器类型为“点”,速率/每秒为100,速率为1,点击创建按钮,如图5。 Step04将发射器1沿着y轴移动15个单位,在大纲视图中选择粒子1,在菜单栏场-重力场,为粒子1添加一个重力场,如图6。 图5 图6

Step05这时粒子已经有了重力,设置播放动画为100帧。 Step06选中粒子1按住Ctrl加选平面,在菜单栏粒子-使碰撞,为平面加一个碰撞,如图7,从而使落下来的粒子碰到平面后能够产生反弹的效果,如图8。 图7 图8 Step07选择地面,在其属性编辑器中展开geoConnector2,更改弹力值为0.2,如图9。Step08选择粒子1,在属性编辑器中,将粒子的渲染类型改为斑点曲面(滴状粒子),点击当前渲染类型,将阈yu值改为1.3,如图10,点击渲染如图11(渲染器为maya软件)。Step09选择粒子1,在粒子上右键单击可以看到浮动命令条,选择指定新材质在弹出面板中选择blinn材质,如图12。 图9 图10 图11 图12

Step10在粒子1属性编辑器下的公共材质属性卷展栏下,将颜色和透明度改为如图13、14。在镜面反射着色卷展栏下,将镜面反射颜色和反射的颜色改为如图15、16所示,将反射率改为0.915。 图13 图14 图15 图16

火星时代Maya教程:眼睛建模

火星时代Maya教程:眼睛建模 今天火星时代Maya教程为您带来的是眼睛建模教程。单独画一个眼球看似惊悚,实际上却是角色中不可或缺的部分。下面我们就来具体看看。 1:这里建立一个简单的眼睛,目的是让大家怎样使得他看来真实。然后贴图,你可以贴上人或动物的眼睛图片或者自己绘制了。 在这里我使用简单的程序贴图,目的是向大家展示贴图最好的途径。 在这个教学中我假设你有一定的Maya的NURBS建模基础。 2:仔细看解剖,我们发现眼睛分为两部分:第一外面(巩膜和角膜),第二里面(虹膜、晶体和瞳孔)。我们会按照解剖建立眼球,除了晶体。 如果我们在瞳孔后面建立一个晶体,但是眼球里面是黑色的,所以根本不起作用。

3:首先建立一个nurbs球体,在x轴上旋转90度,然后切换到isoparm模式,选择离顶点最近的那条isoparm,分离曲面。删除顶端的小圆。 4:下一步添加更多的isoparm在确定眼睛的形状,我们需要在顶端建立一条isoparm,然后剪切形成瞳孔。另外两条isoparm定义巩膜的周长(也就是眼睛有颜色的地方了),最后添加一条isoparm在中间,如下图:

5:现在切换到hull模式,选择前面4个hull,按z轴移动建立一个平整的区域。

6:把中间的hull(第三条hull)向里面稍微移动,这样可以给眼睛添加一些深度。如图5。 现在选择的一条hull(也就是在顶端的那一条),向里面拖动他适当的缩放来使它围绕瞳孔: 7、眼睛里面部分已经建立,看看怎样贴图: 在hypershade建立一个新的blinn材质,材质参数如下: Eccentricity: 0.500 Specular Roll Off: 0.200 Specular Color: 1 1 1 (或有一点灰) Reflectivity: 0.000 要更加真实我们在Specular and Diffusion通道添加贴图:

NUKE与MAYA制作特效实例2

NUKE与MAYA制作特效实例: 粒子实例模拟枪弹烟尘视觉效果2--烟尘碎屑粒子 创建第三套粒子(烟尘碎屑粒子) 先分析一下烟尘碎屑粒子的产生,是基于第一套粒子枪弹打到地面,和弹坑粒子应该是在同一个发生点,所以我们定位烟尘碎屑粒子的方法和弹坑粒子是完全一样的。 1).再次建立粒子碰撞事件(建立烟尘碎屑粒子) 2).用精灵片贴图模拟烟尘碎屑效果 将粒子的渲染类型切换成精灵贴图的模式 将sprites的X,Y轴上的缩放适当调整:

接着我们为sprites赋予一个新的lambert材质球,在color上关联file贴图,把360帧长度的那个烟尘碎屑的素材指定给它。 我们会发现序列贴图的一半埋在了地面以下了,这是因为我们的默认的sprites粒子的中心点是和地面平行的,所以素材的下1/2被地面挡住了。

处理这个问题,我们在后期操作会比较简便,方法很简单,就是用后期软件把原sprites贴图处理成比原尺寸高一倍,然后把原素材往上提1/2的距离就可以了: 我们输出这个处理后的贴图,重新关联到flie上,发现,贴图的问题解决了。

接下来,我们要为sprites贴图设置序列帧循环: 勾选usd interactive sequence caching,设置start为1,end为320(320后为黑屏所以就把序列设置到320帧了),勾选use image sequence使用图像序列,设置image number的动画为: 我们播放下动画,发现序列循环没有发挥作用,我们还需要设置表达式,才能达到最后的效果。 为烟尘碎屑粒子增加属性来控制:

编辑新建属性:

Maya 流体材质用于粒子材质

Maya 流体材质用于粒子材质的方法

2.在粒子形态(不是Emitter粒子发射器)上按下鼠标右键,从弹出菜单中选择Assign New Material (指派新材质)> Fluid Shape(流体形态)。 (场景中将出现流体容器,不过在最终渲染时将只对粒子起作用) *在粒子的光影组节点中,一个流体材质替换了原粒子云材质,连接到了体积材质节点中。

3.增加流体内容至容器中,例如颜色渐变、流体发射器等。颜色渐变是流体中运算最快的方式,因此以下以颜色渐变设置为例进行说明。 4.关闭了各项属性的动力学方格,开启静态渐变方格后,修改流体形节点下的Shade属性。

?设置Dropoff Shape 为Sphere(球体),可以避免粒子产生硬边。 ?降低Quality(质量)数值减少渲染所用的时间,当最后渲染时再提高质量。 5.渲染场景。 6.修改基于年龄的粒子外观(与通常的粒子材质是一样的): 在Hypershade超材质编辑器中创建一个Particle Sampler粒子采样节点(particleSamplerInfo),并将单粒子属性(例如normalizedAge)与流体形节点的Shading区块下的属性进行连接。

* Shift+鼠标中键,将particleSamplerInfo(粒子信息采样)节点拖放到fluidShape(流体形态)节点上,ConnectionEditor连接编辑器将会出现;将ConnectionEditor连接编辑器左边框的粒子采样属性,用鼠标中键拖至fluidShape形节点属性编辑面板下的参数上(不是ConnectionEditor连接编辑器的右边框――你也找不到可连的属性)。 particleSamplerInfo(粒子信息采样)节点不同于SamplerInfo节点。SamplerInfo节点依赖于摄像机的位置信息对物体进行采样,而particleSamplerInfo节点的作用则是通过精确计算空间粒子的各项信息,然后输入其他属性至粒子材质上,仅作用于粒子。 你可以将粒子采样节点与流体形节点的Shading、Lighting、Texture区块下的任意属性进行相连,而其他属性,例如DensityScale或者Viscosity,因为它们没有获取单像素的计算方式,因此与粒子采样节点相连不会起作用。 以下是将粒子信息采样节点的OutColor连接至流体Color不同部分的渲染效果。根据连接区域的不同,会

Maya软件中PaintEffects的使用教程

Maya软件中PaintEffects的使用教程 在 3D 中制作头发效果至今仍是个难点,最常用的方法就是使用面片加上头发的纹理贴图。但这种方法难以控制纹理贴图和摆放面片物体。 Maya 给我们提供了很好的解决方法,这就是 Paint Effects :不用纹理贴图,设置简单,渲染快速,占用更少的内存。 1. 准备 首先要想好一个发型并准备一个多边形的角色头部,然后选择头部,执行 Modify->Make Live , Create->CV curve tool 。如图从头的中后方向前绘制一条曲线,这条曲线决定头发从哪里开始分缝。执行 EditCurves->Rebuild curve , Number of spans =9 , degree =3 ,显示曲线的 CV 点,将曲线命名为 hair_split_curve01 。 复制这条曲线,将第二条曲线命名为 hair_split_curve02 ,并如左下图所示与第一条曲线分开一点。如右下图所示在这两条曲线前端之间横向绘制一条短曲线,命名为 front_hair_split_curve ,不用太精确, spans 为 2 。将这 3 条曲线调整降低到头皮的下方。 2. 头发控制曲线 我们将绘制一系列的曲线粗略的表示头发的生长方向。选择头部, Make Live , CV 曲线工具,从捕捉 hair_split_curve01 前端的第一个点开始,向左绘制大约 4-6 个 CVs 。 CV 点要保证足够的数量来控制一会儿生成的头发的形状(你可以在开始的时候多建几个点,然后再删除掉多余的)。继续捕捉 hair_split_curve01 上其它的点来绘制曲线。 最终根据你的 spans 数(本篇教程为 9 )你会得到 9-11 条 hair_control_curve (头发控制曲线),选择 hair_control_curve ,调整它们的 CV 点以避免不要和头部相交,并作出发型的形状出来(这需要一定的耐心,大约要调 30 分钟左右)。效果如下图所示。将曲线群组并复制到另一边,再做一些形状上的调整。现在根据 front_hair_split_curve 绘制头发帘的控制曲线,绘制 3 条就行(注意这三条曲线的形状与左右的曲线形状要保持连续平滑的过渡)。 Maya PaintEffects 制作头发 3.Paint Effects 下面我们将添加一些头发,执行 Paint Effects->Get Brush 进入 Visor,打开 brushes/hair/ 文件夹,选择 hairRed1.mel (或其它你喜欢的样式)。选择 hair_control_curve01 , PaintEffects->Curve Utilities->Attach Brush to Curves ,这样会为 hair_split_curve01 创建一个粗糙的毛发效果。在 outliner 中将新建的这个 stroke 命名为 hair_side_stroke01 ,新的笔刷命名为 hair_side_brush 。 在 outliner 中双击 stroke 打开属性面板,在笔刷页中,首先调整 Global Scale 值,这个值的大小取决于你的头部模型的大小,我的角色总共 8cm 高,在这里将值设为 0.150 。如果你的角色高度为 160cm 的话,值应为 3 。打开 Brush Profiles 找到 Brush Width ,这个值控制从曲线长出的头发的宽度,将值设为 0.8 (不要将它设的太低,这样会使你的头发看上去非常薄)。其他的属性保持为默认。 现在在 outliner 中再次选择 hair_side_stroke01 ,并通过 shift 同时选中所有位于头部一侧的 hair_control_curve (左侧或右侧),执行 Paint Effects->Curve Utilities->Set Stroke Control Curves ,打开 hair_side_brush 属性面板, tubes/Behavior/forces 中,将 CurveFollow 设为 1 ,这样可使头发沿 hair_control_curve 生长。进入 hair_side_stroke01 ,将显示质量设为 10 左右(加速显示更新速度)。 4. 调整 Paint Effects 我们还是从头发的一侧开始。在调整时因为视图观察并不准确,所以你将需要大量的渲染测试,我建议你将渲染分辨率调到 320x240 ,并隐藏除了 hair strokes 之外的所有物体来加快渲染速度

maya眼球贴图教程

首先这里建立一个简单的眼睛,目的是让大家怎样使得他看来真实.然后贴图,你可以贴上人或动物的眼睛图片或者自己绘制了. 在这里我使用简单的程序贴图.目的是向大家展示贴图最好的途径. 在这个教学中我假设你有一定的maya的nurbs建模基础 02仔细看解剖,我们发现眼睛分为两部分,第一外面(巩膜和角膜),第二里面(虹膜,晶 体和瞳孔).我们会按照解剖建立眼球,除了晶体.

如果我们在瞳孔后面建立一个晶体但是,眼球里面是黑色的,所以更本不起作用 03首先,建立一个nurbs球体,在x轴上旋转90度.然后切换到isoparm模式,选择离顶点最近的那条isoparm,分离曲面.删除顶端的小圆

04下一步添加更多的isoparm在确定眼睛的形状.我们需要在顶端建立一条isoparm,然后剪切形成瞳孔.另外两条isoparm定义巩膜的 周长(也就是眼睛有颜色的地方了),最后添加一条isoparm在中间.如下图.

05现在切换到hull模式,选择前面4个hull,按z轴移动建立一个平整的区域

06把中间的hull(第三条hull)向里面稍微移动,这样可以给眼睛添加一些深度.如图5 现在选择的一条hull(也就是在顶端的那一条),向里面拖动他适当的缩放来使它围绕瞳孔 07眼球里面部分已经建立,看看怎样贴图. 在hypershade建立一个新的blinn材质,并第一个眼睛.材质参数如下: eccentricity: 0.500

specular roll off: 0.200 specular color: 1 1 1 (或有一点灰) reflectivity: 0.000 要更加真实,我们在specular and diffusion通道添加贴图. 下面建立一个ramp节点并连接到blinn材质的color属性

MAYA特效课程标准

《MAYA特效》课程标准 学分:4 学时:54 适用专业:动漫设计专业 一、课程的性质与任务 课程的性质:本课程是动漫设计与制作专业核心课程,《影视特效》的前导课程为色彩构成、平面构 成、平面设计等艺术设计基础课程和影视理论,主要是对学生进行设计基本素质的培养,提供学习职业技 能模块课程的平台,为专业核心技术课程奠定基础。后续课程是以影视基础技术为主,主要包括了摄影摄 像技术、素材制作、配音与音效、动画后期剪辑软件Premier、等课程及实习实训课程。该课程对学生职 业能力培养和职业素养养成起主要支撑和促进作用,且与前、后续课程衔接合理。 课程的任务:针对高职高专教育教学的特点,与企业和行业专家共同开发设计,注重与后期专业课内 容衔接,适应高技能人才可持续发展的要求;突出职业能力培养,按照行业企业的标准,体现基于职业岗 位分析和具体工作过程的课程设计理念,以真实工作任务或产品为载体组织教学内容,在真实工作情境中 采取工学交替、任务驱动、项目导向等教学模式,充分体现职业性、实践性。 前导课程:MAYA建模 MAYA动画美术构成 二、教学基本要求 本课程的最终目标是使学生学习使用该软件以理论与实践相结合的方法,由浅入深循序渐进的掌握 MAYA特效、输出等基本应用技巧。 三、教学条件 本课程全程在计算机实训室完成,计算机硬件要求,软件环境 MAYA2010 AE 。英特尔酷睿2四核Q6400(四核)CPU CPU缓存:L2缓存、4MB*2;英特尔酷睿2四核 Q6400(四核)CPU CPU内核:64位技术、EM64T、核心类型、Kentsfield(四核心);英特尔酷睿2四核 Q6400(四核)CPU CPU频率:总线频率、1000MHz 四、教学内容及学时安排

3Dmax眼 球制作

眼球 1、创建一NURBS球体,旋转90度。属性中将跨度数改为6。 2、在眼球前方插入等参线。如下图所示: 3、进入控制点,将前面往前拖拽一下。如下图: 4、再插入一条等参线,如下图: 然后选择刚添加的等参线,然后右键进入壳,将等参线往左边调整。效果如下: 5、创建一多边形圆环,分段数为40、10.并将其压扁一点,放置于如下位置:

6、创建一多边形球体,删除一半的面,然后将另一半放置于如下位置:(目的是为了遮挡 光) 7、选择整个眼球,打组,将其调整到网格上面,然后再创建一个平面作为桌面。 8、为瞳孔添加贴图。除了瞳孔之外的物体添加到图层,隐藏。然后,单击瞳孔—UV编辑器, 查看UV,发现UV不合理,则重新进行二次UV处理,单击创建UV下面的平面映射旁边小盒子进行如下设置: 9、赋予模型Lambert材质,然后为其属性中颜色链接瞳孔贴图。然后,调整UV,将贴图完 全贴到模型表面。效果如下:

10、选择瞳孔里面的半圆,赋予Lambert材质,将颜色调为黑色。效果如下: 11、将眼睛外形显示出来,创建一盏聚光灯,进入灯光视图调整角度和位置,然后将灯 光调大一点,打开灯光属性,将半影值调为20,衰减调为10,打开光线跟踪阴影,并将阴影半径值(Light Radius)改为0.5,阴影光线数(Shadow Rays)改为10,使用mantal rey渲染器进行渲染,效果如下: 12、复制一盏辅灯,将灯光强度减弱,颜色调为淡蓝色,关闭灯光阴影,再进行渲染。 暗部还是有点黑,再复制两盏辅灯,放置与如下位置:

渲染效果如下: 13、选择模型,赋予blinn材质,单击材质属性中透明度后面的棋盘格,添加渐变纹理, 并将渐变色调为白色到黑色渐变。渲染效果如下: 14、将渐变属性中的类型(Type)改为U Ramp,再渲染效果如下:

Maya粒子特效

Maya特效 一、Dynamics模式,Particles菜单 1、Particles Tool通道盒,Particles Settings Number of particles 一次创建粒子数目 Maximum radius 最大粒子半径,决定一次创建的粒子间距 Sketch interval 粒子流量,数值越大,粒子越稀疏 Create particle grid 创建粒子网格,点击创建一个粒子点,再在对角线创建一个粒子点,回车,则会生成一个矩形粒子平面。如果创建一个粒子长方体,则在侧视图中,按住D键,把第二个创建的粒子点向上提,回车即可 2、Create Emitter创建粒子发射器 Emitter type :Omni 全方位发射;Directional方向性发射;Volume体积发射 Cycle Emission:默认关闭,打开后粒子呈线性发射 3、Make Collide 创建碰撞。选择粒子,加选地面,执行命令。选择地面,Ctrl+A打开通道盒,geoConnector1菜单下,Resilience是反弹,Friction是摩擦系数 4、Emit from Object 从物体发射粒子,创建发射物体,选中物体,执行命令。 实现粒子呈现图片:创建一个面片,执行Emit from Object命令(Emitter Type 改成Surface),打开particle通道盒,emitter1菜单下Normal Speed改为0(使得粒子吸附在面片上),然后emitter1菜单那下面Particle Color选项,点击后面的棋盘格,连接需要的图片,并勾选下面的Inherit Color和Inherit Opacity两项。在particleShape1菜单下的Add Dynamic Attributes中点击Color按钮,勾选第二项Add Per Particle Attribute,并在emitter1 菜单下将Rate(Particle/Sec)值改大,点击播放,即可实现粒子呈现图片效果 实现粒子导火线效果:创建一段CV曲线,创建一个圆环,加选CV曲线,执行Surfaces Extrude的通道盒,勾选每个参数的最右一个选项(除最后一项选NURBS),确定,挤压出一段导火线。透视图中,选中CV曲线,属性栏中,subCurve2属性下对Min Value值K帧,第1帧时数值为0,第300帧时数值为0.9,此时即实现导火线渐渐消失效果。选中导火线最开始的一圈CV控制点,执行Emit from Object命令,添加粒子拖尾。 5、Use Selected Emitter 创建两个发射器,最初都能发射粒子,删掉A的发射器,删掉B 的粒子,选择A的粒子,加选B的发射器,执行此命令,则B的发射器可以发射A的粒子 6、Per-Point 当在NURBS圆环上发射粒子的时候,执行此命令,可以调节使得不同的CV 点发射的粒子数目不同 7、Goal 粒子的目标追踪,创建一个粒子发射器,创建一个球,选中粒子,加选物体,执行Goal命令,则粒子被吸引到球附近运动,可模拟蜂群在蜂巢附近的状态。

maya建模图文教程

[建模教程] MAYA制作动画人物头发教程详解 1 MAYA, 头发, 动画, 详解, 教程

maya里人物头发的几种一般做法: 1.面片+贴图. 2.长发用pfx--先用curves 编制发型,再将stroke粘贴到引导曲线上生成头发;短发用fur. 3.插件. 4.maya 6以后增加的hairSystem. 其中1,2是传统做法,网上教程已经很多了;3,根据需要看插件的help.本教程只讨论第4种做法,使用maya默认渲染器和pe进行渲染. 先总结一下使用maya hairSystem制作发毛的一般流程,也就是maya help里面建议的一般流程: 1.制作一个具有良好uv分布的面片以生成毛发。 2.在该面片上生成hairSystem。

3.编辑hairSystem的start curves,rest curves,使hair定型。 4.制作constraint,进行动力学解算。 5.动画。 理论上这个流程是可行的,但实际制作是却非常麻烦,主要原因是第3步,用正常的方法编辑start curves生成需要的发型是比较困难的。 下面我介绍一种用nurbs面片生成头发的引导曲线制作发型的方法,然后再用一个具体例子说明hairSystem在制作,运动,渲染时一些要注意的地方。 1.用任意方法制作一块nurbs面片,注意uv的起始位置在头发的根部(画黄线的地方) 2.选取多个isoparm,然后duplicat surface curves 3.不要删除历史,选择这些curves,然后Hair-Make select curves dynmic 4.选择生成的follicle,在属性里把point lock改成Base(默认是锁定2端) 5.现在你移动时间轴,可以看到这些curve可以运动了

maya 特效

教学大纲maya特效 a) 《2012》中的特效 b) 《阿凡达》中的特效 一、特效的概念

在当代电影的语境里面,“特效”(Special Effects,简称SFX、FX 或SPFX)一词涵盖的范围越来越广,一般包含两个部分:“现场特技”和“视觉特效”。 电脑动画影视特效技术(后面简称为特效)现在已经成为影视制作过程中一个重要的组成部分,在影视制作过程中使用数字虚拟技术为影片添加虚拟的场景、虚拟的道具、虚拟的角色以及用常规方法无法实现的特效镜头。它为现代电影的制作提供了各种虚拟的元素,给观众带来超强的视觉冲击力和视听享受。现在的电脑动画影视特效在实拍的电影电视中所占比重越来越大,几乎包含了除真人实景拍摄之外的所有元素。 数字特效技术的迅猛发展,使得我国三维动画产业近些年呈现较快的发展势头,伴随着国内三维动画创作质量的不断提高,形成了三位动画产业全方面发展的格局。 maya特效的类型: (1)Maya动力学 动力学(Dynamics)是物理学的一个分支,它描述对象的移动方式,动力学动画使用物理学原理来模拟自然力。动力学主要应用在粒子和流体特效里 (2)Maya 流体 流体动力学是Maya较为出众的功能,它使用流体解算器模拟运算出所有效果 (3)Maya毛发 Maya毛发由二个模块构成:Fur和Hair。 Fur(皮毛)是Maya 2008 Unlimited版的一个组件,在多面的NURBS模型及多边形模型中,用户可以使用它来创建逼真的、有阴影的皮毛和短发,也可以使用它设置皮毛的属性,如颜色、长度、光秃效果、不透明度、起伏、卷曲和方向,或在局部为皮毛贴图。

MAYA影视广告特效制作中玻璃爆破特效

BLASTCODE是美国FerReel动画研究公司开发的,专门用来制作三维中复杂的爆炸,破碎,崩溃等特效的插件。 BLASTCODE的应用范围: 1.破碎特效。(玻璃,冰块的破碎效果) 2.爆炸效果。(将物体炸开) 3.崩溃爆破效果。(房屋,墙体的倒塌,破碎效果) 案例1.限制破碎范围的碰装破碎 小球碎玻璃 首先,我们要确定好自己的机器是否已经安装了BLASTCODE 1.5版本的插件 确保启动BLASTCODE菜单正常,下面开始操作了 首先,我们要在MAYA中创建一个NUBRS的平面,注重,BC插件的破碎功能只能对NUBRS起作用 在这里,首先创建一个UV分段数为1的NUBRSPLANE,将它垂直放置

在这个场景中创建一个小球,作为我们的碰装物体,设置整个动画为100贞,我们的碰装物体不参与破碎,所以可以将它设置为POLYGON物体,这个物体要保证其动画是从NUBRSPLANE中穿越过去的

由于BLASTCODE使用了一套NOVODEX PHYSICS动力学引擎,所以我们需要将MAYA中的所有物体导入到这个引擎中进行解算. 操作步骤如下,选择我们的NUBRSPLANE,在BLASTCODE菜单中打开BLASTWINDOWS,单击NEWCONTROL,将我们的NUBRS面片导入到引擎中,这样我们获得了BLASTLAYER1的破碎层

将小球设置为物体爆炸物,关联到这个破碎层上,产生了户动影响效果

选择BLASTLAYER1,创建随片层 将BLASTLAYER1隐藏掉,在目标可视里勾选隐藏

进入碎片的SLAB属性中,我们设置厚度为0.02 并指定贴图位置为BlastCode1.5\examples\sourceimages\lesson6_cracks.iff

Maya粒子特效实验一

实验一:粒子特效制作实验报告 课程名称影视特效Maya 专业班级 学号 姓名

实验项目实验一:粒子特效制作实验 实验时间2020.3.16 1-2节实验地点钉钉网上视频实验 一、实验目的 通过对粒子的创建、粒子属性的编辑及动力场的运用,熟悉粒子特效的制作方法和原理。 二、实验环境 1.满足三维动画软件运行的台式电脑及windows操作系统; 2.三维动画软件:maya2015以上版本。 三、实验内容 1.学生自行准备一段视频素材,素材内容要求适合进行粒子特效制作; 2.由学生根据自身能力设计并制作粒子效果,粒子效果可以是爆炸、沙化、流水、烟雾等特效; 3.特效作品的时间控制在5-10秒以左右。 4.完成的动画渲染输出为成品文件并提交,尺寸规格不小于600dpiX800dpi,视频格式为*.MPEG。 四、作品说明 1.打开Maya,新建场景。如图1所示: 图1

2.并在Maya中准备好模型场景,添加nparticle 创建粒子发射器,新建粒子,将粒子的寿命,粒子的大小的参数进行调整。如图2所示: 图2 3.对于前面做的模型进行粒子动画,打开字段解算器,打开重力场,将重力属性的幅值,衰减,方向进行调节。如图3所示: 图3 4.对于粒子进行参数设置,然后将水流设置成水流的状态,最后添加材质。 如图4所示: 图4

5.最后渲染出来并导出为视频,打开渲染设置,将文件输出改为视频格式文件,将帧的范围进行调节。如图5所示: 图5 6.将导出的素材导入AE中里如图6所示: 图6 7、在AE中将png的素材图片拖入时间轴面板中进行调整合成,将粒子水流和素材进行调整,最后导出为avi视频格式。如图7所示: 图7

MAYA建模教程:怎么使用maya软件做人体眼睛模型

MAY A建模教程:怎么使用maya软件做人体眼睛模型 这篇教程教maya爱好者们用maya制作眼球,这篇教程比较系统的介绍了用maya制作眼球的方法,希望对朋友们有所帮助。先来看看效果图1: 具体的制作步骤如下: 先参考一下眼睛结构图,这样会比较明确眼睛的结构。图2

第一步 先创建两个球体,把其中一个缩小再压扁,另一个保持不变。 这样左边比较小又扁的是角膜,右边比较大的是眼球。图3 第二步 将比较小又扁的球体放至在大的球体的前方。因为眼睛最表层处是角膜。图4 第三步 再从侧面图,把黄色部份的面给delete(删除)。图5

第四步 这样角膜就做好了,选择刚刚眼球有跟角膜重叠的面。图6 第五步 在edit polygons菜单下的extract命令,可以将选好的面跟眼球分开来。图7

第六步 把分开后的物件,记得要把history清干净。 再用center pivor这个命令,将坐标至于对象中心。 选取对象中间的面(黄色部份),用在edit polygons菜单下的extrude face命令来挤压出新的面。8 第七步 由左而右:角膜、虹膜和瞳孔、眼球,这样就完成了。图9

第八步 因为虹膜和瞳孔是一体成形,所以在画贴图的时候,就可以一起处理。 蓝色的部份是虹膜,黑色的部份是瞳孔。图10 第九步 因为角膜是透明的,角膜的表层有结膜和湿润感,所以在做质感的时候,要记得做的有点水水的,有点反光的感觉。图11

第十步 把角膜、虹膜和瞳孔、眼球组合一下,眼睛就完成了。图12 总结:Maya是全英文的,所以你必须记住里面的英文。maya相对3Dmax来说比较难,如果你只是自己的兴趣想自学的话,你可以去找一些相关教程来练习。

Maya特效—喷泉

Maya特效—喷泉 本节主要学习粒子系统的基础知识,了解场中的重力场效果,制作出喷泉效果。 Step01从状态栏的菜单选择Dynamics(动力学)模块,快捷键F5。 Step02从菜单栏Particles-Create Emitter- (粒子-创建发射器- ),打开Emitter Options(创 建发射器)窗口,调整Emitter type(发射器类型)为Directional(方向发射器)类型,将Rate (发射率)设置为1000,Speed(速度)设置为5,单击Create(创建)按钮,新建一个发射粒子系统,如图1所示,此时在网格中心会出现一个粒子发射器,如图2所示。 图2 图1 Step03将动画播放范围结束时间为200如图3所示,单击软件有下角的按钮,打开Preferences(参数)窗口,选择Settings(设置)下的Time Slider(时间滑块)选项,将Playback (播放)栏下的Playback speed(播放速度)设置为Pealtime[24fps]如图4所示。 图3 图4 Step04单击软件右下角的向前播放按钮播放动画,此时发射器就会沿着X轴方向发出一道粒子,如图5所示。

图5 Step05打开大纲视图,选择Emitter1(发射器1),Ctrl+A打开属性编辑器,在Distance/Direction Attributes(距离/方向属性)卷展栏下,将Direction(方向)Y调整为1,XZ为0,扩散值改为0.3如图6所示,现在就可以看到向上喷射的效果,如图7所示。 图7 图6 Step06选中喷射的粒子,点击Field-Gravity (场-重力)里面参数不用修改,直接点击Create(创建)按钮,大纲视图可以看见这个重力场标志,如图8所示。点击动画播放按钮,可以看到如图9所示效果。 图8 图9 Step07选中喷射的粒子,Ctrl+A打开属性编辑器,在Lifespan Attributes(寿命属性)卷展栏下,将Lifespan Mode(寿命模式)改为Random range(随机范围),Lifespan(寿命)改为3,Lifespan Random(随机寿命)改为1,如图10所示。

MAYA动画实训报告

实训报告 实训名称: maya项目实训 院系:计算机科学与工程学院 专业:数字媒体技术 班级: 0907102 学号: 090710205 姓名: 指导教师:程梦君 开课时间: 2012 至 2013 学年短学期 常熟理工学院计算机科学与工程学院制 一、实训题目 第二大陆第一区 二、实训目的 配合课程学习,通过创作写字楼漫游动画将课程内容进行综合运用。 三、设计要求 按组进行动画的创意和设计,要求有一定的创新性和较高的技术含量。 四、创意设计 在做场景之前我们首先需要了解做建筑漫游动画应该注意的一些基本问题。比如首先要 对本次设计要有一个明确合理的计划和分工。动画制作分为建模、材质、灯光、渲染等步骤, 前期工作是后期动画的基础,我们在前期确定了一个大致的计划表:分组进行建模、将需要 建模的大任务分配给每个成员、将模型进行组合、有人负责制作材质贴图为模型赋予材质, 最后进行动画的制作并渲染输出。每个步骤都有明确的时间安排和人员分工。并且同学之间 进行交流与合作,使每位同学都能通过自己的亲身实践,熟练动画制作的过程和所用的技术。 建模是三维制作的基础,其他工序都依赖于建模。离开了建模这个载体材质、动画以及 渲染等都没有了实际的意义。所以这次漫游动画首先要考虑的就是建模,而此次建筑漫游动 画的设计与制作对建模的要求尤其重要,因此模型创建的任务十分的繁重而重要。 模型建好之后并不能是物体表现出十分真实的效果,为使模型比较逼真,因此为对象赋 予合适的材质是三维创作的关键,材质及环境的烘托是表现作品思想的重要手段。材质主要 用于描述物体如何反射和传播光线,它包含基本材质属性和贴图,在显示中表现为对象自己 独特的外观特色。它们可以是平滑的、粗糙的、有光泽的、暗淡的、发光的、反射的、折射 的、透明的、半透明的等,这些丰富的表面实际上取决于对象自身的物理属性。maya中的材 质是一个比较独立的概念,它可以为模型表面加入色彩、光泽和纹理。所有的材质都是在[材 质编辑器]中编辑和制定的,一般三维软件中的材质都是虚拟的,和真实世界中的物理材质的 概念不同,最终渲染的材质效果与模型表面的材质特性、模型周围的光照、模型周边的环境 都有关系,材质除了和灯光、环境有 紧密的联系外,还和渲染器有着密切联系。 因为有了光,我们才能看到自然界中的东西,要在三维设计中制作出好的三维场景,除 了场景模型建得精细、材质做得逼真、观察角度取得适当外,还必须为场景制作出仿现实的 光照效果。灯光制作是三维制作中的重要组成部分,在表现场景、气氛等方面发挥着至关重 要的作用。当模型和材质都做好之后,物体已经能基本表现其形态,但看起来还是不够真实, 在场景中还不能完全的显示其真实的物体质感,为使物体能够更加真实的表现出现实生活中 的光泽和质感,更加的逼真,灯光的添加十分重要,在三维场景中灯光的目的是为了表现一 种基调,有助于表达情感,引导观众的眼球到特定的位置,使场景展现丰富的层次感。灯光 是maya中的一种特殊对象,它本身不能被渲染显示,只能在视图操作时被到,但它却可以影

Maya特效—五彩小球

Maya特效—五彩小球 本节主要学习粒子系统的基础知识,以及在maya中动力学表达式的一些用法。 Step01从状态栏的菜单选择Dynamics(动力学)模块,快捷键F5。 Step02从菜单栏Particles-Create Emitter- (粒子-创建发射器- ),打开Emitter Options(创 建发射器)窗口,调整Emitter type(发射器类型)为Omni(点发射器)类型,单击Create (创建)按钮,新建一个发射粒子系统,如图1所示,此时在网格中心会出现一个粒子发射器,如图2所示。 图1 图2 Step03将动画播放范围结束时间为200如图3所示。 Step04单击软件右下角的向前播放按钮播放动画,此时发射器就会发出很多粒子,如图4所示。 图3 图4 Step05在场景中选择发射器,进入其通道盒(层级编辑器),将Rate(发射率)设置为200,Speed(速度)设置为5,如图5所示,此时播放动画可以发现射出的粒子运动状态与刚才大不相同了,速度明显加快了。

图5 图6 Step06在场景中选择发射出来的粒子,按Ctrl+A键打开其属性编辑器,选择ParticleShape1标签,在Render Attributes(渲染属性)卷展栏下,将Particle Render Type(粒子渲染类型)设置为Spheres(球形),如图6所示,此时场景中的粒子就变成了球形,如图7所示。Step07仍然在Particleshape1标签下找到Add Dynamic Attributes(添加动力学属性)卷展栏,单击Color(颜色)按钮,在弹出的Particle Color(粒子颜色)窗口中勾选Add Per Particle Attribute(添加每粒子属性)选项,单击Add Attributes(添加属性)按钮,如图8所示。 图8 图7 Step08此时,在Per Particle (Array)Attributes(每粒子(阵列)属性)卷展栏下就多了一个RGB PP的属性,如图9所示。 Step09在RGB PP属性的输入栏上单击鼠标右键,从弹出的菜单中选择Creation Expression (创建表达式)命令,如图10所示。 图9 图10

Maya 中制作和烘培AO贴图的基础教程

这是一个在Maya 8中制作和烘培AO贴图的基础教程。有些步骤可能与较早的版本里的菜单名不同。 大部分的东西在Maya中可能有很多不同的方法可以做到,但是这个方法很合理和快速很适合我。 1. 设置材质节点 - 首先打开hypershade窗口,使用鼠标中建将SurfaceShader节点从节点列表内拖入至工作区域 - 点击"Create Maya Nodes"(下图中蓝色圈中部分)改变为Menta Ray节点列表 - 然后展开T extures栏,用鼠标中建将mib_amb_occlusion节点托至工作区。

- 这里都是废话了,简单的讲就是看下图... 把两个节点的OutValu属性和OutColor属性链接起来 2. 设置场景 - 为了得到更好效果的AO贴图,场景的环境色必须是白色。在大纲中选中渲染用的摄像机后Ctrl+A 在属性编辑器里将Environment栏的背景色滑条拖动到100%的白色。

- 废话太多精简为:在全局渲染属性窗口里将渲染器改为MentalRay,然后将multi-pixel filter 改为Lanczos方式

- 关掉渲染设置窗口后将Surface Shader材质应用到模型,这个时候模型将会变成黑色。 3. 调整 - 废话太多,精简:渲染很快... 颗粒很多... 如下图:

- 废话省略N字。在HyperShade里选中AO节点Ctrl+A 把Samples改成256

4. 烘培至贴图 一旦有了AO渲染效果就更好,下一步就是烘焙至贴图了。 - 指定一个项目文件夹。file> Project> Set ... 我想这里不用翻译了。用Maya不知道制定项目,那么Maya就白学了.... - 确定已经为模型展好了UV。 - 确定模型的法线设置。不然贴图烤出来可能是黑的哦... - 确定模型的软硬边... - 记得备份场景哈 - 点选菜单Lighting/Shading > Batch Bake (Mental Ray) > Options box(文字后面那个方块) 看下图,其他的大部分设置一般不用动了..

maya特效教程:刚体、柔体、场

第2章刚体、柔体、场 本章将介绍Maya特效中的刚体、柔体和场。 刚体是具有碰撞体积的多边形物体或者是NURBS物体。利用刚体可以模拟对象物体之间碰撞等相互作用力的效果。亦可以利用刚体动画模拟不会产生形变或者形变很小的物体,如金属、钻石等。动力学的刚体系统为刚体动画提供了很好的解决方案。参考光盘中的场景文件scenes\chapter2\rigid.mb可以对刚体有一个初步的理解。 多边形模型或者NURBS模型产生的柔软的物体,在动力学中称之为柔体。制作者可以对柔体进行变形动画,使之像自然界中的柔体一样产生褶皱和凸起等变化,用来模拟譬如布料、涟漪等效果,可参考光盘中的场景文件scenes\chapter2\soft.mb。 场是对自然界的驱动力的一种模拟。场可以驱动粒子、刚体、柔体等动力学物体进行运动。它是改变粒子动画形态的主要方式。 本章主要内容: 刚体、场和柔体的基本概念及创建、编辑命令。 ●刚体、柔体和场的命令及属性认识 ●主动刚体和被动刚体的区分 ●通过属性控制使刚体和柔体达到不同的动态效果 2.1.刚体 刚体是转化为刚直外形的多边形曲面或NURBS曲面。与常规的曲面不同,在动画过程中,刚体会相互碰撞,而不是相互穿过。刚体分为主动刚体与被动刚体,主动刚体在没有受到力的作用下,是静止不动的;而被动刚体在任何情况下皆是完全静止不动的。 2.1.1.创建刚体 Maya中可以从单个或多个对象创建刚体。 1.从单个对象创建刚体 将Maya的状态栏切换到Dynamics(动力学)标签,选择要创建刚体的对象,然后通过Soft/Rigid Bodies(刚体/柔体)>Create Active Rigid Body (创建主动刚体)或Soft

maya教程程序贴图制作眼睛

maya教程程序贴图制作眼睛 日期 2010年6月14日星期一发布人来源管理员 这里建立一个简单的眼睛,目的是让大家怎样使得他看来真实.然后贴图,你可以贴上人或动物的眼睛图片或者自己绘制了.在这里我使用简单的程序贴图.目的是向大家展示贴图最好的途径.在这个教学中我假设你有一定的maya的NURBS建模基础 仔细看解剖,我们发现眼睛分为两部分,第一外面(巩膜和角膜),第二里面(虹膜,晶体和瞳孔).我们会按照解剖建立眼球,除了晶体.如果我们在瞳孔后面建立一个晶体但是,眼球里面是黑色的,所以更本不起作用

03.首先,建立一个nurbs球体,在x轴上旋转90度.然后切换到isoparm模式,选择离顶点最近的那条isoparm,分离曲面.删除顶端的小圆

04.下一步添加更多的isoparm在确定眼睛的形状.我们需要在顶端建立一条isoparm,然后剪切形成瞳孔.另外两条isoparm定义巩膜的周长(也就是眼睛有颜色的地方了),最后添加一条isoparm在中间.如下图.

现在切换到hull模式,选择前面4个hull,按z轴移动建立一个平整的区域

06把中间的hull(第三条hull)向里面稍微移动,这样可以给眼睛添加一些深度.如图5.现在选择的一条hull(也就是在顶端的那一条),向里面拖动他适当的缩放来使它围绕瞳孔

07眼睛里面部分已经建立,看看怎样贴图. 在hypershade建立一个新的blinn材质,并第一个眼睛.材质参数如下: Eccentricity: 0.500 Specular Roll Off: 0.200 Specular Color: 1 1 1 (或有一点灰) Reflectivity: 0.000 要更加真实,我们在Specular and Diffusion通道添加贴图. 下面建立一个ramp节点并连接到blinn材质的color属性

相关文档
最新文档