Skip to content

Feature/groom export - #328

Draft
TaggartMaher wants to merge 4 commits into
poly-hammer:mainfrom
TaggartMaher:feature/groom-export
Draft

Feature/groom export#328
TaggartMaher wants to merge 4 commits into
poly-hammer:mainfrom
TaggartMaher:feature/groom-export

Conversation

@TaggartMaher

@TaggartMaher TaggartMaher commented Jun 23, 2026

Copy link
Copy Markdown

Working on a groom importer.

I realized that unreal uses curves just like blender for the hair, but it has a weighed "comb" setup which defines hair direction.

By porting that to blender, using a commandlet we can get that data from unreal assets to be readable.

Then we just convert to blender hair and boom it works.

Important notes

  • This is nowhere near done
  • This was written by AI I just spent a few hours planning the implementation and got Opus to do it for me as a prototype.
  • Need to consult on desired implementation, whether this needs a UE5 plugin for exporting (uassets are encoded, can't parse via python easily)
  • Need to get hair color working, test on more complex setups
  • Need to use better hair materials

Things I want to do before leaving draft state:

  • Consider a design that is bidirectional between blender and UE5. I personally am only involved in this project due to the need to render metahumans in blender, but I understand this addon's purpose is more geared towards UE5 -> blender -> UE5 in a back-forth workflow for editing characters with blender. I would do this with a python class that models the data both ways conveniently.
  • Fix the docs to make more sense. As stated earlier, this was written by AI and the code and documentation is probably not worth reading at this point.

What I need help with

  • Better understanding of other workflows. I have zero UE5 experience. I have zero metahuman experience.
  • Test this yourself, see if the groom loads as expected on your own metahumans
  • Guidance for repo standards so that I can write more convenient code for your team

Results

This is a quick cycles render of the colorless hair that this current version was able to produce as a prototype. Pretty sick!

image

Update: Working on attaching hair properly and hair shaders

renders0001-0144.mp4

Adds a groom_io package (mirroring dna_io) that reads grooms exported from
Unreal and builds them as native Blender hair Curves attached to the head:

- io.py: flat .cdgr binary codec (numpy)
- discovery.py: read groom_manifest.json, pick highest-detail strands
- curves_builder.py: arrays -> Curves, Unreal->Blender transform, bulk build,
  surface attach, radius/surface_uv/group_id/curve_type attributes
- importer.py: GroomImporter.run() -> (valid, title, message, fix)

Wires in the ImportGroom operator, a Groom Import sub-panel under Output, and
groom_folder_path/groom_attach_to_surface settings on CharacterOutputProperties.
Headless UE5 commandlet that reads UGroomAsset strand geometry via
FHairDescriptionGroups and writes the add-on's .cdgr + groom_manifest.json
(plus optional hair-cards FBX). Mirrors the AlembicHairTranslator in reverse.
Includes the .uplugin, module/Build.cs, and a README with project setup and the
headless run command. Verified against NewMetaHumanCharacter (6 grooms).
test_groom_importer.py mirrors test_head_exporter: .cdgr round-trip,
coordinate transform (parametrized), highest-detail discovery, curves build,
and the GroomImporter + import_groom operator end-to-end. Commits a tiny
deterministic eyelash fixture (Eyelashes_S_Sparse.cdgr + manifest) with its
generator.
Adds docs/user-interface/groom-import.md (with a result screenshot) to the
mkdocs nav and a release-notes bullet.
@jack-yao91

Copy link
Copy Markdown
Contributor

@TaggartMaher thanks for getting this conversation started. We are planning on releasing a free Unreal plugin on Fab that creates the APIs needed on the Unreal side.

Also another free Blender addon to handle streamlining ingesting and exporting all the other non-DNA assets like grooms, clothes, etc. in a Unreal compatible way.

Any learnings found here we can fold into that implementation. It will probably be another month before the repo is made public and we have the Fab plugin pushed. But any suggestions until then are welcome!

@TaggartMaher

Copy link
Copy Markdown
Author

Oh thats great to know.

It sounds like a better approach would be for me to keep this implementation as a fork, I'll keep building this as I need it for myself in the meantime.

Is there a better way I can communicate anything I've learned to your team, or is this draft PR acceptable?
I wouldn't want to clutter with this code if you have a more official solution in the works.

@jack-yao91

Copy link
Copy Markdown
Contributor

Yea for now I would keep using what is working for you (or if other would like to try as well). We will just keep this here as a point of reference. We will follow up with a comment here when we get closer to what I mentioned above. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants