diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-01-31 12:24:28 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-01-31 13:29:29 +0300 |
commit | 14ccda75f6313849c5b4376f7e74def24084782e (patch) | |
tree | f2bc3367d202548927623781e9b8e56e68d0b307 /source/blender/usd/intern/usd_capi.cc | |
parent | bcacf47cbcf72d13773577543835aaada7c8a522 (diff) |
USD: Include USD library version in System Info
Pixar recently released USD 20.02 [1]. I think it's important for people
to be able to figure out which version of the USD library is used in
Blender.
[1] https://github.com/PixarAnimationStudios/USD/releases/tag/v20.02
This commit exposes the USD library information via `bpy.app.usd`, and
includes that info in the `system-info.txt` saved via Help → Save System
Info.
Reviewed by: brecht
Differential Revision: https://developer.blender.org/D6724
Diffstat (limited to 'source/blender/usd/intern/usd_capi.cc')
-rw-r--r-- | source/blender/usd/intern/usd_capi.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/usd/intern/usd_capi.cc b/source/blender/usd/intern/usd_capi.cc index 502f8677174..a7c268bf754 100644 --- a/source/blender/usd/intern/usd_capi.cc +++ b/source/blender/usd/intern/usd_capi.cc @@ -20,6 +20,7 @@ #include "usd.h" #include "usd_hierarchy_iterator.h" +#include <pxr/pxr.h> #include <pxr/usd/usd/stage.h> #include <pxr/usd/usdGeom/tokens.h> @@ -216,3 +217,17 @@ bool USD_export(bContext *C, return export_ok; } + +int USD_get_version(void) +{ + /* USD 19.11 defines: + * + * #define PXR_MAJOR_VERSION 0 + * #define PXR_MINOR_VERSION 19 + * #define PXR_PATCH_VERSION 11 + * #define PXR_VERSION 1911 + * + * So the major version is implicit/invisible in the public version number. + */ + return PXR_VERSION; +} |