Is there a way to get xgen alembic grooming with a texture? I am working on a project with fur, a full body hairy gorilla and I am trying to get the groom textured, It doesn’t work properly applying a regular texture to the base color node in the hair material. But If I try to apply a texture by the hair attributes node I doesn’t fit the hair, but technically the texture is working on the hair, just not the way it should be, so It seems the grooming has Uvs The other thing is when I try to export the hair with density maps from maya xgen, on UE seems not working and it shows hair where isn’t supposeed to be, and can’t apply masks either, I had to delete unwanted hairs by density brush on maya.
So, this wont solve all your issues, I am not sure about the density map yet, but I can give you some help with the UV.
This is a simple tutorial I did recently for Xgen hair into UE4.
First create your geometry with UV, in this case I used a poly plane.
From the Modeling menu: Generate-> “Create Interactive Groom Splines”
You can great guides and brush the hair as you like. When ready, export the curves as an Alembic Cache with Generate-> Cache → “Create New Cache”
Hide or delete your Xgen hair and then reimport your exported hair curves with your source mesh in the scene
You will have thousands of spline curves parented under a top curve, remember this object name.
Edit the attached python script in your editor, replace the values of :
export_directory, hair_file, curve_top_group, uv_mesh
Run the script and you should have a new .abc file in your directory to import into unreal.
In unreal, create a hair material and plug the RootUV parameter from the HairAttributes into your Texture map
Drag your hair alembic file into a level, make sure the hair width is not 0, and assign your hair_UV material.
You should see your textured hair!!
When I create the cache file and then import it, it has more than 1 spline group so the script doesn’t make the new alembic file
Are you not able to add the other spline groups to the script?
create_root_uv_attribute( curve_top_group , uv_mesh)
create_root_uv_attribute( curve_top_group2 , uv_mesh)
correction, I only make a part of the hair with wrong uvs
I’m gonna try that, I really suck at scripting so when I see one I try not to touch anything jaja
Well if you want to screen shot your outliner showing the names of the UV source and the spline groups I can probably tell you how to adjust the script.
This is my outliner,
Is there a chance to write uvs on the .abc exported directly from xgen?
I understand, thanks! I ve tried with the script but didn´t work, it made just a portion of the hair, surely I made a mistake on the script right?
question, is this going to export different .abc files?
That script will over-write all the exports except that last one. Probably not what you want.
The reason this 2 step process is currently necessary is that the UV property is an alembic one, and I guess not something that Xgen stores. I had to ask around internally to get this script at Epic as the entire pipeline is still work in progress. Better workflows are coming.
Ya, that script will export each hair over each other. You only defined one hair file but each of your hairs are writing to the same file namne.
Your need a hair_file1 and hair_file2, etc like you are doing for the curve_top_group1,2 , etc.
hair_file1 = os.path.join(export_directory, ‘hair_export301VU.abc’)
hair_file2 = os.path.join(export_directory, ‘hair_export302VU.abc’)
hair_file3 = os.path.join(export_directory, ‘hair_export303VU.abc’)
Do you see what was wrong and how to fix it?
yes, each hair section will be its own alembic file.
So Im looking at the abc_export code. It would be possible to have 2 scripts, one that puts the UVs on there and then you can parent all the hair nodes under one parent, and then another script that exports that top parent node. Just depends on if you want the complexity in the script or in your actions. This script was designed to be as simple as possible for people to build on. Your setup and needs are a bit more complex that putting UVs on a rug.
I got it, thanks! I am gonna try with multiple abc and see the results, dont wanna be a pain in the ■■■ jaja
thanks for yout help!!!
Ok, so I’ve tried with multiple abc files, but it didn’t write the uvs, What should I do in this case?
So I would just focus on one section of hair at a time. Create a texture that is like a rainbow /checkerpattern that you can easily identify the UVS, and see where it is wrong. This will help debug.