Adding uv data to alembic on export

Hi,

I’ve been asked to build a script that replicates the behavior of this maya script:

The goal is to add the root_uv data as a custom property to an alembic file so that it can be read by the UE Groom plugin.

The maya script actually does a bunch of extra work that is probably unnecessary in Blender. The Maya script manually looks up the UV value based on the curve position and a nearby mesh. In blender, I’ve noticed, the strands already have a root_uv property that’s used by eevee, cycles and (apparently) AMD Prorender to texture hair. I’m hoping it will be reasonably easy to iterate through the strands and copy the root_uv.

Here’s the weird bit:
The Maya script seems to be using a property type of ‘vectorArray’ (ie: [(x,y),…] ). But according to blender’s docs, all nested array structures need to be flattened. The UE docs on groom specify that the datatype for the root uv are to be “float32/64[2]” which looks like shorthand for a len(2) array per value.

Does anyone here know of a way to create these sorts of data types in blender and serializing them into alembic files on export?

Thanks!

2 Likes

Hi,

Just an FYI. I did a bunch more research and also corresponded with Sybren, who is the I/O Pipeline lead at Blender Studio.

TL/DR:

  1. You can not currently create these types in blender and export them using the existing Alembic Exporter
  2. Custom Attributes in Alembic export is part of a broad series of goals that are being worked on by Kevin Dietrich. This also includes work on USD.

A great place to keep tabs on this stuff is the Alembic-tagged task list on developer.blender.org

https://developer.blender.org/tag/alembic/

My own development project is stalled until Blender’s Alembic system becomes more feature complete. Since there is a lot more interest in USD for interoperability at the moment, the timeline for getting features like this done is uncertain.

1 Like