Custom Controls

Video 1.1: Custom Controls 03 The Custom Controls (0:48 mins)
 

[iframely]http://www.youtube.com/watch?v=N11nHxKSTAY[/iframely]

Video Notes

This section is for those wanting to add custom controls to auto rigs. Rapid Rig Modular is great but adding extra controls for single joint chains adds many nodes to the rig slowing it down. It’s cleaner to create simple controls ourselves. These controls can either follow the rig’s joints or the mesh itself. Buttons following the shirt (stomach) when a character breathes or even eye brows or eyelashes moving with facial expressions can be achieved. There’s loads of versatility in this setup for customised control.

Download The Custom Controls
Download the custom control maya files, each file has a different control curve.

(Right Click Download)
Ball Custom Control
Cube Custom Control
Pin Custom Control

Revision 3 Simple Joint Curve Creation
Version 3 of this tutorial simplifies the creation of the joints a lot. All we need with this version is a grouped joint. The control curve is parented as a shape node. Parenting shape nodes in Maya just be done with scripts and it’s not particularly intuitive. But this method requires less nodes and is clean. Joints can be parented into the rig and we can even tweak selection highlighting.

Selection Highlighting is on by default in Maya. This means that if we select a parent the children will highlight in white. Interestingly in recent versions of Maya you can switch this to off and custom. We’ll be changing to custom in this section.

1. Place curves and joints in the pivots desired. Match them so they share the same pivots exactly.
2. Parent the curve as a shape node of the joint and group the joint. (use the script)
3. turn selection highlighting off (script)

Done!

Scripts Below

group joint and curve control as shape
# this script parents a selected joint to a curve, but groups the curve and orients the curve to match the joint
# select joint then curve then run script
# know Issues, joint mustn’t be the root object
import maya.cmds as cmds
from zoo.zmaya import align_utils

#record selection and put in an array
sel = cmds.ls(selection = True)

#get objects source and master and make variables
jointObject = sel[0]
curveObject = sel[1]

#find parent of joint
cmds.pickWalk( jointObject, direction=’up’ )
sel = cmds.ls(selection = True)
parentObject = sel[0]

print “parentObject = ” + parentObject

#rename curve to joint name and add _jnt
cmds.select( curveObject, r=True )
cmds.rename(jointObject + ‘_ctrl’)
curveObject = (jointObject + ‘_ctrl’)

#parent curve to joint
cmds.parent( curveObject, jointObject )

#freeze transforms on curve
cmds.makeIdentity( curveObject, apply=True, scale=True, rotate=True, translate=True )

#create a grp and match position to the joint
cmds.group( em=True, name=(jointObject + ‘_grp’) )
groupObject = (jointObject + ‘_grp’)
align_utils.alignSimple(groupObject, jointObject)

#parent grp to parent, curve to grp, joint to curve
cmds.parent( groupObject, parentObject )
cmds.parent( curveObject, groupObject )
cmds.parent( jointObject, curveObject )

parent curve as shape
# this script parents a curve shape to a joint,
# note curve can’t be parented to joint
# select curve then joint then run script
import maya.cmds as mc

#record selection and put in an array
sel = cmds.ls(selection = True)

#get objects source and master and make variables
sourceObject = sel[0]
print “sourceobject = ” + sourceObject
masterObject = sel[1]
print “masterobject = ” + masterObject

#parent source to master
cmds.parent( sourceObject, masterObject )

#freeze transforms on source
cmds.makeIdentity( sourceObject, apply=True, scale=True, rotate=True, translate=True )

#select shape nodes of source
sourceShapes = cmds.listRelatives(sourceObject)

#parent sourceShapes to maqsterObject transform
cmds.parent( sourceShapes, masterObject, s=True, r=True )

#delete source transform
cmds.delete( sourceObject )

Selection Highlighting Off
#selection highlighting
# selection highlighting on selected objects, so children don’t light up when you select the parent
#prefs must be set to
# Settings > Animation > Modifiers > Selection Child Highlighting: Use object highlight setting
import maya.cmds as cmds
for s in cmds.ls(sl=True, type=’transform’) or []: cmds.setAttr(‘%s.selectionChildHighlighting’ % s, 0)

Video 1.2: Custom Controls 01 Scalelssue (5:00 mins)
 

[iframely]http://www.youtube.com/watch?v=vZTvC3QUwYc[/iframely]

Video Notes

How The Scalable Custom Control Works
The first step is to build the custom control. You can download them (above). The following video shows how to build them manually and how they work.

