Alembic: export animated vertex colors #88074

Closed
opened 2021-05-06 12:17:24 +02:00 by Sybren A. Stüvel · 5 comments

The Alembic exporter currently (Blender 3.0 alpha, master @ 42e350b9a5) exports vertex colors only on the first exported frame. It would be nice if it would do this on every frame.

This task was created so that D8397: Alembic add option to write UVs on every frame can be limited to only exporting animated UV maps. Applying the same approch to vertex colors crashes the Alembic exporter:

terminate called after throwing an instance of 'Alembic::Util::v12::Exception'
  what():  OCompoundProperty::init()
ERROR: EXCEPTION:
Already have a property named: dp_paintmap

This is due to the write_mcol() function creating a new C++ object on every call, instead of keeping a reference to a single object. This causes the Alembic exporter to finalise the written property after a single frame, and then crash when a new property with the same name is created. To reproduce this crash, apply this patch:

diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc
index 29b29324ee3..b7d029683a3 100644
--- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc
@@ -364,7 +364,7 @@ void ABCGenericMeshWriter::write_arb_geo_params(struct Mesh *me)
     return;
   }
 
-  if (frame_has_been_written_ || !args_.export_params->vcolors) {
+  if (!args_.export_params->vcolors) {
     return;
   }
 

and export the cube from this example file. The Python console already has a command set up, so you only need to run it by pressing {key Enter} there.

test_animated_vcolors.blend

The Alembic exporter currently (Blender 3.0 alpha, master @ 42e350b9a5) exports vertex colors only on the first exported frame. It would be nice if it would do this on every frame. This task was created so that [D8397: Alembic add option to write UVs on every frame](https://archive.blender.org/developer/D8397) can be limited to only exporting animated UV maps. Applying the same approch to vertex colors crashes the Alembic exporter: ``` terminate called after throwing an instance of 'Alembic::Util::v12::Exception' what(): OCompoundProperty::init() ERROR: EXCEPTION: Already have a property named: dp_paintmap ``` This is due to the `write_mcol()` function creating a new C++ object on every call, instead of keeping a reference to a single object. This causes the Alembic exporter to finalise the written property after a single frame, and then crash when a new property with the same name is created. To reproduce this crash, apply this patch: ``` diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index 29b29324ee3..b7d029683a3 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -364,7 +364,7 @@ void ABCGenericMeshWriter::write_arb_geo_params(struct Mesh *me) return; } - if (frame_has_been_written_ || !args_.export_params->vcolors) { + if (!args_.export_params->vcolors) { return; } ``` and export the cube from this example file. The Python console already has a command set up, so you only need to run it by pressing {key Enter} there. [test_animated_vcolors.blend](https://archive.blender.org/developer/F10056245/test_animated_vcolors.blend)
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscribers: @dr.sybren, @CodyWinchester

Added subscribers: @dr.sybren, @CodyWinchester

This issue was referenced by 4e2478940e

This issue was referenced by 4e2478940eb8803f28bfd7361ea3ff7dd83cd247
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sybren A. Stüvel self-assigned this 2022-09-27 10:17:42 +02:00
Author
Member

Marking as resolved, this should have been closed when D11278: Alembic: Allow exporting of animated vertex colors landed.

Marking as resolved, this should have been closed when [D11278: Alembic: Allow exporting of animated vertex colors](https://archive.blender.org/developer/D11278) landed.
Thomas Dinges added this to the 3.4 milestone 2023-02-07 19:01:34 +01:00
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
2 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#88074
No description provided.