Skip to content

Commit

Permalink
Merge pull request #28 from frenchdog/feature/BIFROST-10390/update_fo…
Browse files Browse the repository at this point in the history
…r_bifrost2_12_release

BIFROST-10929 Update for Bifrost 2.12.0.0
  • Loading branch information
frenchdog authored Oct 30, 2024
2 parents 93fd906 + 806ec18 commit dbeb0bf
Show file tree
Hide file tree
Showing 38 changed files with 4,456 additions and 388 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [1.3.1] - 2024-10-29 (Bifrost 2.12)

### Build
- BIFROST-10711 - Prevent older boost from using deprecated templates
- BIFROST-10578 - Fix sanitizer errors

### Feature
- BIFROST-10691 - Set target layer using layer or display name instead of index

- Add layer input to add_to_stage and add_to_stage_in_variant nodes
- Add layer_display_name input to set_edit_layer node
- Add USD::Layer::get_layer_display_name Operator

### Bugfix
- BIFROST-10745 - Fix Bifrost Browser scene "create_point_instancer_from_usd_file_example.ma".

Since the _scene_info_ node does not prepend a '/' anymore for the scene directory,
a '/' separator has been added to build the path of the referenced USD file.

- BIFROST-11053 - Fix error message when opening Data Browser for the first time

## [1.3.0] - 2024-07-29 (Bifrost 2.11)

### Build
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")

# Boost headers are indirectly included by USD and Boost is still using
# std::unary_function which was deprecated in C++11 and removed in C++17.
# Defining BOOST_NO_CXX98_FUNCTION_BASE prevents Boost from using deprecated
# templates. This seems to be fixed in Boost >= 1.81, so we may be able to
# remove that when the version of boost shipped with USD is updated.
# _HAS_AUTO_PTR_ETC is also needed for older boost versions.
add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE=1)
add_definitions(-D_HAS_AUTO_PTR_ETC=0)

#==============================================================================
# Define common build variables
#==============================================================================
Expand Down Expand Up @@ -152,6 +161,7 @@ include(${BIFUSD_TOOLS_DIR}/gtest.cmake)
#==============================================================================

find_package(Bifrost REQUIRED SDK)
find_package(OpenGL REQUIRED)
find_package(USD REQUIRED)

#==============================================================================
Expand Down
7 changes: 6 additions & 1 deletion bifrost_hydra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ endif()
find_package(Bifrost REQUIRED SDK)

add_subdirectory(src)
add_subdirectory(test)

if (NOT BIFUSD_ENABLE_ADDRESS_SANITIZER)
# Skip tests when using adress sanitizer as when building Bifrost USD standalone, it errors with:
# "AddressSanitizer:DEADLYSIGNAL 1: AddressSanitizer: nested bug in the same thread, aborting."
add_subdirectory(test)
endif()
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-
// Copyright 2023 Autodesk, Inc.
// Copyright 2024 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,8 @@

#include "BifrostGraphGenerativeProcedural.h"

#include <bifusd/config/CfgWarningMacros.h>

#include <pxr/imaging/hdGp/generativeProceduralPluginRegistry.h>

