From 5bdbc88ab81891eff0dafaabf7f58a9c865d6e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 18 Apr 2017 16:36:33 +0200 Subject: Alembic import/export: write curve resolution to user property Curve resolution isn't natively supported by Alembic, hence it is stored in a user property "blender:resolution". I've looked at a Maya curves example file, but that also didn't contain any information about curve resolution. Differential Revision: https://developer.blender.org/D2634 Reviewers: kevindietrich --- tests/python/alembic_tests.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/python') diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py index 845b9bd6288..155cbd545f0 100755 --- a/tests/python/alembic_tests.py +++ b/tests/python/alembic_tests.py @@ -128,6 +128,7 @@ class AbstractAlembicTest(unittest.TestCase): converters = { 'bool_t': int, 'uint8_t': int, + 'int16_t': int, 'int32_t': int, 'float64_t': float, 'float32_t': float, @@ -141,7 +142,13 @@ class AbstractAlembicTest(unittest.TestCase): info = lines.popleft() if not info: continue - proptype, valtype_and_arrsize, name_and_extent = info.split() + parts = info.split() + proptype = parts[0] + + if proptype == 'CompoundProperty': + # To read those, call self.abcprop() on it. + continue + valtype_and_arrsize, name_and_extent = parts[1:] # Parse name and extent m = self.abcls_array.match(name_and_extent) @@ -291,6 +298,9 @@ class CurveExportTest(AbstractAlembicTest): abcprop = self.abcprop(abc, '/NurbsCurve/NurbsCurveShape/.geom') self.assertEqual(abcprop['.orders'], [4]) + abcprop = self.abcprop(abc, '/NurbsCurve/NurbsCurveShape/.geom/.userProperties') + self.assertEqual(abcprop['blender:resolution'], 10) + if __name__ == '__main__': parser = argparse.ArgumentParser() -- cgit v1.2.3