Jump to content
Hash, Inc. Forums
Sign in to follow this  
SpaceToast

Rigging Guide Hairs to Bones

Recommended Posts

I've had some luck rigging hair guides to bones with Expressions, but I've hit a snag. If anyone has ideas, please post them here.

 

Here's how to get started:

 

-In Modeling mode, create a new bone chain. Match the bones to the default positions of the guide hairs' control points.

-In Skeletal mode in an Action, Pose or Choreography, jiggle the position of the bones to create Rotate channels for them.

-In Grooming mode, jiggle the positions of the guide hair's control points to create rotate channels for them.

-Select the first hair guide CP in the PWS, and bring up the properties window.

-Leave the Rotate properties unexpanded, so that they're all on the same line.

-Right (Control) click on the Rotate properties, and select Edit Expression.

-A blank Rotate= expression is created. Expand the first bone of the chain in the PWS and click on its Transform.Rotate.X channel.

-Delete the ".X" from the Expression. You'll get something like "..|..|..|..|Bones|Bone1.Transform.Rotate"

-Repeat for each of the remaining guide hair CPs and bones in the chain.

 

Move the bone chain into some weird angle. Hit the spce bar to update the window, and the guide hairs should move.

 

The trouble is, they probably won't match the positions of the bones.

 

The trouble here is that the Z-rotation (roll handles) of the bone doesn't match the Z-rotation assigned to the guide hair. It's dancing like it was told to do, it just doesn't know which way is up. If you go back into the model and start playing with the roll handles, you should be able to get the bone chain and the hair guide to match up. How? I'm not entirely certain. In a simple 4-spline/4-point patch, aiming the roll handles of ALL bones in the chain at the opposite CP will make it match up. On a more complex surface, I'm still lost.

 

Here is a (working) example:

 

HairtoBoneExample.jpg

 

Hair_Test.prj

Share this post


Link to post
Share on other sites

Why not string a series of hair poses together with SmartkSkin?

What is the desired outcome? Why do you need to attach the hair guides to bones?

 

It will be easier to help if your goal is clear. =)

Share this post


Link to post
Share on other sites

I've got this solved, at least for four point patches.

 

The roll handles of each of the bones in the chain simply need to aim at the CP opposite the one generating the hair guide. This seems to work on all valid 4-point patches. When a CP is owned by multiple patches, nothing changes; the first patch that refereneces the CP in the .mdl file determines the opposite control point to orient toward.

 

HairtoBoneExample2.jpg

 

The advantages of manipulating true bone chains become apparent when trying to work with long hair (3 or more control points per guide hair). With a real bone chain, you can A) lock bones in the chain, B) apply constraints, and C) move bones at the base of the chain without affecting those higher up (except when necessary).

 

This is an attempt on my part to unite the posability of "helmet" type hair with the realism of generated hair.

 

[Edited to remove automatic smilie at "B)". How I loathe smilies...]

Share this post


Link to post
Share on other sites

This little experiment may here crash and sink against the iceberg of my limited mathematical skills. If you look inside the file, guide hair CPs have a length and an orientation (no translation). The orientation is not calculated relative to world space, but relative to the normal of the CP the guide hair springs from. Normals don't seem to be accessible with Expressions, are not saved in the file... and I can't figure out how to calculate them myself. (Someone please correct me if I'm wrong about either of the first two parts.)

 

The basic method above will work, but I'll have to orient the bones by hand. My dreams of doing all the grunt work in AppleScript are slipping away. Still, I've got a working script to generate and translate the bones, and adding a Relationship with the guide-hair-to-bone Expressions should be straightforward enough. Keep in mind, a 6x6 mesh with 7 control points per guide hair would need to be driven by 252 individual Expressions.

Share this post


Link to post
Share on other sites

Okay, I see what you are after. I'll think on this and get back to you. I still say expressions are overkill.

Share this post


Link to post
Share on other sites

It just seems like too much work to rig hair with expressions. I understand what you are trying to do, but modeling the hair may be easier.

 

You can use smartskin to control particle hair. Select a bone to control hair and create a new smartskin for it. Go into grooming mode for the hair and groom it. There are other ways too.

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...