Friday, 5 December 2014

Skinning

Now that each limb is rigged I have connected the hierarchy for the the rig. Making sure that each limb goes with the correct body part it should do. After that I began the process of skinning.

(Incoming mini rant, skip to after bullet points for actual important stuff)
I encountered a major problem at this stage which prevented me from moving on to the skinning for a few days. The paint script weights tool did not like me and would refuse to show joint influences on the model. I tried different skinning options on different computers on different versions of different models (also resetting all maya settings). I also messed around with every available option in the tool and checked all display options available to me in the scene. Not only that but even the lists of joints was unresponsive and would sometimes show and sometimes not. I tried troubleshooting this via the internet and it seems like a very common problem but no one method of fixing it. A lot of people had got it working through re-skinning it, or toggling an option on and off but I couldn't get it to work.

But after a lot of playing around I had discovered my method to fix it which I noted down so I would remember for future uses:

  • 'Smooth Bind' with 'Normalize Weights' set to 'Post'
  • Open 'Paint Skin Weights Tool'
  • Set 'Normalize Weights' to 'Interactive'
  • Select vertex on mesh
  • Select 'Show influences on the selected verts'
Then the influences would magically appear. The weirdest method ever but if it works I'm not complaining. Unfortunately the colour ramp options were broken for me and would only appear in orange but at least I had something.


The above picture shows the result of the initial skinning, as expected. I have went through the joints and flooded out influences where not needed and fixing any major "you shouldn't be there"s. By keeping normalise weights on means I was able to avoid any "jumps to the origin" or unexpected movement.


I have done some work on fixing volume issues such as on the knees and a little bit on the spine. The skinning progress as it stands right now is each part of the body is moving with the part of the body it should be and that there are no crazy deformations. Volume loss is still present on the elbows and wrist twist. The feet don't bend so great right now and more time is needed to fix up the smoothing on the rather detailed mesh.

The head and neck are pretty much fine but the jaw is moving a lot of what it shouldn't and not deforming naturally. I've used a surface soft select to get the lips separated but I've not went into any detail fixing it yet.

I've tested using wrap deformers on the clothes to make sure they bind and move with the mesh and it seems to work as expected, even covering up some of the bumpy work I've got on the spine joint influences (but that's cheating).

Moving on from here is simply fixing up anything I've mentioned so far as well as trying out as many poses as I can to make sure every controller is deforming the mesh correctly.

Thursday, 27 November 2014

Scripting Tool Interface

I have already got a good idea of how I want the user interface for my script to work so I have been able to build this using python scripting. The functionality of the tool is non existent but you can get a better understanding of how it might be interacted with.

I had some trouble getting the layout I wanted initially. The 'columnLayout', 'gridLayout' and 'rowLayout' options weren't working out for me and using tabs or drop down frames wasn't what I wanted either. To get a move on with the interface I used a 'formLayout', although it took slightly longer to code it was easier to get the result I wanted.

The interface itself is pretty close to the sketch I did earlier and I think overall should be easy to understand by any user familiar with Maya.


In the first section of the layout the user can select the type of control shape they want to make, by default it is a 'General Handle' which in this case is a NURBS circle. A 'Rotator Handle' can also be chosen which I described in my last scripting tool progress blog post.

For both shape types their radius can be chosen in the text input box and I've also included a check box here if you want to setup an orient constraint connecting the shape and joint. I initially had this feature locked to the rotator handle only but quickly decided it would necessary to orient constrain shapes other than the rotator type.

A separator separates the shape type options with the additional options. This currently includes the ability to colour the control shape. Right now I plan to have the colour automatically selected and applied depending on where the joint is: blue on the left side, red on the right side and yellow for central shapes. As a more advanced feature I could allow the user to select the colour themselves through a colour selection UI but for now I'm happy with the automatic as it will be useful in my own rigs.

Locking translation controls is also useful especially for joints with an orient constraint so this will simply lock and hide the translation attributes from the control shape.

In addition I've included the option to override the automatic name given to the control shape. The script to create control shapes which we used earlier in the semester automatically names the control shape after the joint. My thought behind the custom name was where when I used this script in the past I sometimes wanted a different name for the shape. Example: a control shape assigned to jnt_head_2 might want to be called ctrl_head_top.

I think the userface's design resembles that of what most Maya windows look like. I've also contained both the 'Create' and 'Add' buttons at the bottom (many maya windows have this) where they both apply the create operation but 'add' keeps the window open so you can perform multiple uses of the tool.

My next step is to simply implement the creation of control shapes into the buttons, then work down the list of features on the window adding in the relevant functionality.

Wednesday, 26 November 2014

Pseudocode

For the functionality of my scripted tool I've written some pseudo-code (in python format) that will guide me in programming later on.

This handles functionality of creating control shapes as well as user interface elements.
  • import maya commands
  • define function name_check_select
    • enable name_input textField
  • define function name_check_deselect
    • disable name_input textField
  • define function create_control
    • joint_name from selection
    • joint_name_stub = replace "jnt" with "" in joint_name
    • current_ctrl_shape = "ctrl" + joint_name_stub
    • current_group = "grp" + joint_name_stub + "offset"
    • radius = radius_input from textField
    • if radio_general radioButton is selected
      • create nurbsCircle with name current_ctrl_shape and radius of radius
    • if radio_rotator radioButton is selected
      • create nurbsCircle with name current_ctrl_shape and radius of radius
      • delete history on current_ctrl_shape
      • duplicate current_ctrl_shape with temporary name circle_1
      • duplicate current_ctrl_shape with temporary name circle_2
      • rotate circle_1 by 90 degrees in X axis
      • rotate circle_2 by 90 degrees in Y axis
      • freeze transformations on circle_1
      • freeze transformations on circle_2
      • parent the shape node of circle_1 to current_ctrl_shape
      • parent the shape node of circle_2 to current_ctrl_shape
      • delete circle_1 transform node
      • delete circle_2 transform node
    • create a group with name current_group for current_ctrl_shape
    • parent current_group to joint_name
    • set rotateX attribute on current_group to 0
    • set rotateY attribute on current_group to 0
    • set rotateZ attribute on current_group to 0
    • set translateX attribute on current_group to 0
    • set translateY attribute on current_group to 0
    • set translateZ attribute on current_group to 0
    • unparent current_group from joint_name
  • if window wnd_control_maker exists
    • delete wnd_control_maker
  • create wnd_ctrl_maker
  • create buttons, radioButtons, text and textFields
  • position buttons, radioButtons, text and textFields on form
  • show wnd_control_maker

Tuesday, 25 November 2014

Scripting Tool Ideas

For my scripting tool the idea I wanted to make was an assisting tool to making control shapes.

For the character rigs in my Professional Project the control shapes are mostly for FK rotation rather than the IK solvers used in my rig for this module.

I've found that the easiest rotation control shape looks like the rotate tool itself which is made up of 3 circles. To make this manually is on the complicated side and even requires the use of a command.

How this control shape is made is by creating a NURBS circle, duplicating it twice and rotating them into position. You then freeze transformations on these circles and delete their history. To combine them you combine their shape nodes under the main circle's transform node. Then, it is like any other control shape that requires grouping and positioning.

I would also like to include other options such as locking translation controls, automatically Orient Constraining the joint to the shape and colouring the control shape.

This is a sketch of an interface I'd like to aim for, it also includes some notes on the functionality of the script.

Looking at Other Scripts

For inspiration into my own scripting tool I did some research into other tools out there that are designed to assist in the rigging process.

There is definitely a lot out there, ranging from simple scripts that can solve a simple problem to complex tools that can automate most of the rigging process. The type of tools and where they are used can vary, with some tools being used to interact with a fully built rig, to others that help build the rigs.

Here's a few I found with some notes on their uses in relation to my own work so far.

Display Color Override

A neat little script that displays a colour index UI used for easily selecting a colour. This is used for objects such as control shapes to change their colour rather than having to go into the attribute editor and using the slider to find the colour you are looking for.

Radial Blend Shape


Useful tool that assists in setting up facial deformers such as eyelids and eyebrows. The deformer is suited to keeping eyelids deforming properly (i.e. over the eye).


A similar scripting tool to what I imagine I want to create. This is quite extensive offering multiple shape options, a colour selection grid and additional options such as auto/manual name toggle and adding text.

This script only creates the control shapes for future use in rigs, it doesn't apply them to any joint.


Create a full rig or a specific part of a rig, can rig characters in any position and is fully scalable. Allows IK/FK switches and other features.

One of the many auto-rigging tools out there, this was created by a student. Is pretty comprehensive but other auto-rigging tools have gone much further.




The only scripting tool on this list that costs money. This is a UI designed to enhance animation and allows the user to save out poses on a character rig. It also allows you to mirror a pose across the body and to transfer poses to other rigs.

It also acts as a picker allowing you to select control shapes from a user interface. This script is by far the most advanced and comprehensive script on this list but it does have dependencies on other tools.

This is a companion tool to the Rapid Rig: Advanced script (another auto rigging tool). Poser tools are often tied to the rigs they are designed for.

Thursday, 20 November 2014

Blend Shapes

As my character rig is for animated films rather than games, I will be using a blend shape system for facial controls over a joint based system. Blend shapes work a bit like keyframes, where you set multiple poses on different faces, then on the main face controller you can blend between them.

The 'MikeAndTina' and rig I've mentioned previously uses blend shapes combined with a floating interface for interacting with these blend shapes. For now I've built the control shapes and will consider any user interface as an advanced feature later on.

As the mesh for my characters face is included in the mesh for her entire body, I had to extract the head from the body to be able to use as a blend shape. I used this YouTube video to work out how to extract the head. I discovered an issue with my character model that was seemingly unique to this model whereby when I cut the head from the body using 'Detach Component' the skin shader would seemingly trip out and produce a strange pattern. I tried troubleshooting many ways to fix this including removing all shaders, applying new ones, changing display modes and looking at vertex colouring but there seemed to be no fix. I had to re-import the skin mesh from another exported version of the character model for it to work. Thankfully it did work out in the end but I still haven't worked out where the issue came from.



Once my the head was detached and duplicated, I re-combined the original meshes (making sure to do so correctly without changing the vertex names) and merged the vertexes back together on the joint. The duplicated head would not be a blend shape itself but would be a base mesh for blend shapes to come off from that. The base head would then connect itself to the main mesh so to transfer the blend deformations over when used.

Blend shapes is another thing that a lot of time could be spent on. Many rigs that use blend shapes have a comprehensive selection of deformations that can be controlled. As my time was limited and I wanted to move on to skinning I decided to create a selection of blend shapes that would cover most facial expressions but that may not be as extensive as other rigs. However if time was given, creating more blend shapes from the base head is always a possibility.


In total I have 14 blend shapes that control the opening of each eye, the raising of each eye brow, mouth raise on both sides, a pout and wide mouth position, and a few more.

The soft selection tool came in handy here, in surface mode it was useful for opening the eyelids as well as deforming the shape of many facial features.

If I were to add more blend shapes I could add more deformers to the eye brows to change their shape, controls for cheek muscles, more mouth deformers, nose deformers and more eye lid deformers. All of these take time so I will consider adding more later if time permits.

Tuesday, 11 November 2014

Spline IKs and IK Solvers

My rig's skeleton and control shapes are progressing well but I've fallen behind on adding in IK solvers. I've taken the time to set these up before moving into the advanced features and setting up the hierarchy of controls.

I should mention I have now set up my spine. This uses a Spline IK connecting the bottom and top of the spine joints. Clusters are added to control three different parts of the spine. The middle controller automatically positions itself between the other two controllers.

Using the connection editor I've also added twist and roll setup to the spline controllers for additional functionality.

I had some trouble with this whole procedure having to re-do the process when I didn't correctly position the control shapes. I almost had to re-do the procedure again but using freeze transformations on the controllers (which had somehow again de-positioned themselves) I was able to avoid that. This is something that could be automated easily for a scripting tool. I may want to consider that if it decides to break again.

I've had to return to IK solvers as somehow was unable to build them when they were discussed in class initially. I think this has to do with how long it took me to do the set driven key (which is quite tedious) and learning the ropes about building control shapes.



Its been a while since IK solvers were mentioned so I've looked over the documentation on them and brushed up my knowledge on how to build them. I've now added IKRP solvers on the legs and arms, and two on each feet to stop them from rotating when I move the legs. These extra IK solvers will be used when I add advanced attributes to the feet later on.

Another issue to mention here is that my character model's feet point out to the side a bit instead of straight ahead. This along with the joint orientation means when adding in a pole vector constraint the leg tends to rotate out of position. I was initially unable to fix this (others had this problem and scripts were being used) but I just translated the rotator along and it rotated the foot back into position (although not back in the exact same position, I remember this is not entirely necessary, it was good enough). It does mean my knee locators are not located in front of the knee but instead are a little bit off to the side. But if the feet are not pointing forwards then the knee isn't either so I am happy this will be fine to work with.

I had the same issue with the wrists snapping out of place when adding a pole vector constraint but learned that adding an orient constraint between the joint and the wrist first before adding the constraint meant no joint movement occurred.