Sonifying UDK Skeletal Mesh Components with UDKOSC and Supercollider

1. Understanding the Skeletal Mesh

To put some context around what we’re doing, our main character in the current iteration of ECHO::Canyon is a 4-winged bird-like creature called a ‘Valkordia’ created by my partner in crime and artist-extrordinaire Chris Platz. Between the animations that Chris made for our flying and walking state, and some Unrealscript modification to tweak the pitch, yaw and roll of the model during flight, we’ve ended up with a pretty decent and fun flying rig.

Valkordia mesh in the UDK Animset Editor

Of most interest to me was the promise of getting my (virtual) hands on to the front wings of the mesh with some kind of direct control. While the specter of the Kinect still looms large here, I chose to use the 2 analog sticks from the standard XBox 360 wired controller that we were already using. They’re smooth and natural to use and the XBox controller has always made me think of a marionette’s operating-cross from real-world puppetry.

In some earlier efforts to dynamically change my Pawn’s mesh through a simple exec function, I managed to get a brute-force system in place to allow me to flip the mesh on the fly. Essentially this involves little more than setting your SkeletalMesh, PhysicsAsset, AnimSet and AnimTreeTemplate to whatever you want. In my case I just call:

self.Mesh.SetSkeletalMesh(SkeletalMesh'thesis_characters.valkordia.CHA_valkordia_skel_01');
self.Mesh.SetPhysicsAsset(PhysicsAsset'thesis_characters.valkordia.CHA_valkordia_skel_01_Physics');
self.Mesh.AnimSets[0]=AnimSet'thesis_characters.valkordia.CHA_valkordia_skel_01_Anims';
self.Mesh.SetAnimTreeTemplate(AnimTree'OSCthesis_characters.valkordia.CHA_valkordia_AnimTree_01');

Now in this case, the AnimTree I’m using sits in a different package than the other components, and the reason for that is that it’s a modified version with the CCD_IK’s I want to use in there. Probably not necessary but when experimenting, sometimes its nice to know that you haven’t mucked up your working version, especially if you’re no AnimTree master (like I am… not).

From some earlier poking around, I had isolated the specific bones at the end of each wing-tip which I wanted to use for sonification, namely ‘valkordia_01Lwing_front_4’ (left) and ‘valkordia_01Lwing_front_4’ (right). For that usage, since Mesh is a component of the Pawn itself, it’s pretty easy to grab the location of a given bone with it’s name, something like:

BoneLocationVector = Mesh.GetBoneLocation('valkordia_01Rwing_front_4');

But I digress (at least for now); what’s important here is that since these are the 2 bones that we want to track, they’re going to be part of the chain of bones we move, namely the bones of the wings. And to move them we need a SkelController.

After the Break: Our Friend: the SkelControl_CCD_IK

Advertisements
Tagged with: ,
Posted in UDKOSC

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: