Alembic import - Incorrect object pivots #70408

Closed
opened 2019-10-01 07:20:18 +02:00 by Jani Kahrama · 12 comments

System Information
Operating system: Darwin-18.7.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon R9 M370X OpenGL Engine ATI Technologies Inc. 4.1 ATI-2.11.20

Blender Version
Broken: version: 2.81 (sub 12), branch: master, commit date: 2019-09-22 20:38, hash: 52bdf522af
Worked: (optional)

Short description of error
Alembic import places pivots of objects at origin, ignoring object pivot data in the file.

Exact steps for others to reproduce the error
Import pivot_debug.abc in Blender
Observe pivots of all objects at 0, 0, 0
Compare to pivot_debug_expectedresult.jpg

When pivot_debug.abc is imported back into Maya, the pivots are in their expected locations.

pivot_debug_expectedresult.jpg

pivot_debug.abc

**System Information** Operating system: Darwin-18.7.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon R9 M370X OpenGL Engine ATI Technologies Inc. 4.1 ATI-2.11.20 **Blender Version** Broken: version: 2.81 (sub 12), branch: master, commit date: 2019-09-22 20:38, hash: `52bdf522af` Worked: (optional) **Short description of error** Alembic import places pivots of objects at origin, ignoring object pivot data in the file. **Exact steps for others to reproduce the error** Import pivot_debug.abc in Blender Observe pivots of all objects at 0, 0, 0 Compare to pivot_debug_expectedresult.jpg When pivot_debug.abc is imported back into Maya, the pivots are in their expected locations. ![pivot_debug_expectedresult.jpg](https://archive.blender.org/developer/F7783145/pivot_debug_expectedresult.jpg) [pivot_debug.abc](https://archive.blender.org/developer/F7783148/pivot_debug.abc)
Author

Added subscriber: @Frand

Added subscriber: @Frand
Member

Added subscribers: @dr.sybren, @lichtwerk

Added subscribers: @dr.sybren, @lichtwerk
Sybren A. Stüvel was assigned by Philipp Oeser 2019-10-02 11:06:56 +02:00
Member

Not sure about this.

Blender seems to be able to preserve pivot points just fine.
If I import pivot_debug.abc into an empty scene, select all meshes, do Object > Set Origin > Origin To Geometry and export as alembic again, I end up with
#70408.abc
We can also remove the parent empty for clarity:
T70408_no_parentempty.abc
If I import that, pivots are preserved just fine.

Now what is the difference between pivot_debug.abc and #70408.abc?
We can look at it with abcls

./abcls -a -v -r pivot_debug.abc 
/:
wood_stand   .childBnds   Box((-0.576641, -1.78814e-07, -0.513623), (0.576641, 1.20603, 0.513623))
statistics   PolyStaticNum 9 PolyStaticCVs 1698 PolyStaticFaces 1680 TransStaticNum 10 
1.samples   1

/wood_stand:
wood_stand_part1   wood_stand_part2   wood_stand_part3   wood_stand_part4   wood_stand_part5   wood_stand_part6   wood_stand_part7   wood_stand_part8   wood_stand_part9   .xform   

/wood_stand/wood_stand_part1:
wood_stand_partShape1   .xform   
/wood_stand/wood_stand_part1/.xform:
.inherits   1
.ops   19, 19, 17, 17
.vals   -0.491225, 0.387752, -0.0152625, 0.491225, -0.387752, 0.0152625, -0.491225, 0.387752, -0.0152625, 0.491225, -0.387752, 0.0152625
isNotConstantIdentity   1
./abcls -a -v -r T70408.abc 
/:
wood_stand   .childBnds   Box((-0.576641, -1.78814e-07, -0.513623), (0.576641, 1.20603, 0.513623))

/wood_stand:
wood_stand_part1   wood_stand_part2   wood_stand_part3   wood_stand_part4   wood_stand_part5   wood_stand_part6   wood_stand_part7   wood_stand_part8   wood_stand_part9   .xform   visible   1

/wood_stand/.xform:
.inherits   0
.ops   48
.vals   1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1

/wood_stand/wood_stand_part1:
wood_stand_part1Shape   .xform   visible   1

/wood_stand/wood_stand_part1/.xform:
.inherits   1
.ops   48
.vals   1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.491225, 0.38778, 0.0128468, 1
isNotConstantIdentity   1
./abcls -a -v -r T70408_no_parentempty.abc 
/:
wood_stand_part1   wood_stand_part2   wood_stand_part3   wood_stand_part4   wood_stand_part5   wood_stand_part6   wood_stand_part7   wood_stand_part8   wood_stand_part9   .childBnds   Box((-0.576641, -1.78814e-07, -0.513623), (0.576641, 1.20603, 0.513623))

/wood_stand_part1:
wood_stand_part1Shape   .xform   visible   1

/wood_stand_part1/.xform:
.inherits   0
.ops   48
.vals   1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.491225, 0.38778, 0.0128468, 1
isNotConstantIdentity   1

@dr.sybren: I assume this is about the different XFormOps ? Is there a resource where we can find out about these used values [we: 48, them: 19, 19, 17, 17]
(couldnt find anything on https://docs.alembic.io/search.html?q=Xform)

Not sure about this. Blender seems to be able to preserve pivot points just fine. If I import `pivot_debug.abc` into an empty scene, select all meshes, do `Object` > `Set Origin` > `Origin To Geometry` and export as alembic again, I end up with [#70408.abc](https://archive.blender.org/developer/F7785375/T70408.abc) We can also remove the parent empty for clarity: [T70408_no_parentempty.abc](https://archive.blender.org/developer/F7785379/T70408_no_parentempty.abc) If I import that, pivots are preserved just fine. Now what is the difference between `pivot_debug.abc` and `#70408.abc`? We can look at it with `abcls` ``` ./abcls -a -v -r pivot_debug.abc /: wood_stand .childBnds Box((-0.576641, -1.78814e-07, -0.513623), (0.576641, 1.20603, 0.513623)) statistics PolyStaticNum 9 PolyStaticCVs 1698 PolyStaticFaces 1680 TransStaticNum 10 1.samples 1 /wood_stand: wood_stand_part1 wood_stand_part2 wood_stand_part3 wood_stand_part4 wood_stand_part5 wood_stand_part6 wood_stand_part7 wood_stand_part8 wood_stand_part9 .xform /wood_stand/wood_stand_part1: wood_stand_partShape1 .xform /wood_stand/wood_stand_part1/.xform: .inherits 1 .ops 19, 19, 17, 17 .vals -0.491225, 0.387752, -0.0152625, 0.491225, -0.387752, 0.0152625, -0.491225, 0.387752, -0.0152625, 0.491225, -0.387752, 0.0152625 isNotConstantIdentity 1 ``` ``` ./abcls -a -v -r T70408.abc /: wood_stand .childBnds Box((-0.576641, -1.78814e-07, -0.513623), (0.576641, 1.20603, 0.513623)) /wood_stand: wood_stand_part1 wood_stand_part2 wood_stand_part3 wood_stand_part4 wood_stand_part5 wood_stand_part6 wood_stand_part7 wood_stand_part8 wood_stand_part9 .xform visible 1 /wood_stand/.xform: .inherits 0 .ops 48 .vals 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 /wood_stand/wood_stand_part1: wood_stand_part1Shape .xform visible 1 /wood_stand/wood_stand_part1/.xform: .inherits 1 .ops 48 .vals 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.491225, 0.38778, 0.0128468, 1 isNotConstantIdentity 1 ``` ``` ./abcls -a -v -r T70408_no_parentempty.abc /: wood_stand_part1 wood_stand_part2 wood_stand_part3 wood_stand_part4 wood_stand_part5 wood_stand_part6 wood_stand_part7 wood_stand_part8 wood_stand_part9 .childBnds Box((-0.576641, -1.78814e-07, -0.513623), (0.576641, 1.20603, 0.513623)) /wood_stand_part1: wood_stand_part1Shape .xform visible 1 /wood_stand_part1/.xform: .inherits 0 .ops 48 .vals 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.491225, 0.38778, 0.0128468, 1 isNotConstantIdentity 1 ``` @dr.sybren: I assume this is about the different XFormOps ? Is there a resource where we can find out about these used values [we: 48, them: 19, 19, 17, 17] (couldnt find anything on https://docs.alembic.io/search.html?q=Xform)
Author

The objects are exported from Maya 2019.1, please let me know if there are specific test objects you'd like me to generate.

The objects are exported from Maya 2019.1, please let me know if there are specific test objects you'd like me to generate.
Author

Attached is the case of a cube with the pivot manually set to the center of its top face. The file imports back to Maya with the pivot in the same location.

pivotCube.PNG
testCube.abc

Attached is the case of a cube with the pivot manually set to the center of its top face. The file imports back to Maya with the pivot in the same location. ![pivotCube.PNG](https://archive.blender.org/developer/F7785424/pivotCube.PNG) [testCube.abc](https://archive.blender.org/developer/F7785423/testCube.abc)
Member

This is abcls for that file (still assume it has to do with the .ops part of the XForm?)

./abcls -a -v -r testCube.abc 
/:
pCube1   .childBnds   Box((-0.5, 0, -0.5), (0.5, 1, 0.5))
statistics   PolyStaticNum 1 PolyStaticCVs 8 PolyStaticFaces 6 TransStaticNum 1 
1.samples   1

/pCube1:
pCubeShape1   .xform   
/pCube1/.xform:
.inherits   1
.ops   19, 19, 17, 17
.vals   0, 1, 0, -0, -1, -0, 0, 1, 0, -0, -1, -0
isNotConstantIdentity   1
This is `abcls` for that file (still assume it has to do with the `.ops` part of the XForm?) ``` ./abcls -a -v -r testCube.abc /: pCube1 .childBnds Box((-0.5, 0, -0.5), (0.5, 1, 0.5)) statistics PolyStaticNum 1 PolyStaticCVs 8 PolyStaticFaces 6 TransStaticNum 1 1.samples 1 /pCube1: pCubeShape1 .xform /pCube1/.xform: .inherits 1 .ops 19, 19, 17, 17 .vals 0, 1, 0, -0, -1, -0, 0, 1, 0, -0, -1, -0 isNotConstantIdentity 1 ```
Member

Only thing I can think of is we are not hadling (more or less a stab in the dark...)

Alembic::AbcGeom::kScalePivotPointHint
Alembic::AbcGeom::kRotatePivotPointHint

https://github.com/alembic/alembic/blob/master/maya/AbcImport/XformHelper.cpp

@dr.sybren: does this ring a bell?

Only thing I can think of is we are not hadling (more or less a stab in the dark...) `Alembic::AbcGeom::kScalePivotPointHint` `Alembic::AbcGeom::kRotatePivotPointHint` https://github.com/alembic/alembic/blob/master/maya/AbcImport/XformHelper.cpp @dr.sybren: does this ring a bell?

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Blender simply uses the transformation matrix of each object, which is constructed from the Alembic file by the Alembic library itself (source). The Alembic file can contain various separate operations, or the final matrix. In the case of this Maya-generated file, it contains a sequence of operations. This is such a sequence:

XForm .xform contains 4 operations:
  - type 1  Translate -0.491225, 0.387752, -0.015263
  - type 1  Translate 0.491225, -0.387752, 0.015263
  - type 1  Translate -0.491225, 0.387752, -0.015263
  - type 1  Translate 0.491225, -0.387752, 0.015263
OBwood_stand_part1
1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000

As you can see, the transformations cancel each other out, and result in a unity matrix. The same you can see in the cube example.

Maya has a pivot point that is separate from the object origin, and it encodes this pivot point in the transform operations. Blender doesn't have a separate per-object pivot point, so we cannot load this information. To use the pivot point as object origin, bake the pivot points in Maya and then export to Alembic.

Closing this as 'Invalid' as this does not constitute a bug in Blender.

Blender simply uses the transformation matrix of each object, which is constructed from the Alembic file by the Alembic library itself ([source](https://github.com/alembic/alembic/blob/8bf5f3494ead3ccb8820fd1768d3f8c764e43fb9/lib/Alembic/AbcGeom/XformSample.cpp#L550)). The Alembic file can contain various separate operations, or the final matrix. In the case of this Maya-generated file, it contains a sequence of operations. This is such a sequence: ``` XForm .xform contains 4 operations: - type 1 Translate -0.491225, 0.387752, -0.015263 - type 1 Translate 0.491225, -0.387752, 0.015263 - type 1 Translate -0.491225, 0.387752, -0.015263 - type 1 Translate 0.491225, -0.387752, 0.015263 OBwood_stand_part1 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 ``` As you can see, the transformations cancel each other out, and result in a unity matrix. The same you can see in the cube example. Maya has a pivot point that is separate from the object origin, and it encodes this pivot point in the transform operations. Blender doesn't have a separate per-object pivot point, so we cannot load this information. To use the pivot point as object origin, [bake the pivot points](https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Maya-Basics/files/GUID-378D7FF6-492F-4DA4-A468-507E6ABF8B58-htm.html) in Maya and then export to Alembic. Closing this as 'Invalid' as this does not constitute a bug in Blender.
Author

In #70408#787609, @lichtwerk wrote:
Only thing I can think of is we are not hadling (more or less a stab in the dark...)

Alembic::AbcGeom::kScalePivotPointHint
Alembic::AbcGeom::kRotatePivotPointHint

https://github.com/alembic/alembic/blob/master/maya/AbcImport/XformHelper.cpp

@dr.sybren: does this ring a bell?

In Maya, I do notice the pivot point referred to as RotationPivot, so this may very well be it.

> In #70408#787609, @lichtwerk wrote: > Only thing I can think of is we are not hadling (more or less a stab in the dark...) > > `Alembic::AbcGeom::kScalePivotPointHint` > `Alembic::AbcGeom::kRotatePivotPointHint` > > https://github.com/alembic/alembic/blob/master/maya/AbcImport/XformHelper.cpp > > @dr.sybren: does this ring a bell? In Maya, I do notice the pivot point referred to as RotationPivot, so this may very well be it.
Member

thx for learing that up @dr.sybren

thx for learing that up @dr.sybren
Author

Thank you for the explanation, baking pivots in Maya resolves our problem.

Thank you for the explanation, baking pivots in Maya resolves our problem.
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
3 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#70408
No description provided.