Method for Multiple UV Tiles in Maya (2018)

Tutorial / 23 May 2021

Setup a layered texture node feeding whatever channel (diffuse) for example.
Layer your image files into the layered texture.
Select all of the image nodes and go to the attribute spread sheet.  Turn all default color RBG values to 0
For each 2D placement node, turn off Wrap U and Wrap V
In the Attribute Editor for the Image Node:
Set UV Tiling Mode to Explicit Tiles
Change the U and V values to reflect each image's placement along the UV tiles.
The coordinate system is 0 based so if you had your head texture on the second UV tile (one right of the default)  the values would be U=1 V=0
Generate preview

Tiffs Crash Maya When Using Multiple UV Maps

General / 23 May 2021

I don't know why, but just use PNG

Accessing data in json lists python

Tutorial / 23 May 2021
for eachEntry in rigData:
     controllerName = eachEntry
     #print('eachEntry is: ' + str(eachEntry))#The name for each list 
     for eachList in rigData[eachEntry]:
         #print('eachList: ' + str(eachList))#The values of each list in the root of data 
          for eachListEntry in [eachList]: 
               print('eachListEntry: ' + str(eachListEntry))#This is the value for each key in each list 
               for eachKey, eachValue in eachListEntry.iteritems(): 
                    print('eachKey: ' + str(eachKey))#This is the value for each key in each list 
                    print('eachValue: ' + str(eachValue))#This is the value for each key in each list


Note, Artstation's janky code format doesn't allow for tabbing, so copy and paste may not work, you may need to re-establish the tabs.


Python Format for Outputting to JSON

Tutorial / 23 May 2021
skeletonRoot = cmds.ls(selection = True) skeletonList = cmds.listRelatives(skeletonRoot, allDescendents = True, type = 'joint') skeletonList.append(skeletonRoot[0]) skeletonList.reverse() 
space = " " * 4 
for eachJoint in skeletonList: 
     print(space + '"' + str(eachJoint) + '":')
     print(space + "[")
     print(space * 2 + "{")
     print(space * 3 + '"' + "ControlsList" + '"' + ":" ' "' + "worldSpaceController" + '"')
     print(space * 2 + "}")
     print(space + "],")

Note, Artstation's janky code format doesn't allow for tabbing, so copy and paste may not work, you may need to re-establish the tabs.

Export an FBX from Maya using Python

Tutorial / 23 May 2021

There are a fair amount of people out there who have weighed in on how to do this in various forums but I didn't find a single one that actually worked despite them being voted as the solution. Perhaps they worked in previous versions of Maya. I don't know, but I got this solution by sure educated guess, trial and error. This works as of Maya 2018: 


def exportMeshes(*args): 
     nameField = cmds.textField(shipNameTextField, editable = True, query = True, text=True)
     projectDirectory = cmds.workspace(query = True, directory = True) 
     print('The projectDirectory is: ' + str(projectDirectory)) savePath = str(projectDirectory) + nameField cmds.sysFile(savePath, makeDir = True) cmds.file(savePath, exportSelected = True, type = 'FBX')

The code above creates a new folder in your project named by a text field in a form. I didn't include the form. If you need to know how to build a form and query a textfield just search on my site for textfield and you will find info on how to do that. Cheers!

Note, Artstation's janky code format doesn't allow for tabbing, so copy and paste may not work, you may need to re-establish the tabs.

Create a Directory from Maya Python

Tutorial / 23 May 2021

def directoryCheckMake(): directoryExists = os.path.isdir(savePath) if not directoryExists: cmds.sysFile(savePath, makeDir = True)

Generate a list of joints from a skeleton in Maya, cut and paste into a python list

Tutorial / 23 May 2021

skeletonRoot = cmds.ls(selection = True)
skeletonList = cmds.listRelatives(skeletonRoot, allDescendents = True, type = 'joint') skeletonList.append(skeletonRoot[0]) skeletonList.reverse() space = " " * 4 for eachJoint in skeletonList: print("'" + str(eachJoint) + "'")