Page MenuHome

Add basic USD import test.
ClosedPublic

Authored by Michael Kowalski (makowalski) on Sep 13 2021, 9:06 PM.

Details

Summary

Added a very simple test to import a USD prim hierarchy into Blender. This task is per Sybren's request in https://developer.blender.org/D10700:

One thing that would be good to add (as another patch) on short notice is a little unit test that imports a simple USDA file and then verifies that the import went ok. That way we have at least a canary test to ensure the importer works at all. This'll catch any linker errors, missing dependencies, etc.

This file can easily extended to test additional USD IO functionality in the future.

I'm attaching the USDA and .blend data files required for the test.

Diff Detail

Repository
rB Blender
Branch
temp-usd-io-test (branched from master)
Build Status
Buildable 16986
Build 16986: arc lint + arc unit

Event Timeline

Michael Kowalski (makowalski) requested review of this revision.Sep 13 2021, 9:06 PM
Michael Kowalski (makowalski) created this revision.
Sybren A. Stüvel (sybren) requested changes to this revision.Sep 16 2021, 3:13 PM

Overall things look good.

There is already a bf_io_usd_tests (plural) test suite defined in C++, so having bl_usd_io_test.py that is actually called script_usd_io in CTest is a bit confusing. The current naming seems to be from the Alembic tests, but I've come to regret that naming as I never know what's where ;-)

It's probably better to just name both the Python file bl_usd_import_test.py and the test suite definition in CMake usd_import_test or something like that. From what I've seen in the current test suites, the running-inside-blender scripts are prefixed with bl_.

tests/python/bl_usd_io_test.py
21

I don't see any os.something code, so I think this import can be removed.

28

Why do you need this when you also use pathlib? I think it's unused, even.

44

This test doesn't export, so I think it's better to just call this USDImportTest.

This revision now requires changes to proceed.Sep 16 2021, 3:13 PM

Updated the USD import test per review by Sybren.

Michael Kowalski (makowalski) marked 3 inline comments as done.EditedSep 20 2021, 3:39 AM

Thanks for the helpful review, Sybren! Good catch on the unneeded imports.

Thanks, the code LGTM.

The empy.blend is still from Blender 2.78. As such, it has workspaces like "Game Logic" which are not really relevant any more. This one could be used instead:

It also brings down the file size from 85 KiB to 78 KiB, which of course is a tremendous space saver :P

Can be committed with the new empty.blend.

This revision is now accepted and ready to land.Oct 14 2021, 11:32 AM

As of yesterday (Oct 20), I committed all files for this patch and this test appears to be running successfully as part of the build.

Closing this patch, as it's been committed in Git & SVN.