# Difference between revisions of "HoudiniKinefx"

## Kinefx

Kinefx covers a lot of ground, but there's a pleasing DNA share with a lot of established houdini workflows. Basically if you've used packed prims before and wrangles, you get the core of kinefx.

### Localtransform and kinefx wrangle

For me one of the most exciting things is the core ability to treat curves as joint chains. I've experimented with doing this in the past (see CurveUnrollTutorial ), but it's quite a lot of work. Now all that stuff comes for free!

When you get into kinefx, the sections of a line are treated as joint chains. Each point gets a @localtransform matrix4 attribute. If you rotate it, it is treated as a FK rotation in a joint chain, ie, rotate the elbow, and you'll have the wrist, hand, fingers all come along too in a FK style.

This means if you animate all the rotations of all the joints, you get easy wiggly waggly setups. So:

1. Make a line with 10 segments
2. Append a skeleton sop which will create @localtransform for you
3. Append a rig wrangle
4. Try something like this:
```rotate(4@localtransform, @Time, {1,0,0});
```

When you scrub the timeline, you'll see the line curl up as each 'joint' is rotated over time. What if you increase the amount of rotation from the start to the end of the curve?

```rotate(4@localtransform, @Time*@ptnum*0.1, {1,0,0});
```

or drive with a sine wave and tweak the values a bit?

```rotate(4@localtransform, .2*sin(-@Time*3+@ptnum*0.2), {1,0,0});
```

or just be really silly, do this, and copy some lines to a sphere:

```rotate(4@localtransform, .4*sin(rand(@primnum)-@Time*2+@ptnum*.05), vector(curlnoise(@P+rand(@prinum)+@Time*0.2)));
```

### FBIK

Not sure if this is the right way to use it, but its fun.

Bring in a rig, here I've loaded mocapbiped3, chose a walk, and imported it with the scenecharacterimport node. Split off the feet and hips, move the hips, feed those to the second input of the fbik sop, and the original rig to the first input.

FBIK will do its best to push the rig to match the positions of the bones you specify. Tweaking some weighting options on the FBIK node can help get rid of glitches.

It's not perfect, things like knees will wobble everywhere, but like I said, its fun.

### Simple skinning from scratch

The launch docs gloss over this a little bit, you can work it out by reverse engineering some of the later examples.

Captureproximity sop is what you want. Geo to the left, rig to the right, feed that and your animated skeleton to a bone deform.

Play with the weights tab on the capture proximity to boost the number of influences, smooth out the reuslts.

### Manually drawing a skeleton

The skeleton above was drawn directly in the skeleton sop, it has lots of options to help you draw joints, mirror them, constrain to planes or inside geo etc, detail are in the sidefx docs.

Take 2 mins to go over the shortcuts and various modes, its pretty good fun. In the mp4 I'm doing the following:

• Mostly in 'freehand' mode to click-click-click the core hips-to-head joint chain
• Hit enter to swap to edit mode, tweak on, child compensate on, drag on joints to fix placement
• Select a joint, hit enter again to draw arm, leg, tail
• r.click, split to create elbow
• select shoulder/elbow/wrist, r.click, mirror and duplicate to create opposite side.