Blender writes .abc color information wrong #53745
Labels
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#53745
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
All
nVidia
Blender Version
2.78c and forward.
Short description of error
Blender writes .abc color information wrong.
Exact steps for others to reproduce the error
Create some vertex colors on a cube and export it to Houdini. You will notice Houdini can't read the .abc Color information because the indices are written incorrectly.
Here is the log from the SideFX bug team...
Side Effects Support Ticket: #56695
Hello,
Houdini does not show the "Col" attribute because it is corrupt. "Col" is stored in the Alembic archive as an indexed attribute, however, the indices are corrupt.
Cheers,
Silvina
In response to:
Even if I rename Col to Cd inside of Blender when I export the .abc Houdini
never reveals the attribute.
Inside Houdini I have an Alembic node followed by an Unpack turned all the
way up to 10 levels of unpack recursion. When I inspect the attributes
there is no Col or Cd. I only see P and N attributes.
How were you able to inspect the Col attribute?
It would actually be nice to see any named attribute transferred.
ap
On Fri, Jan 5, 2018 at 3:54 PM, SideFX Support wrote:
Added subscriber: @AtomP
Added subscriber: @lichtwerk
Is the Side Effects bugtracker public? If so, could you share a link?
Added subscriber: @dr.sybren
Dont have access to Houdini atm, but looking at this further I made a very simple Cube with vertexcolors
VCol.abc
This reads back into blender just fine (including vertex colors).
As Houdini support was talking about a corrupt indexed attribute I had a look at the abc in
abcecho
now the line reading
ArrayProperty name=.indices;interpretation=;datatype=uint32_t;arraysize=0;numsamps=1
makes me wonder if we actually miss writing the indices? why is this arraysize zero?On the other hand this could be totally fine [havent looked at the alembic specification further...]
@dr.sybren : could you have a look?
I can verify that Philipp's cube export does not transfer color to Houdini.
I've tried a change in how Blender exports the vertex colour, writing it non-indexed but directly as an ArrayProperty.
@AtomP & @lichtwerk How does this file import for you? vertex-colours.abc
If this works well, I'll commit it to master.
Note how the
Col
property is written now:It should show like this:
The blend file i used to create this: vertex-colours.blend
This file's geometry does import into Houdini, but the color information is still missing. Even with an Unpack following up the Alembic import node.
@AtomP does Houdini tell you anything as to why?
I have no idea what that means.
Looks like vertexcolors are missing in maya as well...
(and interestingly enough maya doesnt give you a single line of output - even in debug
AbcImport -mode import -debug "vertex-colours.abc"
)Added subscriber: @brecht
Perhaps it would be useful to import the file into Maya/Houdini, add vertex colors, export, and see how it's different.
OK, this is from maya (also writes them indexed)
looks like indexed is the way to go (and not directly as an ArrayProperty)?
quoting myself from before:
So are just the indices missing?
But judging @dr.sybren 's comments in
6db0fd65ab
and #53711 (Alembic don´t import vertex colors correctly ) he is already aware of this?Shame, would have been so much easier to dump the data in there and have it over with. Thanks for testing it.
As Blender does it now (compared to my personal branch) it tells the Alembic library that it'll be writing indexed, but then it doesn't provide the indices. Of course this is a bug, which can be fixed in two ways: 1) don't tell Alembic we're doing indexed, or 2) actually write the indices. Since 1) is the simplest one (just change
true
tofalse
in the right API call) I wanted to test that. I guess it doesn't work, so next try will be solution 2); that includes me having to discover how to write indexed stuff to begin with. I'm guessing it writes a value for each face (or maybe even each unique colour), and then for each vertex indices the colour number.Here is some more info just reported via IRC (pasting here cause user doesnt have an account). It's from a private bug report in UE4
Added subscriber: @n1ckfg
I've confirmed these observations with Maya, Houdini, UE4. One clue that might be useful--Unity's open-source Alembic importer does accept Blender Alembic files with vertex colors (as long as you use their hard-coded attribute name "rgba").
https://github.com/unity3d-jp/AlembicForUnity
You have to write your own vertex color shader to test this, so I've made an example here:
https://github.com/n1ckfg/AlembicAudioTest
Nick
This is already known & described in the comments in this task. I hoped we could go without indexing altogether, but it seems we'll have to index the colours. To be continued.
Added subscriber: @WybrenvanKeulen
Hi Sybren! I've been following this thread with great interest. I've had reports that in addition to the software already mentioned above, Clarisse and Cinema 4D also don't import the vertex colors written by Blender. I have confirmed that with my own tests.
I've been digging around the web and, although it is awfully hard to find info on Alembic, I suddenly stumbled upon this little gem:
https://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__cpp_ref__abc_export_2_maya_mesh_writer_8cpp_example_html
Look for the writeColor() function, which looks a lot like Blender's write_mcol() function, but there's clearly indexing going on in there. I'm hoping this will shed some light on "how to write indexed stuff to begin with" :)
I went ahead and took the plunge into the Blender source and sure enough I fixed it! I submitted a patch at https://developer.blender.org/D3704 along with some more info on indexed writing.
I attached an Alembic file that contains a tree model with several vertex color layers. I tested it extensively in Houdini. Please test it and post back your success or failure. I hope it fixes this bug for at least Houdini and Maya.
Tree.abc
This issue was referenced by
104fb1fb76
Changed status from 'Open' to: 'Resolved'
Added subscriber: @irfancelik
Could someone test this again in Maya?
I dont seem to get any vertex color info into Maya here even though re importing the abc back into blender does work.
Tested it myself here using the daily builds of blender 2.8, official 2.79 and daily 2.79.
It's best to create a new bug report, with all the required information and .blend / .abc file to reproduce the issue.
I created one here https://developer.blender.org/T60977
Thanks!
I tried the Tree.abc file in Houdini 17.0 and it does not work. When I unpack the data, I can see that a 4 float vector is written, but that is wrong, it should be only a 3 float vector. Even when I promote (or wrangle) the data into an attribute @Cd, that the viewport expects, all the data is zero (i.e. black).
My guess is you should drop the alpha component of the color when exporting.
It would be nice to have a distinction between "that is wrong" (which is an absolute statement about how the file is written), and "that is not what Houdini expects". How do you know it's the former, and not the latter?
Hi Atomic and Sybren,
I think Sybren is right, in that is not wrong, just a style difference. The main thing here is that Houdini expects vertex colors that you want viewed in the viewport to be called "Cd". Vertex colors in Blender can be named anything and the color layers included in the example file are named Power, Thickness etc...
I found it hard to find good info on how Houdini expects vertex colors, but some sources say Houdini uses Cd- [x], Cd- [x], Cd- [x] and a separate Alpha attribute. I dived into Houdini and indeed had a very hard time to get the vertex colors to something that Houdini likes. You can however view the attributes in Tree.abc with a Visualizer, from the display options in the lower right corner of the 3D viewport. But other than that it is indeed very hard to convert to regular Cd vertex colors.
I tried writing an attribute wrangler that runs over vertices, but it does not work. It does create the right Attributes, but for reasons unknown to me, it does not show in the viewport. I am not an expert in Houdini, maybe you know why? Here is the code:
vector thick = attrib(0, 'vertex', 'Thickness', @vtxnum);
@Cd = set(thick- [x], thick- [x], thick[2]);
@Alpha = thick[3];
Anyway, I found a much easier way to fix this. Select the Alembic Geometry node and head to its parameters. At the bottom you will find "Remap Attributes" - click the plus button.
Type in the name of the attribute in the Alembic file, for instance "Thickness". Enter the Houdini name, and you can enter "Cd" here. That works right away, you could also set the type to color, but that seems to happen automatically.
Have fun!