PyQt: Maya Character Picker

Example of a fully featured character picker using the magic of PySide

Texture Based Deformer

Deform a mesh based on the colour values derived from a procedural texture

Visibility Node v2.0

A tool to help visualise hidden mesh objects by utilising componentModifiers

UV Based Blendshape Conversion

Convert blendshape targets on meshes with differing topologies

Python and PYQT Image Compare Tool

Investigation into writing a standalone application that can be compiled and run within Windows

Thursday, 9 August 2018

RBF Character Conversion

Not more RBF stuff!? Oh yes! Recently I extended the use of the RBF Bind Retargeter to include mesh retargeting.

Similar to the bind retargeter this tool will make use of two source meshes to perform the retarget but instead of joints fed into its hungry mouth a set of conversion meshes will be offered up. For instance a male figure, a female figure and a set of clothing built for the male. If successful the tool should retarget all the clothing to fit the female.
The character modeling department was very happy about this as it extends the use of our NPCs and other simple character types without creating them any remodeling work. It can also work with pretty much anything - bangles, watches, hats, t-shirts, jackets, armour onto taller, shorter, fatter, thinner, different shaped limbs etc.
However in the rigging department this would mean we have a sudden backlog of new NPC meshes to skin. They may be simple but it still takes time to do as there are lots of files to process and...... repetition = time to write a tool :-P.

So rather than bothering the character modelers and rigging department with any part of the process I decided the tool should take a male NPC file and transfer everything to a female counterpart including any skinning, lod’ing and rig behaviours. Obviously the bulk of the work would still be the main retarget but now this would include a number of other steps. Deriving skinning, adding a skeleton with its automation intact, checking for and re-creating LODGroups and maintaining the scene structure
The prerequisites for this tool would be a male to female source file which would contain the two topologically identical counterparts which the retarget requires for its calculations. A skeleton for the female which is built using the previous Bind Retargeter tool. By making this a separate step I was able to add in any functionality the skeleton file requires in addition to the retarget such as the automation, and by doing this to the one file I would avoid having to go back into each and every retargeted female file and add in the skeleton automation
In addition to the above I would also require a set of source assets for retargeting such as clothing or accessories and a basic UI to allow me to batch the task over any number of files whilst I go off for a croissant and a cup of coffee.

So to sum up the pre-requisite steps consisted of:

Creating a conversion file - the male to female topologically identical examples

Creating a female base skeleton - rather than consuming time wrapping this into the process which would repeat multiple times I use the older Bind Retargeter to generate the skeleton and add in the basic automation. This is only done once

Sets of clothing intended for the original male, skinned and on a skeleton with the same joint count.

After completing and running this tool it succeeded in rebuilding and exporting dozens of NPC parts into our game engine without anyone having to work on them. Check out the video below for a quick example of the tool doing its 'thang'.

Retargeting Character Geometry using RBF from SBGrover on Vimeo.

By the way, if you wish to read up a little more on RBF which is the core element of this retarget process then take a look at this site. It belongs to an ex-colleague of mine and I think he wraps up some of the basics very nicely. I still check this out when I forget how the process works. Additionally this site is a great place for checking out the workings a little more deeply. It has some code examples which you could use to practice with.

Monday, 6 August 2018

PyQt Character Picker

I finally got my lazy ass into gear and posted up my example of a character picker. This is used by our animation department who happily don’t seem to have much in the way of complaints about it.
In this post I will run quickly through the main tool. In a further post I will describe the building process in a little more detail.

The tool is built using PyQt. The main display runs on an QGraphicsView which takes a list of shapes stored in a json file rebuilds them as QGraphicsPolygonItem before display. These shapes are simply a stored set of points with extra details such as colour, functionality and applied commands. These are all derived from the building process within Maya where a set of curve objects are created to define the appearance of the picker view. It is during this creation process that the behaviors of the picker items are also defined before being written out to the json file which then becomes available for that character or object whenever it is loaded into a scene.
When an animator runs the viewer it looks in the scene for an attribute that holds the path to the json file. There is usually one per character but there can be any number of these for any use case. We use them for complex characters but it could be also be utilised for anything such as a set of basic props or more complex mechanical objects. The tool lists the characters in a drop down and switches it’s visual context based on which one is currently active. The use of the QGraphicsView class gives the ability to zoom, pan and drag select items. The QGraphicsPolygonItem class also allows you to control the way picker objects are highlighted and their standard appearance down to features such as controlling the size of outlines.
By right clicking on the picker view the animator gains access to a set of hidden commands that appear in a menu. Again these can be anything at all but would obviously be best suited to commands where using a click-able button does not make sense or simply to remove clutter in the picker.
Additional features include the use of a QDockWidget for the dock-able menus at the bottom of the interface. In our case these contain common animation tools so that animators do not need to move far away from the picker to find tools that they will need to use. Of course some do not like them visible so additional to the ability to position them anywhere on the screen they can also be hidden away if needed.
All of this is pulled together into the standard QMainwindow which allows animators to resize the window for certain purposes. When closed the picker remembers the way it has been laid out and adopts this style the next time it is opened.

I have to give a shout out to Cesar Seaz who was my inspiration in the way I approached this picker. Check out his example here. You can navigate his document by using the cursor keys.

Here is an example video of the final picker.

PyQT Character Picker for Maya from SBGrover on Vimeo.