Uncategorized

Deleting Faces After Skinning in Maya

Posted by:

Did you know that deleting faces after skinning messes up your skin weights?  It does!  I have been working in a team that is creating characters with layers of clothing.  This presents interpenetration issues.  So we are deleting the underlying faces that will be concealed by higher layers of clothing.  My solution was to delete faces last after all the skinning.  That way we could quickly go back and add or subtract faces we needed.  But it messes up the ...

Continue Reading →
0

Maya GUI button commands, how they work, Maya Scripting

Posted by:

I was a bit confused on how Maya GUI button command calls work.

It seems that when I was following tutorials they put the variables from the GUI into the parameters for the call which of course meant that they needed to be in the definition too.

After working with Maya GUI interactions for a while I realized that information that is derived from the GUI need not be included in the parameters because they are derived directly from the GUI interface, ...

Continue Reading →
0

Passing single objects into functions, getting operations on the name string rather than the object itself

Posted by:

When I first started passing single objects into functions and loops I found that python(maya) was treating them as the strings of the object’s name rather than the object itself.

 

This error depends on how the variable of the object is structured.  If it is a single object in a list then you will get this problem.  The solution is to simply encapsulate the variable in a list when you call the function:

function([object])

Continue Reading →
0

Maya Error Message: Invalid arguments for flag ‘startJoint’. Expected string, got [ unicode ] # Maya, Python

Posted by:

I was working on a function that setup IK handles and I got this error message:

Invalid arguments for flag ‘startJoint’. Expected string, got [ unicode ] #

It turns out that even though the item being passed to the ikHandle() command was not specified as being a list, that is how it was being read.
This may be something peculiar in python, it seems that python may treat anything added to a selection as an array item even if the item is ...

Continue Reading →
0

Create Null Above Object, Rename Null to Reflect Child Name – Python, Maya

Posted by:

Rename a list of objects using the selection list’s object names in the rename, add a suffix or prefix.

import maya.cmds as cmds

selectionList = cmds.ls( selection=True ) #create a list of object from your current selection

for selectionListObjects in selectionList:

null=cmds.group(empty=True)
nullName = cmds.rename(null, selectionListObjects + ‘Null’)
print newName
cmds.parent(selectionListObjects,nullName)

 

Continue Reading →
0

connectAttr of one selection to another python maya

Posted by:

This takes the 1st selected attribute of an object and connects it to the second object’s attribute:

# HIKConnections
import maya.cmds as cmds

selectionList = cmds.ls( selection=True ) #create a list of object from your current selection

”’connects the first attribute in the function to the second. Note the format of the array then the plus sign then the single quotes and the attribute, interestingly this contains a string as the variable”’
cmds.connectAttr(selectionList[0] + ‘.customVisibility’, selectionList[1] + ‘.visibility’)

 

Continue Reading →
0