Website powered by

Change Shape Script

General / 12 April 2017

Hi everyone, it’s been a while.

I’ve been hard at work on a game project that I’m helping out on and with other college-related activities. Something I find myself doing a lot is I changing rig control shapes, especially since at this point the auto-rig scripts I’m using are ones I wrote months ago that use some clunky shapes.

On a side note, I’ll be re-writing those auto-rig scripts this summer with a whole lot more attributes that I learned from all the rigging I’ve done this year. I’m trying to make my life as easy as possible.

So! Back to the script. This script intelligently gets the world size and position of the shape you want to replace by accessing the its BoundingBox scale and Center. Besides that, I’m doing everything pretty standard. I’m using a polyCube for my cube shape object, so I have to turn off Shading and all the render stats associated with polygons, but it’s pretty basic. The only thing an animator might get annoyed by is just hiding Curves in the viewport won’t hide all the control on the rig. But you can’t have everything (and use the attribute I give you for that, anyways!)

Here’s the script. I’m uploading my scripts on GitHubGist now because they read better and can be downloaded easier if you’d like.

Gist Link

Rendering a Head in Arnold

General / 16 February 2017

Responsible for all parts

As some of you may know, alongside Technical Art, I’m studying 3D modeling at San Jose State University. This double-focus has really benefited my rigging work, especially in artistic and anatomical ways. And as always, I always find my technical art knowledge coming in handy as I model.

I made a couple of discoveries in this project, most notably on how to quickly make some realistic hair. I knew about Arnold’s ability to render curves from doing rigging research, and I knew about its nice hair shader, so I set out on trying to figure out how I could make hair using that technique.

import maya.cmds as cmds
# convert hairs to renderable curves
for obj in cmds.ls(sl=1):
s = cmds.pickWalk(obj,d="down")

cmds.setAttr(s[0] + ".aiRenderCurve",1)
cmds.setAttr(s[0] + ".aiCurveWidth",.02)
cmds.connectAttr("eyebrow_shader.outColor",s[0] + ".aiCurveShader")
cmds.setAttr(s[0] + ".aiOpaque",0)

So there are a couple of attributes you have to keep in mind. Under the shape node for each curve, you have to enable it to be rendered by Arnold. You can adjust the render width of it, assign it a shader, and disable “opaque” so that it can have opacity. I wrote this quick for loop to allow me to do this to the hundreds of hairs all at once.

The only thing I don’t know how to do yet it taper and opacity fade. For now, however, this is better than anything I’ve been able to wrestle out of nHair or xGen…

The eyes have a few tricks in them too. They’re just using standard Arnold shaders, but the Cornea has Opaque disabled and its opacity (found under Refraction) turned all the way down. A high spec weight and falloff allows it to have that nice wet reflection. I drew a curve on the eyeballs (as a live surface) and used a similar technique to how I rendered the hair to give the really nice “wetness” border between the eyeball and the eyelid. I’m not sure if there’s a medical name for it, but it’s that tiny line of water… Everyone has it and it’s a really good detail to add to eyes, and with Arnold’s render curve feature it was incredibly simple to do.

The head uses a 3 layer Shallow/Mid/Deep Subsurface Scattering setup. The thing I found is the SSS will REALLY soften your features up, so if you want any hard painted attributes on your face you’re going to have to have it be really high contrast.

Besides that, good topology, lighting (I used a 3 point area light setup with an HDR sphere around it all) really helped me. I’m really excited to see where this project goes!

– Ben

Smart Null-Attribute Script

General / 30 January 2017

Here’s a quick script that I wrote during my last rigging project. For every object in the selection, it gets the keyable attributes and their defaults and sets those attributes to their defaults.

It works on default and user-defined attributes. I have it mapped to a hotkey (ctrl+0) and it really speeds things up!

 

 import maya.cmds as cmds   # bm_nullAttr # sets channel box values to default for every object in selection. Works on default and custom attributes.  # get the selection def nullAttr():     sel = cmds.ls(sl=1)     for obj in sel:         # list the keyable attributes on that object         keyable = cmds.listAttr(obj, k=1)         for attr in keyable:             # find each attribute's default value and set it             default = cmds.attributeQuery(attr, node=obj, listDefault=1)             cmds.setAttr(obj + "." + attr, default[0])   

Solomon Rig 2.0

General / 30 January 2017

After some feedback, I chose to re-work most of the Solomon rig. I had to fix some flipping problems in the wrists and forearms that was being caused by poor rotation orders, so that meant that I had to completely re-skin the body. Unfortunately, mirroring skin weights doesn’t work very well on this model so I basically had to do the whole thing manually -_-

I also re-did the whole face. This time, I edited the model and made the face a separate mesh from the body so that the blendshapes wouldn’t take up so much memory. I chose almost a completely blendshape-based approach, which gave nice shapes but not as much flexibility as the wire deformer approach on the previous version. There are always trade-offs.

For my next rig, I want to try the Josh Sobel method of facial rigging that I learned from his vimeo tutorial series. It involves “World” and “Local” rigs that are skinned mostly with joints. It’s fast, flexible, and scalable, something that my blendshape-based approach can’t compete with.

Besides that, I also needed to fix some shearing problems with the teeth and gums. They were likely caused because I didn’t self-group the geometry before constraining it to the jaw controls.