From 14ccda75f6313849c5b4376f7e74def24084782e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 31 Jan 2020 10:24:28 +0100 Subject: USD: Include USD library version in System Info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- source/blender/usd/intern/usd_capi.cc | 15 +++++++++++++++ source/blender/usd/usd.h | 2 ++ 2 files changed, 17 insertions(+) (limited to 'source/blender/usd') 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 #include #include @@ -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; +} diff --git a/source/blender/usd/usd.h b/source/blender/usd/usd.h index c8e559c59f5..8a5575d53cf 100644 --- a/source/blender/usd/usd.h +++ b/source/blender/usd/usd.h @@ -54,6 +54,8 @@ bool USD_export(struct bContext *C, const struct USDExportParams *params, bool as_background_job); +int USD_get_version(void); + #ifdef __cplusplus } #endif -- cgit v1.2.3