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.

1 comment: