How to Make AutoFollowed and SpringBoned CUA Hair with CUAAutoFollow and EZSoftBone

Guides How to Make AutoFollowed and SpringBoned CUA Hair with CUAAutoFollow and EZSoftBone

This is Tutorial How to Make CUA Hair whith has Spring Bone and Auto Morph Follow.

Requires:
DAZ Studio(Making This Guide with D|S 4.15).
Unity 2018.1.9f2

EZSoftBone(OSS SpringBone Library)
also find in Asset Store https://assetstore.unity.com/packages/tools/physics/ezsoftbone-148136

CUAAutoFollow

MacGruber's CUA Project Template

Step 1 Getting Boned Hair:
First, you must have "extra boned" G2F Hair.
(If you don't need SpringBone, offcourse they don't need)
There is many Tutorials creating Hair in D|S Search in Google and Youtube :)
Recomend Tutorial, Adding Bones to Existing Figure.

In this tutorial, I use "Bo Peep Hair" from DAZ/RDNA.
This is V4 Hair. Transferd to G2F and Reboned by myself.
Recommend: Keep Hair Figure Bone from hip to head.

Screenshot_131.png


Step 2 Export Hair as FBX:
This Hair has sculp. that is hard to fit with CUA scaling and shifting.
So I divide em and make sculp to standard VAM clothing.
In Geomety Editor In D|S, set sculp to Hidden.

Screenshot_132.png

and Select "Delete Hidden Polygon" from right click menu.
Screenshot_133.png

Save non sculp Hair as New Figure and Load Hair Figure again. and Hide and Delete all polygons without sculp and Save as Sculp.
Screenshot_134.png


Ready to Export. load Non Sculped Hair and Export As FBX.

Screenshot_135.png

"Allow Degraded Skinning/Scaling" and "Collapse UV Tiles" is very important option. don't forget this to checked.

Step 3 Setup Unity Project:

Create New Project In Unity. and Copy Files from MacGruber's CUA Project Template.
Then Check Project Settings for Ready to VR. If it is forgotten, CUA will be double Image in VR mode.
In "Edit>Project Settings>Player"
1) "Other Settings>Color Space" set to "Linear" from "Gamma".
Screenshot_136.png

2)"XR Settings" , "Virtual Reality Supported" checked, and "Stereo Rendering Method" as "Single Pass".
(If you import Template correctry, these will be set already)
Screenshot_137.png


Ready to Import FBX. Create New Folder In Assets and Drag exported FBX to there.
Screenshot_138.png


Step 4 Import EZSoftBone Library:
Stable and Recommended way for importing EZBone is Importing from AssetStore.
First, Purchase Free EZBone Asset from AssetStore.
This Asset is Lisence clean. Cos EZSoftBone is OSS:)
From "Asset Store > My Assets", select EZSoftBone and Import.
Screenshot_139.png

Screenshot_140.png


Step 5 Setup SpringBone with EZSoftBone
Drag Imported FBX into Hierarchy, Hair will be Spawned in (0, 0, 0).
(I Renamed FBX for Maintainance :))
Screenshot_141.png

Add Empty Object(s) under Hair root.
This hair seems to need 2 controls(Rear curls and Side curls), so I create Empty Object "FrontCurl" and "SideCurl"
Screenshot_142.png

Select "SideCurl" and "RearCurl", and Add Component "EZ Soft Bone".
Screenshot_143.png

This Hair have 7 curls, and "[L/R]Curl[A/B]" is Side, others is Rear, so Select "SideCurl" and set size of "Root Bones" to 4, and Select "RearCurl" and set size of "Root Bones" to 3.
Screenshot_144.png
Screenshot_145.png

and drag curl bones to each.
Screenshot_146.png
Screenshot_147.png

You can quck test in Play mode. Hit Play Button and Drag Hair in Scene Window. Curls will Swing.

Screenshot_148.png

You Can Edit SoftBone Setting Similar to VAM physics. Recomend Editting with Created Material and Forces(It can use when other Hair Setuping)
About Setting Details, See Documents in github of EZSoftBone.

Step 6 Adding Coliders
This Hair is bit long. so Need Coliders to Arms, Chest and Head.
But This Hair does no have arm bones.
So I will add arm bones from G2F rig.

First, Export Zero Figured G2F to FBX for Bone donnar and Import into Unity.
Screenshot_149.png

I dont need Donnar's Mesh. So I delete it from Hierarchy.
Screenshot_150.png

Drag non meshed G2F to Project for Donnar Prefab.
Screenshot_151.png

Next, Add Capsule Object to Donnar's lCollar-lHand Bones.
IMPORTANT: Capsule Collider must be checked "Is Trigger". if it is off, It makes phys conflict with Person.
Screenshot_152.png
Screenshot_153.png
Screenshot_154.png
Screenshot_155.png

Then Copy These Caosules to rCollar-rHand, and nagate x pos(ex change (-0.12,0,0) to (0.12,0,0))
With this Hair, I don't use Hand Colider. but I create now for other Hair what is need hand coliders.
these bone positions seems wired. but they will be ajusted when bone following.
Screenshot_156.png

Then Select these cupsules and Add Component "EZ Soft Bone Collider".
Screenshot_157.png

Then Add Capsuls to Chest and Head with Same Settings.
Screenshot_158.png
Screenshot_159.png

Select All Capsuls and Disable Mesh Renderer.
Screenshot_160.png

Colider Template is Done. Select Prefab root and hit "apply" to save prefab.
This Template Can Use in Other Hair Setup. So you have to these setup only Once.

Copy lCollar and rCollar bone from Template to Hair. and Delete Hand bones.
Screenshot_161.png

And copy Head and Chest Capsule also.
Screenshot_162.png

Then Setup Colider Radius of Curls. Select "SideCurl" and set "Collision > Radius" to 0.02 and Select "RearCurl" to 0.04

Screenshot_163.png
Screenshot_164.png

Bone Colider Gizmo will be seen.
Screenshot_165.png

Then Set Curls Gravity to bit -Y(-0.001-0.005ish) and test in play mode.
Screenshot_166.png

Curls will colide
Screenshot_167.png

Colider Setup is Done.

Step 7 Build EZSoftBone DLL
To Get EZSoftBone Component as CUA's DLL, Need Building Unity Project.
Go to "File>Build Setting", Select "x86_64" and hit "build".
Screenshot_168.png

Unity asks folder to build, Create folder "builds" in Project root and select it.

after building, you can find "EZhex1991.EZSoftBone.dll" in "builds\builds_Data\Managed"
this is EZSoftbone's dll. you can copy this to assetbundle's folder and rename to "yourassetbundle.dll".
It will be ready to load into VAM.
Screenshot_170.png


Step 8 Taking Into VAM
See MacGruber's Tutorial :)
build assetbundle and copy into Somewhere in Custom/Assets, and place dll which is made with last step into same place
Screenshot_171.png

Step 9 AutoFollow Setup
Launch VAM. and Load any Setup Scene.
Select Person ando Turn Off All Auto Bhaviours and Disable Morph Applying Plugin (Life etc.).
And Zero All Morph and Apply Target Look Morph Only.
If your Look is not maked by Only one morph, make it Only One Morph using MorphMerger etc.
Recommend: You'd better select Morphs you want to setup and set Fav these
Screenshot_173.png

Ready To Setup. Create CUA Atom and Select assetbundle and Apply CUAAutoFollow.
Screenshot_172.png

Screenshot_174.png

In CUA Control, Select Person as Parent and Link to "Peson/head(not headControl)" and select "Hold".
Screenshot_175.png

Hair will move to Base position cos there is no AutoFollow Entry.
Go to Plugin UI, Hit "Add From Fav" to Create Morph Entries.

Screenshot_177.png

Morph Entry Created.
Screenshot_178.png

Select Current Morph And Select Head Bone. And Adjust Offsets.

Screenshot_180.png

When Finished, Apply another target morph and adjust also.
Screenshot_181.png

Screenshot_182.png

Done. CUA become Mixable with adjusted morphs.
Screenshot_183.png

After adjusting, go to Plugin UI and hit Save.
Save Data will be created in "Saves/PluginData/yourame/yourItem/yourassetbundle_yourprefab.json"
CUAAutoFollow will AutoLoad Savedata when next Running.

Appendix
Don't forget Credit EZhex1991 when you distribute CUA using EZSoftBone :)

Thx for Finished Reading So Long Tutorial.

Enjpy :)
Author
zgock
Views
9,337
First release
Last update
Rating
5.00 star(s) 4 ratings

More resources from zgock

Latest reviews

Finally found this tutorial, thank you so much for sharing this tutorial it really helped me a lot!
Upvote 0
nice work
Upvote 0
Your tutorial is very detailed, thank you for sharing generously
Upvote 0
Thank you so much for this detailed tutorial. I appreciate your hard work for us and give it for free
Upvote 0
Back
Top Bottom