Alembic: Wrong result when exporting and importing curves #76746

Closed
opened 2020-05-14 14:26:03 +02:00 by Germano Cavalcante · 14 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.13586 Core Profile Context 19.50.01.05 26.20.15001.5006

Blender Version
Broken: version: 2.90 (sub 1), branch: master, commit date: 2020-05-12 22:14, hash: f9d0f59bed
Worked: never

Short description of error
I'm not familiar with the alembic exporter, but the result of exporting and importing curves doesn't seem right because the coordinates of the vertices are messy.

Exact steps for others to reproduce the error

  • Open attached file.
  • Export the curve object with Alembic
  • Load a new file
  • Import the created .abc file.
    The result is messy curves.
    curves_to_alembic.blend
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.13586 Core Profile Context 19.50.01.05 26.20.15001.5006 **Blender Version** Broken: version: 2.90 (sub 1), branch: master, commit date: 2020-05-12 22:14, hash: `f9d0f59bed` Worked: never **Short description of error** I'm not familiar with the alembic exporter, but the result of exporting and importing curves doesn't seem right because the coordinates of the vertices are messy. **Exact steps for others to reproduce the error** - Open attached file. - Export the curve object with Alembic - Load a new file - Import the created .abc file. The result is messy curves. [curves_to_alembic.blend](https://archive.blender.org/developer/F8535200/curves_to_alembic.blend)
Author
Member

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Author
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Germano Cavalcante changed title from Alembic: Problem when exporting and importing curves to Alembic: Wrong result when exporting and importing curves 2020-05-14 21:40:17 +02:00

This has to do with Blender supporting multiple curve types in one Curve object, which isn't possible in Alembic. I can update the Alembic exporter to detect such situations and then simply only export the curves of one type and skip the others. Although that'll make the Alembic file incomplete, that way at least it should be valid.

This has to do with Blender supporting multiple curve types in one Curve object, which isn't possible in Alembic. I can update the Alembic exporter to detect such situations and then simply only export the curves of one type and skip the others. Although that'll make the Alembic file incomplete, that way at least it should be valid.
Sybren A. Stüvel self-assigned this 2020-05-18 11:27:41 +02:00

I'm postponing this until after 2.83, as this requires a more thorough refactor of the existing Curves exporter. Doing this properly is easier with the upcoming refactor of the Alembic exporter, which is planned for 2.90.

I'm postponing this until after 2.83, as this requires a more thorough refactor of the existing Curves exporter. Doing this properly is easier with the upcoming refactor of the Alembic exporter, which is planned for 2.90.

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

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

The current curves exporter is severely limited; it ignores the curve type (Nurb::type) and tries to deduce the type to write from the existence of data in either Nurb::bp or Nurb::bezt. This will only work correctly in certain specific cases, which are unfortunately not documented.

There is no clear (public) definition on how to write curves to Alembic. Writing curves properly, even when only aiming for compatibility with Blender itself, will require some design work.

In light of this, I'm changing this task's subtype from Bug to Known Issue.

The current curves exporter is severely limited; it ignores the curve type (`Nurb::type`) and tries to deduce the type to write from the existence of data in either `Nurb::bp` or `Nurb::bezt`. This will only work correctly in certain specific cases, which are unfortunately not documented. There is no clear (public) definition on how to write curves to Alembic. Writing curves properly, even when only aiming for compatibility with Blender itself, will require some design work. In light of this, I'm changing this task's subtype from Bug to Known Issue.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Sybren A. Stüvel removed their assignment 2021-01-14 18:00:12 +01:00

Added subscriber: @MSherak

Added subscriber: @MSherak

Don't know if this will help, but here is a Alembic file exported out of Maya that can load into Blender and Houdini correctly. It's one Nurb curve exported. Maybe the deconstruction of the file will help with how curves are stored in Alembic so the they can be exported from Blender. MayaCurveExport.abc

Edit: Oh and set the Resolution Preview U to 3 and it will look like it does in Maya.

Don't know if this will help, but here is a Alembic file exported out of Maya that can load into Blender and Houdini correctly. It's one Nurb curve exported. Maybe the deconstruction of the file will help with how curves are stored in Alembic so the they can be exported from Blender. [MayaCurveExport.abc](https://archive.blender.org/developer/F10268346/MayaCurveExport.abc) Edit: Oh and set the Resolution Preview U to 3 and it will look like it does in Maya.

Added subscriber: @aplus

Added subscriber: @aplus

I ran into this a few months ago. From what I can tell a single curve will be exported fine, but as soon as multiple curves exist in same object, the exported curves in the alembic file will no longer match the original after alembic import.

I have attached blend file and alembic files of curves objects created with default settings and duplicated in EDIT mode, before export.
Hope this helps.

For nurbs, I noticed that the the points array for any curve that is not the 1st curve end up having a multiple of the number of points in splines[0]

for s in bpy.data.objects["NurbsCurveSub"].data.splines:

... print (len(s.points))
10
10

for s in bpy.data.objects["NurbsCurveSub.001"].data.splines:

... print (len(s.points))
10
20

curvesToAlembic.blend

nurbs.abc nurbsSub.abc

bezier.abc

README.txt

I ran into this a few months ago. From what I can tell a single curve will be exported fine, but as soon as multiple curves exist in same object, the exported curves in the alembic file will no longer match the original after alembic import. I have attached blend file and alembic files of curves objects created with default settings and duplicated in EDIT mode, before export. Hope this helps. For nurbs, I noticed that the the points array for any curve that is not the 1st curve end up having a multiple of the number of points in splines[0] >>> for s in bpy.data.objects["NurbsCurveSub"].data.splines: ... print (len(s.points)) 10 10 >>> for s in bpy.data.objects["NurbsCurveSub.001"].data.splines: ... print (len(s.points)) 10 20 [curvesToAlembic.blend](https://archive.blender.org/developer/F10330582/curvesToAlembic.blend) [nurbs.abc](https://archive.blender.org/developer/F10330583/nurbs.abc) [nurbsSub.abc](https://archive.blender.org/developer/F10330584/nurbsSub.abc) [bezier.abc](https://archive.blender.org/developer/F10330585/bezier.abc) [README.txt](https://archive.blender.org/developer/F10330586/README.txt)

I would just like to add, that hair would be a classic example where export/import of alembic curves is needed. Right now the solution is to rely on another 3rd party software.

Hair curves are also most likely to be of the same type, so this may be a more feasible problem to look into and provide a solution depending on priorities.

Thank you.

I would just like to add, that hair would be a classic example where export/import of alembic curves is needed. Right now the solution is to rely on another 3rd party software. Hair curves are also most likely to be of the same type, so this may be a more feasible problem to look into and provide a solution depending on priorities. Thank you.

This issue was referenced by 4c1393c202

This issue was referenced by 4c1393c202d41422c16d7ccb04f90a3661525f6e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Kévin Dietrich self-assigned this 2022-03-31 15:02:44 +02: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
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#76746
No description provided.