diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-07 15:30:55 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-07 15:30:55 +0300 |
commit | 98bee41c8a3f78c612f0c4ee587fceb2730f26b4 (patch) | |
tree | ffc85de8b4f8794c6a9e187697b6292db66e668c /tests/python | |
parent | 70b1c09d7a40912b5dccc69fc95cbee2e2388eab (diff) |
IO: Reversed persistent ID order in exports to Alembic and USD
Each duplicated (a.k.a. instanced) object has a Persistent ID, which
identifies a dupli within the context of its duplicator. This ID
consists of several numbers when there are nested duplis (for example a
mesh instancing empties on its vertices, where each empty instances a
collection). When exporting to Alembic/USD, these are used to uniquely
name the duplicated objects in the export.
This commit reverses the order of the persistent ID numbers, so that the
first number identifies the first level of recursion. This produces
trees like this:
ABC
`--Triangle
|--Triangle
|--Empty-1
| `--Pole-1-0
| |--Pole
| `--Block-1-1
| `--Block
|--Empty
| `--Pole-0
| |--Pole
| `--Block-1
| `--Block
|--Empty-2
| `--Pole-2-0
| |--Pole
| `--Block-2-1
| `--Block
`--Empty-0
`--Pole-0-0
|--Pole
`--Block-0-1
`--Block
It is now clearer that `Pole-2-0` and `Block-2-1` are instanced by
`Empty-2`. Before this commit, they would have been named `Pole-0-2` and
`Block-1-2`.
Diffstat (limited to 'tests/python')
-rw-r--r-- | tests/python/alembic_tests.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py index 4d7ae97b327..66545dc85c7 100644 --- a/tests/python/alembic_tests.py +++ b/tests/python/alembic_tests.py @@ -254,7 +254,7 @@ class DupliGroupExportTest(AbstractAlembicTest): # `--Triangle # |--Triangle # |--Empty-1 - # | `--Pole-0-1 + # | `--Pole-1-0 # | |--Pole # | `--Block-1-1 # | `--Block @@ -264,18 +264,18 @@ class DupliGroupExportTest(AbstractAlembicTest): # | `--Block-1 # | `--Block # |--Empty-2 - # | `--Pole-0-2 + # | `--Pole-2-0 # | |--Pole - # | `--Block-1-2 + # | `--Block-2-1 # | `--Block # `--Empty-0 # `--Pole-0-0 # |--Pole - # `--Block-1-0 + # `--Block-0-1 # `--Block # Now check the resulting Alembic file. - xform = self.abcprop(abc, '/Triangle/Empty-1/Pole-0-1/Block-1-1/.xform') + xform = self.abcprop(abc, '/Triangle/Empty-1/Pole-1-0/Block-1-1/.xform') self.assertEqual(1, xform['.inherits']) self.assertAlmostEqualFloatArray( xform['.vals'], @@ -288,17 +288,17 @@ class DupliGroupExportTest(AbstractAlembicTest): # If the property can be gotten, the hierarchy is okay. No need to actually check each xform. self.abcprop(abc, '/Triangle/.xform') self.abcprop(abc, '/Triangle/Empty-1/.xform') - self.abcprop(abc, '/Triangle/Empty-1/Pole-0-1/.xform') - self.abcprop(abc, '/Triangle/Empty-1/Pole-0-1/Block-1-1/.xform') + self.abcprop(abc, '/Triangle/Empty-1/Pole-1-0/.xform') + self.abcprop(abc, '/Triangle/Empty-1/Pole-1-0/Block-1-1/.xform') self.abcprop(abc, '/Triangle/Empty/.xform') self.abcprop(abc, '/Triangle/Empty/Pole-0/.xform') self.abcprop(abc, '/Triangle/Empty/Pole-0/Block-1/.xform') self.abcprop(abc, '/Triangle/Empty-2/.xform') - self.abcprop(abc, '/Triangle/Empty-2/Pole-0-2/.xform') - self.abcprop(abc, '/Triangle/Empty-2/Pole-0-2/Block-1-2/.xform') + self.abcprop(abc, '/Triangle/Empty-2/Pole-2-0/.xform') + self.abcprop(abc, '/Triangle/Empty-2/Pole-2-0/Block-2-1/.xform') self.abcprop(abc, '/Triangle/Empty-0/.xform') self.abcprop(abc, '/Triangle/Empty-0/Pole-0-0/.xform') - self.abcprop(abc, '/Triangle/Empty-0/Pole-0-0/Block-1-0/.xform') + self.abcprop(abc, '/Triangle/Empty-0/Pole-0-0/Block-0-1/.xform') class CurveExportTest(AbstractAlembicTest): |