Created a tiddlywiki to have a place to have some process about how to create a rigging system, very much from a code/system development perspective I think - but let’s see where it goes. It’s really just intended for myself and is not a professional display, so it will be unsensored and full of “late nights in the couch at the laptop” spelling errors and giberish. This blog and that little project might merge at some point though, time will tell..
So I’ve made the Big Plunge and moved over to the UK. I’ve recently started work as a Senior Technical Character Artist at EA, the studio behind the Harry Potter games series. Very exciting stuff.
I have a pretty central position here that’s very character oriented, so that suits me just fine. At this point I’m quite looking forward to going full circle on a product, that is pretty sure to get to market, as I’ve my share of projects canceled at the end of pre-production. So all in all I’m a happy camper
I’m pretty busy and a bit overwhelmed, being in a new country and all, but hopyfully I will get a chance to post some odds and ends, regardless.
Just wanted to plug an excellent book I’m… Wait! Not even done reading?? That’s right, it’s that good - for me at least.
You know I often feel like I’m “hacking my way” thorugh some of the more computery, code and math related sides to being a character TD, wishing I could dedicate a whole decade to just getting to the bottom of some topic. And I see a lot of people around me “hacking their way” as well. Of course we all have different backgrounds and holes in them too. Alas, so little time so much to learn
While I have read my share of books on the topic of coding, MEL, Python, Object Oriented Design etc. and those books have taught me a lot, a “certified” coder from my last gig recommended “Code Complete 2″. It’s about the discipline of “Code Construction” and is language independent. This book is om some respects a real eye opener and tells basic stuff you know you really need to understand, but in a way that makes you wonder - “why you didn’t figure that out by yourself already”. Another thing is this if you have several people working on the same code base this book can serve as a common guide or at least common point of reference, to figure out how you want to work.
Of course it might not be your cup of tea.. or I might just have exposed myself as an insane coding noob I have only read half of this book, but for me I feel wiser and more prepared! Check it out
Last week the production company I worked for unfortunately folded.. As for the fate of the game we were working on, I’m not sure what is gonna happen. So once I find myself I the process of doing the reel -cv - looking for work thing.
So if anyone has any interesting offers or leads do let me know. I’m based in Denmark, but will definitely travel or relocate for the right gig. Freelance is welcome as well of course! I’ll again post once I got my reel together.
Here you can check out a lot of stuff about our game, marketing strategy and some developer/behind the scenes stuff. I will probably be posting most of my rigging related stuff in there, for the next period of time.
So I wanted a blend between two “skinnings” of a characer we are working on for our game. I got so annoyed that Maya did not provide a feature for this, that I mocked up my own piece of code. Make sence of it if you can..
Warning not “production” strength code
import pymel as pm
import copy
class skinMerger:
def __init__(self, mesh, nrOfVerts=5000):
"""class for merging meshes
Usage could look like this:
#mergeMachine = skinMerger('monster')
mergeMachine.grabA()
mergeMachine.grabB()
mergeMachine.setTarget()
"""
self.mesh = mesh
self.nrOfVerts = nrOfVerts
self.src_A_weightList = []
self.src_B_weightList = []
def grabA(self):
"""Grab the first skinning"""
skinCluster = pm.mel.findRelatedSkinCluster(self.mesh)
influences = pm.skinCluster(skinCluster, q=True, influence=True)
# Get the weights off the source mesh A
for v_index in range(0, self.nrOfVerts):
self.src_A_weightList.append(pm.skinPercent(skinCluster, self.mesh+'.vtx['+str(v_index)+']', q=True, value=True))
def grabB(self):
"""Grab the second skinning"""
skinCluster = pm.mel.findRelatedSkinCluster(self.mesh)
influences = pm.skinCluster(skinCluster, q=True, influence=True)
# Get the weights off the source mesh A
for v_index in range(0, self.nrOfVerts):
self.src_B_weightList.append(pm.skinPercent(skinCluster, self.mesh+'.vtx['+str(v_index)+']', q=True, value=True))
def setTarget(self, blendFactor=0.5):
"""Set the final blended skinning"""
skinCluster = pm.mel.findRelatedSkinCluster(self.mesh)
influences = pm.skinCluster(skinCluster, q=True, influence=True)
# Make the blended target list
merged_weightList = copy.deepcopy(self.src_A_weightList)
for v_index in range(0, self.nrOfVerts):
for i_index in range(0, len(influences)):
merged_weightList[v_index][i_index] = (self.src_A_weightList[v_index][i_index]*(1-blendFactor)) + (self.src_B_weightList[v_index][i_index]*blendFactor)
# Set the weights on the target mesh
for v_index in range(0, self.nrOfVerts):
for i_index in range(0, len(influences)):
pm.skinPercent( skinCluster , (self.mesh + '.vtx[' + str(v_index) +']') , transformValue=[(influences[i_index], merged_weightList[v_index][i_index])] )
Basicaly it’s a default bind based on heat dispersion simulation.. Ok, so whay you say? Well, suffice to say you get a much better default bind! Amongst other things the algorithm understands that a mesh has boundaries and does not only take vertex/joint distance into account when creating your default bind. Whee…
I use it all the time now. Only one little issue. The skinning procedure somehow locks the skinCluster nodes, so you can’t delete them with the UI alone. So I made a tiny piece of code for it. The meat is this line: maya.cmds.lockNode(”skinClusterName”, lock=False)
Remove skin with code:
import pymel as pm ## I use pymel, but the code should work fine with maya.cmds as well
def removeSkinning(meshes=''):
"""Remove skinning on meshes. If the "meshes" kwarg is not used, the current selection is used"""
if meshes == '':
meshes = pm.ls(sl=True)
for m in meshes:
skin = pm.mel.findRelatedSkinCluster(m)
if skin:
pm.lockNode(skin, lock=False)
pm.delete(skin)