Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/imbuf/intern/openexr/CMakeLists.txt5
-rw-r--r--source/blender/io/usd/CMakeLists.txt6
-rw-r--r--source/blender/io/usd/intern/usd_capi_export.cc2
-rw-r--r--source/blender/io/usd/intern/usd_capi_import.cc10
-rw-r--r--source/blender/io/usd/intern/usd_common.cc5
-rw-r--r--source/blender/io/usd/tests/usd_tests_common.cc7
-rw-r--r--source/blender/io/usd/usd.h2
7 files changed, 25 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/openexr/CMakeLists.txt b/source/blender/imbuf/intern/openexr/CMakeLists.txt
index c34a97f6837..509255c37b9 100644
--- a/source/blender/imbuf/intern/openexr/CMakeLists.txt
+++ b/source/blender/imbuf/intern/openexr/CMakeLists.txt
@@ -32,6 +32,11 @@ if(WITH_IMAGE_OPENEXR)
${OPENEXR_LIBRARIES}
)
add_definitions(-DWITH_OPENEXR)
+ if(WIN32)
+ if(EXISTS ${LIBDIR}/imath/bin/imath.dll)
+ add_definitions(-DIMATH_DLL)
+ endif()
+ endif()
endif()
blender_add_lib(bf_imbuf_openexr "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/source/blender/io/usd/CMakeLists.txt b/source/blender/io/usd/CMakeLists.txt
index 4f1bc29cd0d..efa22b2add2 100644
--- a/source/blender/io/usd/CMakeLists.txt
+++ b/source/blender/io/usd/CMakeLists.txt
@@ -9,9 +9,9 @@ if(UNIX AND NOT APPLE)
add_definitions(-D_GLIBCXX_PERMIT_BACKWARD_HASH)
endif()
if(WIN32)
- add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
+ add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN -DBOOST_DEBUG_PYTHON)
endif()
-add_definitions(-DPXR_STATIC)
+add_definitions(-DBOOST_ALL_NO_LIB)
# USD headers use deprecated TBB headers, silence warning.
add_definitions(-DTBB_SUPPRESS_DEPRECATED_MESSAGES=1)
@@ -56,6 +56,7 @@ set(INC_SYS
${USD_INCLUDE_DIRS}
${BOOST_INCLUDE_DIR}
${TBB_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_DIR}
)
set(SRC
@@ -122,6 +123,7 @@ set(LIB
list(APPEND LIB
${BOOST_LIBRARIES}
+ ${PYTHON_LIBRARIES}
)
if(WITH_OPENVDB)
diff --git a/source/blender/io/usd/intern/usd_capi_export.cc b/source/blender/io/usd/intern/usd_capi_export.cc
index 3977daaca4a..6731412e158 100644
--- a/source/blender/io/usd/intern/usd_capi_export.cc
+++ b/source/blender/io/usd/intern/usd_capi_export.cc
@@ -174,8 +174,6 @@ bool USD_export(bContext *C,
ViewLayer *view_layer = CTX_data_view_layer(C);
Scene *scene = CTX_data_scene(C);
- blender::io::usd::ensure_usd_plugin_path_registered();
-
blender::io::usd::ExportJobData *job = static_cast<blender::io::usd::ExportJobData *>(
MEM_mallocN(sizeof(blender::io::usd::ExportJobData), "ExportJobData"));
diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc
index 5808c6bc77a..cd50f41b9fb 100644
--- a/source/blender/io/usd/intern/usd_capi_import.cc
+++ b/source/blender/io/usd/intern/usd_capi_import.cc
@@ -385,13 +385,16 @@ static void import_freejob(void *user_data)
using namespace blender::io::usd;
+void USD_ensure_plugin_path_registered()
+{
+ blender::io::usd::ensure_usd_plugin_path_registered();
+}
+
bool USD_import(struct bContext *C,
const char *filepath,
const USDImportParams *params,
bool as_background_job)
{
- blender::io::usd::ensure_usd_plugin_path_registered();
-
/* Using new here since `MEM_*` functions do not call constructor to properly initialize data. */
ImportJobData *job = new ImportJobData();
job->bmain = CTX_data_main(C);
@@ -545,9 +548,6 @@ CacheArchiveHandle *USD_create_handle(struct Main * /*bmain*/,
const char *filepath,
ListBase *object_paths)
{
- /* Must call this so that USD file format plugins are loaded. */
- ensure_usd_plugin_path_registered();
-
pxr::UsdStageRefPtr stage = pxr::UsdStage::Open(filepath);
if (!stage) {
diff --git a/source/blender/io/usd/intern/usd_common.cc b/source/blender/io/usd/intern/usd_common.cc
index 2b6b6f4ed43..e5a83442140 100644
--- a/source/blender/io/usd/intern/usd_common.cc
+++ b/source/blender/io/usd/intern/usd_common.cc
@@ -11,6 +11,10 @@ namespace blender::io::usd {
void ensure_usd_plugin_path_registered()
{
+ /* if PXR_PYTHON_SUPPORT_ENABLED is defined, we *must* be dynamic and
+ the plugins are placed relative to the USD shared library hence no
+ hinting is required. */
+#ifndef PXR_PYTHON_SUPPORT_ENABLED
static bool plugin_path_registered = false;
if (plugin_path_registered) {
return;
@@ -22,6 +26,7 @@ void ensure_usd_plugin_path_registered()
const std::string blender_usd_datafiles = BKE_appdir_folder_id(BLENDER_DATAFILES, "usd");
/* The trailing slash indicates to the USD library that the path is a directory. */
pxr::PlugRegistry::GetInstance().RegisterPlugins(blender_usd_datafiles + "/");
+#endif
}
} // namespace blender::io::usd
diff --git a/source/blender/io/usd/tests/usd_tests_common.cc b/source/blender/io/usd/tests/usd_tests_common.cc
index 9f18a289433..d9285b3f3db 100644
--- a/source/blender/io/usd/tests/usd_tests_common.cc
+++ b/source/blender/io/usd/tests/usd_tests_common.cc
@@ -36,9 +36,12 @@ std::string register_usd_plugins_for_tests()
BLI_assert(path_len + 1 < FILE_MAX);
usd_datafiles_dir[path_len] = '/';
usd_datafiles_dir[path_len + 1] = '\0';
-
+ /* if PXR_PYTHON_SUPPORT_ENABLED is defined, we *must* be dynamic and
+ the plugins are placed relative to the USD shared library hence no
+ hinting is required. */
+#ifndef PXR_PYTHON_SUPPORT_ENABLED
pxr::PlugRegistry::GetInstance().RegisterPlugins(usd_datafiles_dir);
-
+#endif
return usd_datafiles_dir;
}
diff --git a/source/blender/io/usd/usd.h b/source/blender/io/usd/usd.h
index 3494d8ffdc3..98d544df251 100644
--- a/source/blender/io/usd/usd.h
+++ b/source/blender/io/usd/usd.h
@@ -119,7 +119,7 @@ struct CacheReader *CacheReader_open_usd_object(struct CacheArchiveHandle *handl
void USD_CacheReader_incref(struct CacheReader *reader);
void USD_CacheReader_free(struct CacheReader *reader);
-
+void USD_ensure_plugin_path_registered(void);
#ifdef __cplusplus
}
#endif