The main issue of these controls is inheriting scale in a rig.
– We don’t want to just parent the controls to the rig, due to visibility/selection issues
– Scale constraints are problematic and don’t necessarily scale properly with joints

Video: Scale Constrain Problem for Control Curves
*Please note there is an issue with this setup which I’ve amended in the next video

Video 1.3: Custom Controls Ammendment01 Scale Fixed (3:00 mins)
 

[iframely]http://www.youtube.com/watch?v=Cjrz2JOsfns[/iframely]

Video Notes

*Video: Amendment to the Scale Setup

The solution is to parent a locator to the rig’s skinned joint then scale and parent constrain the curve control to this locator. Finally a new joint can be constrained to the curve control. That new joint can control appendages, cloth, anything attached to the character and will scale if the character is scaled.

Video 1.4: Custom Controls 02 Building The Custom Control (8:52 mins)
 

[iframely]http://www.youtube.com/watch?v=QuSgkZWeSHE[/iframely]

Video Notes

Video: Solution To Parenting Controls For Scale

Video 1.5: Import the Custom Control (0:48 mins)
 

[iframely]http://www.youtube.com/watch?v=Bz66yvZWUuQ[/iframely]

Video Notes

Adding Custom Controls To An Auto Rig’s Joints
This setup will parent the custom control to a joint in the rig, allowing it to inherit the scale of the rig.

Import the Custom Control

Video 1.6: Delete namespaces then rename the custom controls (1:50 mins)
 

[iframely]http://www.youtube.com/watch?v=PAvoxFQh0L8[/iframely]

Video Notes

Delete namespaces then rename the custom controls

Video 1.7: Position the custom Control with the locator (1:28 mins)
 

[iframely]http://www.youtube.com/watch?v=Rq6KidZ_Bvo[/iframely]

Video Notes

Position the custom Control with the locator

Video 1.8: Parent the locator to the rig (2:22 mins)
 

[iframely]http://www.youtube.com/watch?v=ZAV6TLkPRQI[/iframely]

Video Notes

Parent the locator to the rig

Video 1.9: Amendment to the Scale Setup (3:00 mins)
 

[iframely]http://www.youtube.com/watch?v=Cjrz2JOsfns[/iframely]

Video Notes

Amendment to the Scale Setup
This is the same video as under section: “How The Scalable Custom Control Works”

Video 1.10: Skin the desired object and delete the cube placeholder (1:41 mins)
 

[iframely]http://www.youtube.com/watch?v=0s2LpFaeC-0[/iframely]

Video Notes

Skin the desired object and delete the cube placeholder

Video 1.11: Tidy the scene and organise the outliner neatly (2:02 mins)
 

[iframely]http://www.youtube.com/watch?v=v09vTRfdf8E[/iframely]

Video Notes

Tidy the scene and organise the outliner neatly

Video 1.12: Optional disable scale inherit (1:26 mins)
 

[iframely]http://www.youtube.com/watch?v=IE8F5Q2wYMU[/iframely]

Video Notes

Optional disable scale inherit

Video 1.13: Custom Controls On Follicles Setup (2:29 mins)
 

[iframely]http://www.youtube.com/watch?v=AaiQ0EzjbB0[/iframely]

Video Notes

Constraining Custom Controls To Meshes (Clothes and Appendages)
This setup is very similar only we’ll be parenting the control to a mesh via a hair follicle. this means the control can move when the object is deformed, say by blendshapes etc.

Custom Controls On Follicles Setup
Follow the steps above in “Adding Custom Controls To An Auto Rig’s Joints”. Belpw the video shows a customised belt setup. We’ll create follicles to have the belt move with the mesh in the videos following.

Video 1.14: Create a hair_follicle on a UV'd mesh (1:54 mins)
 

[iframely]http://www.youtube.com/watch?v=GJhStBI05Yg[/iframely]

Video Notes

Create a hair_follicle on a UV’d mesh

Video 1.15: Delete parent constraint remake to the hair_follicle (2:18 mins)
 

[iframely]http://www.youtube.com/watch?v=ZAivvjODjLE[/iframely]

Video Notes

Delete parent constraint remake to the hair_follicle

Video 1.16: Clean Outliner (0:56 mins)
 

[iframely]http://www.youtube.com/watch?v=23db1PNYLM0[/iframely]

Video Notes

Clean Outliner

Video 1.17: Tweaking The Scale Inherit (3:01 mins)
 

[iframely]http://www.youtube.com/watch?v=O2rvDg9Fgtg[/iframely]

Video Notes

Video 5. Tweaking The Scale Inherit

Leave a reply