Autodesk Maya Tutorial - Assign Different UVs Per Texture

Published: 07 May 2022
on channel: renderBucket
10,917
130

Summary:
This video will go over how you can map each node or file texture to a different UV Channel or Coordinate of a Mesh. You can do this through UV Centric Relationship Editor but that dialog will not always shows all files/textures. For certain things like displacement this method will allow you to use the node editor to map each displacement or texture to a specific UV Channel/Coordinate of each mesh.

Patreon:
  / renderbucket  

Discord:
  / discord  

Some Sample Python Code To Get You Started If You Want To Potentially Automate This

----

import maya.cmds as cmds

Object You Want To Map To Different UV Channel/Slot
getSel = 'pCube1'

Channel You Want To Use
channel = 1

Get Shading Group Connected To Object
mtlList = cmds.listConnections(cmds.listRelatives(cmds.ls(selection=True), s=True), type='shadingEngine')
print(mtlList)

Get Texture Connected To Color In Material
shading_node = cmds.listConnections(mtlList[0][:-2] + '.color')
print(shading_node)

Get 2D Texture Node Connected To Color Texture
place2d = cmds.listConnections(shading_node[0] + '.uvCoord', type='place2dTexture')
print(place2d)

Create A UV Chooser Node
uvChooser = cmds.shadingNode('uvChooser', asUtility=True)
print(uvChooser)

Connect UV Chooser Node To Place 2D Texture uvCoordinate
cmds.connectAttr(uvChooser+'.outUv', place2d[0]+'.uvCoord', force=True)

Connect Objects Chosen UV Channel To The UV Chooser
cmds.connectAttr(getSel+'.uvSet['+str(channel)+'].uvSetName', uvChooser+'.uvSets[0]', force=True)

---


Watch video Autodesk Maya Tutorial - Assign Different UVs Per Texture online without registration, duration hours minute second in high quality. This video was added by user renderBucket 07 May 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 10,917 once and liked it 130 people.