PXR_NAMESPACE_USING_DIRECTIVE
Expand All @@ -32,7 +34,11 @@ HdGpGenerativeProcedural* BifrostGraphGenerativeProceduralPlugin::Construct(

///////////////////////////////////////////////////////////////////////////////

BIFUSD_WARNING_PUSH
// Silence USD warning that we cast from 'void (*)(TfType *)' to 'void (*)()'
BIFUSD_WARNING_DISABLE_CLANG_160(-Wcast-function-type-strict)
TF_REGISTRY_FUNCTION(TfType) {
BIFUSD_WARNING_POP
HdGpGenerativeProceduralPluginRegistry::Define<
BifrostGraphGenerativeProceduralPlugin,
HdGpGenerativeProceduralPlugin>();
Expand Down
7 changes: 5 additions & 2 deletions bifrost_hydra/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ set(usd_env_config
USD_TEST_OUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
)

if (BIFUSD_ENABLE_ADDRESS_SANITIZER)
set(asan_options ASAN_OPTIONS=detect_container_overflow=0)
endif()

foreach(test_file ${test_files})
configure_bifusd_unittest(
${test_file} "bifrost_hydra"
LINK_LIBS ${libs} ${pxr_libs}
SHARED_LIB_DIRS ${BIFUSD_EXTRA_BUILD_AND_TEST_PATHS} ${Maya_SHARED_LIB_DIRS}
ENV_VARS ${bifrost_env_config} ${usd_env_config}
ASAN_OPTIONS ${ASAN_OPTIONS}
ENV_VARS ${bifrost_env_config} ${usd_env_config} ${asan_options}
OPTIONS $<${BIFUSD_IS_MSC}:/wd4251 /wd4273>
)
get_unittest_target(unittest_target "bifrost_hydra" ${test_file})
Expand Down
6 changes: 5 additions & 1 deletion cmake/bifusd/compiler_Clang.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-
#*****************************************************************************
# Copyright 2023 Autodesk, Inc.
# Copyright 2024 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -188,3 +188,7 @@ set(CMAKE_CXX_FLAGS_DEBUG_INIT "${cxx_flags_debug}")

# compiler flags
set(cxx_flags -fPIC)

if (BIFUSD_ENABLE_ADDRESS_SANITIZER)
list(APPEND cxx_flags -fsanitize=address)
endif()
3 changes: 2 additions & 1 deletion cmake/bifusd/gtest.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-
#*****************************************************************************
# Copyright 2022 Autodesk, Inc.
# Copyright 2024 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,7 @@ if(NOT BIFUSD_GTEST_LOCATION)
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
GIT_CONFIG core.longpaths=true
)

# Populate
Expand Down
8 changes: 7 additions & 1 deletion cmake/bifusd/src/config/CfgWarningMacros.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-
// Copyright 2022 Autodesk, Inc.
// Copyright 2024 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -108,6 +108,12 @@
#define BIFUSD_WARNING_DISABLE_CLANG_80(a)
#endif

#if BIFUSD_IS_CLANG && (__clang_major__ >= 16)
#define BIFUSD_WARNING_DISABLE_CLANG_160(a) BIFUSD_WARNING_DISABLE(a)
#else
#define BIFUSD_WARNING_DISABLE_CLANG_160(a)
#endif

#if BIFUSD_IS_GCC
#define BIFUSD_WARNING_DISABLE_GCC(a) BIFUSD_WARNING_DISABLE(a)
#else
Expand Down
3 changes: 2 additions & 1 deletion cmake/bifusd/utils.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-
#*****************************************************************************
# Copyright 2023 Autodesk, Inc.
# Copyright 2024 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@ endif()
set(bifusd_utils_included true)

option(BIFUSD_USE_DEBUGGER "Launch unit tests using the platform-specific debugger." OFF)
option(BIFUSD_ENABLE_ADDRESS_SANITIZER "Enable AddressSanitizer compiler instrumentations." OFF)

# Export the given list of variables from the local scope to the parent scope.
#
Expand Down
2 changes: 1 addition & 1 deletion cmake/version.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set(BIFROST_USD_PACK_MAJOR_VERSION 1)
set(BIFROST_USD_PACK_MINOR_VERSION 3)
set(BIFROST_USD_PACK_PATCH_LEVEL 0)
set(BIFROST_USD_PACK_PATCH_LEVEL 1)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Creates a Bifrost Graph with a _create_usd_component_ compound. The graph result
- (optional) A _Look_ VariantSet to select different look variants from the default prim.
- The _extentsHint_ attributes to display the component as a bounding box added on the default prim.
- The _assetInfo_ metadata
- A _Bifrost::usd_component_ dictionnary (in customLayerData) storing information like the host scene who generated the component.
- A _Bifrost::usd_component_ dictionary (in customLayerData) storing information like the host scene who generated the component.

```
Expand Down
22 changes: 1 addition & 21 deletions src/BifrostUsd/Attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include <Amino/Cpp/ClassDefine.h>

/// \todo BIFROST-6874 remove PXR_NS::Work_EnsureDetachedTaskProgress();
#include <pxr/base/work/detachedTask.h>

namespace BifrostUsd {
Attribute::Attribute(PXR_NS::UsdAttribute attribute, Amino::Ptr<Prim> prim)
Expand All @@ -29,24 +27,6 @@ Attribute::Attribute(PXR_NS::UsdAttribute attribute, Amino::Ptr<Prim> prim)
}
Attribute::~Attribute() = default;

//------------------------------------------------------------------------------
//
namespace {
Amino::Ptr<BifrostUsd::Attribute> createDefaultAttribute() {
// Destructor of USD instances are lauching threads. This result in
// a deadlock on windows when unloading the library (which destroys the
// default constructed object held in static variables).
/// \todo BIFROST-6874 remove PXR_NS::Work_EnsureDetachedTaskProgress();
PXR_NS::Work_EnsureDetachedTaskProgress();
auto stage = Amino::newClassPtr<BifrostUsd::Stage>();
auto pxr_prim = stage->get().GetPseudoRoot();
auto prim = Amino::newClassPtr<BifrostUsd::Prim>(pxr_prim, stage);
auto pxr_attr = pxr_prim.CreateAttribute(PXR_NS::TfToken(""),
PXR_NS::SdfValueTypeName());
return Amino::newClassPtr<BifrostUsd::Attribute>(pxr_attr, prim);
}
} // namespace
} // namespace BifrostUsd

AMINO_DEFINE_DEFAULT_CLASS(BifrostUsd::Attribute,
BifrostUsd::createDefaultAttribute());
AMINO_DEFINE_DEFAULT_CLASS(BifrostUsd::Attribute);
8 changes: 0 additions & 8 deletions src/BifrostUsd/Layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

#include <Amino/Cpp/ClassDefine.h>

/// \todo BIFROST-6874 remove PXR_NS::Work_EnsureDetachedTaskProgress();
#include <pxr/base/work/detachedTask.h>

// Note: To silence warnings coming from USD library
#include <bifusd/config/CfgWarningMacros.h>
BIFUSD_WARNING_PUSH
Expand Down Expand Up @@ -483,11 +480,6 @@ Amino::String Layer::getPathWithValidUsdFileFormat(const Amino::String& path) {
//
namespace {
Amino::Ptr<BifrostUsd::Layer> createDefaultLayer() {
// Destructor of USD instances are lauching threads. This result in
// a deadlock on windows when unloading the library (which destroys the
// default constructed object held in static variables).
/// \todo BIFROST-6874 remove PXR_NS::Work_EnsureDetachedTaskProgress();
PXR_NS::Work_EnsureDetachedTaskProgress();
return Amino::newClassPtr<BifrostUsd::Layer>(BifrostUsd::Layer::Invalid{});
}
} // namespace
Expand Down
Loading

0 comments on commit dbeb0bf

Please sign in to comment.