Page MenuHome

Cannot seem to export Vertex Color with Alembic for Maya nor Houdini
Closed, ArchivedPublic

Description

System Information
Windows 7, Quadro FX 4000

Blender Version
Broken: (example: 2.69.7 4b206af, see splash screen)
Worked: (optional)

Short description of error
Exporting Vertex Color seems to fail for Alembic. Option already turned on. This should be pretty straight forward. I even try naming it to Cd.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

Just Vertex Color paint a mesh and try exporting Alembic with Vertex Color turned on. Does not work when imported to Maya or Houdini.

Details

Type
Bug

Event Timeline

Bastien Montagne (mont29) triaged this task as Normal priority.Aug 26 2017, 2:52 PM

Please fill out the entire form, including which version of Blender you've tested with, which version used to work for you previously (if any), and attach an example blend file.

This seems to work fine in current master (696f4dc85f7faa8b).

Bastien Montagne (mont29) lowered the priority of this task from Normal to Needs Information from User.Aug 30 2017, 8:37 AM

@Sybren A. Stüvel (sybren) I tried the latest "current master" build and still not working. Maybe my compiled is not really latest? May I know at which version exactly that exporting ABC Alembic with Vertex Color is working?

Try either 2.79 Release Candidate 2 or today's daily build. If you pick a daily build, please also report the full filename of the downloaded file, so we know which platform, nr of bits, and the git hash of that particular version.

I tested again today, using RC2 hash 7b397cd with Houdini FX Apprentice Version 16.0.671, and Alembic Vertex Color is still not transferring. Animation works, but no vertex color, confirmed still an issue.

I tested with Blender, exporting a Torus being displaced and with Vertex Color, Import Export works within Blender. Vertex Color is not changing per animation frame as expected, but at least Vertex Color is there.

Bastien Montagne (mont29) raised the priority of this task from Needs Information from User to Normal.Sep 14 2017, 4:45 PM

Can you attach the blend file you used to test? Then I'm sure that we're looking at the same thing.

To make the attached test, I took the same mesh into Blender, Maya, and Houdini, and exported an Alembic file with vertex colours from each; the attributes are all named Cd to match Houdini convention. (In Blender I applied vertex colours with the common Python function below, just in case that's helpful to know.) The results:

  • Maya and Houdini were able to read each other's vertex colours, but not Blender's.
  • Houdini doesn't see the Blender Cd attributes at all.
  • Maya sees the Blender Cd attributes but they contain no colour data.
  • Blender can see the Cd attributes on all three files (although the Maya vertex colour order is wrong--a known issue that doesn't happen to affect my pipeline).

Then I ran the output of each through abcls and added the logs to the attachment below. Would love to know if anyone sees something in the way the Cd attributes are structured that could provide a clue.

def colorVertices(obj, color=(1,0,0)):
    mesh = obj.data
    if not mesh.vertex_colors:
        mesh.vertex_colors.new("Cd") # .new()
    color_layer = mesh.vertex_colors.active  
    #~
    i = 0
    for poly in mesh.polygons:
        for idx in poly.loop_indices:
            color_layer.data[i].color = color
            i += 1

Here's how vertex colours are represented in each of the Alembic exports. Can anyone tell me why Houdini and Maya can see each other's vertex colours, but Blender's aren't visible in Houdini or Maya? Looking at the logs here, is it just as simple as adding a mayaColorSet=1 flag to the Blender compound property on export?

Maya:
/crv_GP_Layer_1_mesh_007/crv_GP_Layer_1_mesh_007Shape/.arbGeomParams:
CompoundProperty                   Cd {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=rgba
                                    isGeomParam=true
                                    mayaColorSet=1
                                    podExtent=4
                                    podName=float32_t
                                   }
/crv_GP_Layer_1_mesh_007/crv_GP_Layer_1_mesh_007Shape/Cd:
ArrayProperty       float32_t[4]   .vals[1] {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=rgba
                                    isGeomParam=true
                                    mayaColorSet=1
                                    podExtent=4
                                    podName=float32_t
                                   }
Blender:
/crv_GP_Layer_1_mesh_007/crv_GP_Layer_1_mesh_007Shape/.arbGeomParams:
CompoundProperty                   Cd {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=rgba
                                    isGeomParam=true
                                    podExtent=4
                                    podName=float32_t
                                   }
/crv_GP_Layer_1_mesh_007/crv_GP_Layer_1_mesh_007Shape/Cd:
ArrayProperty       float32_t[4]   .vals[1] {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=rgba
                                    isGeomParam=true
                                    podExtent=4
                                    podName=float32_t
                                   }
Houdini:
/geo1/attribpromote1/.arbGeomParams:
ArrayProperty       float32_t[4]   Cd[10] {
                                    arrayExtent=1
                                    geoScope=var
                                    interpretation=rgba
                                    isGeomParam=true
                                    podExtent=4
                                    podName=float32_t
                                   }

If I wanted to recompile Blender's Alembic export module with the mayaColorSet=1 flag added, where in the source should I look?

@Nick Fox-Gieg (n1ckfg) I think a good place to put that would be in write_mcol().

OK, progress--I can build Blender from source with Alembic enabled. Next step, @Dario Seyb (daseyb) says for Unity he used the following to add the Maya color set flag:

AbcGeom::MetaData md;
m.set("mayaColorSet", "true");
m_colorSet = AbcGeom::OC4fGeomParam(m_scheme.getArbGeomParams(), “Cd”, true, AbcGeom::GeometryScope::kFacevaryingScope, 1, m_tsi, md);

Could you help me adapt this for Blender in abc_customdata.cc? I'm getting more certain that this is the fix to make Blender vertex colors readable in Houdini and Maya.

Here's what I've got so far...it builds successfully and exports valid Alembic files, but abcls doesn't find the mayaColorSet=1 flag so I'm still doing something wrong.

Alembic::AbcCoreAbstract::MetaData md;
md.set("mayaColorSet", "1");
OC4fGeomParam param(prop, name, true, kFacevaryingScope, 1, 0, md);

https://github.com/n1ckfg/blender/blob/master/source/blender/alembic/intern/abc_customdata.cc

Oh cool, sounds like folks are on the trail of a solution!

Closed as duplicate of T53745