Cannot seem to export Vertex Color with Alembic for Maya nor Houdini #52417

Closed
opened 2017-08-16 13:30:16 +02:00 by Jimmy Gunawan · 24 comments

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.

**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.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @BlenderSushiGuy

Added subscriber: @BlenderSushiGuy

Added subscriber: @SteffenD

Added subscriber: @SteffenD

Added subscribers: @dr.sybren, @mont29

Added subscribers: @dr.sybren, @mont29
Sybren A. Stüvel was assigned by Bastien Montagne 2017-08-26 14:52:19 +02:00

@dr.sybren I’ll let you handle that one. :)

@dr.sybren I’ll let you handle that one. :)

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 (696f4dc85f).

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).
Author

@dr.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?

@dr.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.

Try either [2.79 Release Candidate 2](https:*www.blender.org/download/) or today's [daily build](https:*builder.blender.org/download/). 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.
Author

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.

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.

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

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

Added subscriber: @n1ckfg

Added subscriber: @n1ckfg

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

alembic_vertex_color_test.zip

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 ``` [alembic_vertex_color_test.zip](https://archive.blender.org/developer/F1383763/alembic_vertex_color_test.zip)

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
                                   }
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?

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

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

@n1ckfg I think a good place to put that would be in [`write_mcol()`](https://developer.blender.org/diffusion/B/browse/master/source/blender/alembic/intern/abc_customdata.cc;7ff3cd26932cbc93068eea4dc7438442216e4ee1$153).

Added subscriber: @dario.seyb

Added subscriber: @dario.seyb

OK, progress--I can build Blender from source with Alembic enabled. Next step, @dario.seyb 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.

OK, progress--I can build Blender from source with Alembic enabled. Next step, @dario.seyb 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

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
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

some (related?) info in #53745

some (related?) info in #53745

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

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

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Closed as duplicate of #53745

Closed as duplicate of #53745

Added subscriber: @ChristopherAnderssarian

Added subscriber: @ChristopherAnderssarian
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#52417
No description provided.