Alembic Export to Unreal - RootUVs?
-
I'm trying to properly export my Cinema4D hair groom to Unreal, and I manage to get the splines via Alembic export, but the Alembic file seems to lack the "RootUVs" on import to Unreal.
This is neccessary to texturize the fur/hair according to the UVs of the base mesh it is bound to (not sure what the process here is, sampling on binding or writing on export).
Does anyone have some idea how to get hair over to Unreal with RootUVs or how to implant this info with a script solution afterwards into the alembic cache somehow?
This thread and maya script sounds like it tries to solve this, too:
https://devtalk.blender.org/t/adding-uv-data-to-alembic-on-export/24463Cinema Version is 2024, maybe this is solved in newer verions?
Thanks for ideas!
-
Hey @mp-grafix,
I am not really an expert on this subject, but the Alembic format does not provide a "root uv" concept as you somewhat imply. There are zero hits for these terms in the Alembic docs.
groom_root_uvis a custom Alembic attribute that is supported (and defined) by Unreal (link). This link also explains how to compute this a bit ambiguous term. One might think a root uv would be the uv coordinate on some scalp mesh, but it is actually just the spherical projection of a hair root (that is at least how it is explained in the Unreal link). Unreal will also autogenerate this attribute for your when it does not exist.The UV computation of our hair library can be found in c4d.modules.hair.HairLibrary.GetPolyPointST but this is per polygon. You can look at this example for how to use it on a whole mesh. But as far as I understand the Unreal docs, that is not what Unreal wants from you.
The official Alembic repo also contains the Python bindings,
PyAlembic, with them you could add any metadata you want after Cinema exported the file. Hurdle number one is that the Alembic repo does not seem to provide binaries, i.e., they expect you to compile this yourself, which might be a hurdle to high for some users. Hurdle number two is to match the exact format Unreal expects. That is best solved in Unreal forums.I am not very much into Unreal, but does our Cineware Unreal binding not solve this? I would say you have much better chances to be heard there, rather than us conforming with our Alembic export to the very specific custom attribute format Unreal expects.
Cheers,
Ferdinandedit: Our Cineware for Unreal developer is currently on vaction until the middle of August. When you bump this topic then again, I am happy to ask him what his take on this is.