Skip to content

Commit

Permalink
BIFROST-9303 - version 1.2.1 changes matching Bifrost 2.8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchdog committed Nov 15, 2023
1 parent 0b892ea commit 1387119
Show file tree
Hide file tree
Showing 149 changed files with 56,405 additions and 13,218 deletions.
437 changes: 437 additions & 0 deletions .clang-tidy

Large diffs are not rendered by default.

94 changes: 86 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
## [1.2.1] - 2023-11-15

### Build

- BIFROST-9103 - Replace pxr by PXR_NS
- BIFROST-9093 - Uses cpp2json executable instead of the deprecated amino_cpp2json_foreach one.
- BIFROST-8182 - Remove -Wno-unused-macros on Windows targets
- BIFROST-8182 - Clang-tidy support: Add the cmake target "bifrost_usd_clang_tidy" to the build.

### Feature

- BIFROST-8077 - Add support for half and matrix attribute types

- BIFROST-8574 - Add anchor_path parameter on add_reference_prim and add_payload_prim

By specifying an "anchor_path", the identifier of the referenced layer will not include such anchor path in the reference list.

- BIFROST-8424 - Add slider and color picker on ops

- BIFROST-9008 - Add set_layer_permission node

To be used for the very specific scenario when you need to reference a layer
that needs to be modified by an other runtime than Bifrost.

For example, if a stage generated by Bifrost references a "file based" layer
storing some USD materials who should be authored in the LookdevX Editor,
it would not work by default. This is because in order to keep the referenced layer
"file based", the "read only" mode would need to be enabled in the open_layer node.
If not in read only mode, the opened layer ("file based" layer) would be automatically
copied into an anonymous layer by Bifrost USD (to avoid side effects) and so would not
be editable in LookdevX in a persistent way (as the layer identifier would change at
every execution of the graph).

The node graph to open a layer in Bifrost and let it be editable outside should look as following:
open_layer (with read_only "on") -> set_layer_permission (with read_only "off") -> add_reference_prim

The open_layer node will call the BifrostUsd::Layer constructor that is "opening or finding" the USD layer
using the file path as an identifier (and will not create an anonymous layer, because of the read only mode).
The set_layer_permission will allow the layer to be editable and will not output an anonymous layer.

- BIFROST-8788 - Use for_each in define_usd_mesh

- BIFROST-7769 - use getEnv*() functions from public Executor SDK

- BIFROST-8199 - Use ConfigEnv instead of Object to get config from environment

- BIFROST-3401 - Use new API for FileUtils::getRelativePath.

### Bugfix

- BIFROST-9067 - Fix connection order when creating an add_to_stage node 'on the fly'

- BIFROST-8826 - fix random test failures on Windows

- Layer::exportToFile() now uses SdfLayer::New() instead of CreateNew().
This prevents a temporary and default file to be created on the disk
before the final exported file is actually written. On Windows, when
Pixar USD is writing an initial file and almost immediately attempts
to replace its content by renaming another file to such initial file,
an "access denied" error can occasionally occur; eliminating the
temporary file on the first place by not calling CreateNew() avoids
this error.
- Each unit test file now outputs its exported files into its own unique
folder, avoiding completely the possibility that two concurrent tests
from different test files would attempt to export to the same file.
These unique output folders are deleted as a first phase for each test
file, allowing tests to assume and check that an output file is not
already on disk before it is being exported.
- Some tests were previously just lucky to succeed, as they were
exporting a root layer and sublayer to disk, but the sublayer was
actually exported into the default output folder, not into the expected
folder, and since the sublayer file was already saved to disk by
another test case, the test assumed that everything went fine. Such
test cases are now fixed or were removed (if not fixable).
- Tests do not export initial files first, then replacing these by final
file content, and finally checking the final file for some expected
content. This was also occasionally causing "access denied" errors, as
described above.
- add README.md in test folder


## [1.2.0] - 2023-05-12

### Build
Expand Down Expand Up @@ -28,9 +109,9 @@
- BIFROST-8426 - Inconsistent UI in define_usd_prim

- BIFROST-8273 - fix sublayers not saved if relative_path is on
- Use the layer's save file path (m_filePath) instead of the sdfLayerIdentifier in the recursive call to Layer::exportToFile().
- Add new more complete unit test for export_layer_to_file() that covers multiple cases for relative and absolute paths to sublayers.
- removed call to changeDir() that has side effect and is not required anymore for unit tests.
- Use the layer's save file path (m_filePath) instead of the sdfLayerIdentifier in the recursive call to Layer::exportToFile().
- Add new more complete unit test for export_layer_to_file() that covers multiple cases for relative and absolute paths to sublayers.
- removed call to changeDir() that has side effect and is not required anymore for unit tests.


## [1.1.0] - 2023-03-29
Expand All @@ -48,15 +129,12 @@
### Feature

- BIFROST-7955 - Add applied schema nodes
- add_applied_schema: This node adds the applied API schema name to the apiSchema metadata of the prim
- remove_applied_schema: This node removes the applied API schema name from the apiSchema metadata of the prim
- add_applied_schema: This node adds the applied API schema name to the apiSchema metadata of the prim
- remove_applied_schema: This node removes the applied API schema name from the apiSchema metadata of the prim


### Bugfix

## [1.0.0] - 2022-12-12

- Initial release
- 2022-12-12

- Initial release
35 changes: 31 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-
#*****************************************************************************
# Copyright 2022 Autodesk, Inc.
# Copyright 2023 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 @@ -30,6 +30,8 @@ if( NOT BIFUSD_PACKAGE_NAME )
set(BIFUSD_PACKAGE_NAME bifrost_usd_pack)
endif()

set(IS_BIFUSD_STANDALONE ON CACHE BOOL "Indicate if this is a standalone build of Bifrost USD")

include(cmake/version.info)

# Enable no language yet.
Expand Down Expand Up @@ -96,7 +98,7 @@ include(cmake/utils.cmake)

# Standalone build setup the compiler
# Else use the parent environment's compiler
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
if(IS_BIFUSD_STANDALONE)
#==============================================================================
# COMPILER
#==============================================================================
Expand Down Expand Up @@ -181,16 +183,41 @@ add_subdirectory(test)
#
# Maya
if( MAYA_RUNTIME_LOCATION)
find_package( Bifrost REQUIRED Maya)
find_package(Maya REQUIRED)
find_package(Bifrost REQUIRED Maya)
add_subdirectory(maya_plugin)
endif()

#==============================================================================
# Bifrost Hydra
# NOT PART OF PUBLIC BIFROST SDK YET
# NOT PART OF PUBLIC BIFROST SDK YET
# NOT PART OF PUBLIC BIFROST SDK YET
#==============================================================================
#
if( BIFUSD_BUILD_HYDRA )
add_subdirectory(bifrost_hydra)
endif()

#==============================================================================
# Configure "clang_tidy" target
#==============================================================================
#
if( CLAND_TIDY_LOCATION )
include(${BIFUSD_TOOLS_DIR}/clang-tidy.cmake)
bifrost_usd_clang_tidy()
endif()

#==============================================================================
# FINALIZE
#==============================================================================
# Publish the findUSD module helper
# Publish the CMake module files
install(
FILES ${BIFUSD_CMAKE_DIR}/modules/FindUSD.cmake
DESTINATION ${BIFUSD_INSTALL_CMAKE_DIR}/modules )

install(
FILES ${BIFUSD_CMAKE_DIR}/modules/FindMaya.cmake
DESTINATION ${BIFUSD_INSTALL_CMAKE_DIR}/modules )

include( ${BIFUSD_TOOLS_DIR}/finalize.cmake)
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ To build doxygen doc (require doxygen 1.8.14):
cmake --build <build directory path> --target usd_pack_apidoc
```

To run clang-tidy
```
cmake --build <build directory path> --target bifrost_usd_clang_tidy
```

## Testing

```
Expand Down
25 changes: 25 additions & 0 deletions bifrost_hydra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#-
#*****************************************************************************
# Copyright 2023 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#*****************************************************************************
#+

if(IS_BIFUSD_STANDALONE)
include(${BIFROST_LOCATION}/sdk_preview/cmake/setup.cmake)
endif()
find_package(BifrostPreview REQUIRED SDK)

add_subdirectory(src)
add_subdirectory(test)
48 changes: 48 additions & 0 deletions bifrost_hydra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

## Bifrost Hydra (Experimental)
Requires a version of the Bifrost SDK that is not released yet.
Register a new Hydra Generative Procedural plugin capable of running a Bifrost Graph that will output
Bifrost geometries to the Hydra Scene Index without using any scene delegate.
In your Hydra based application (usdview for example), the following variables are needed:
```
export BIFROST_LOCATION=<bifrost path>
export BIFROST_LIB_CONFIG_FILES=<install directory path>/bifrost_hydra_translation.json
export HD_ENABLE_SCENE_INDEX_EMULATION=1
export USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1
export HDGP_INCLUDE_DEFAULT_RESOLVER=1
```

Here is a USD file example showing how to setup the Generative Procedural for Bifrost.
```
#usda 1.0
(
def Xform "Mia"
{
def "Head" (
prepend references = @mia_young.usd@</head>
)
{
}
def GenerativeProcedural "BifrostGraph" (
prepend apiSchemas = ["HydraGenerativeProceduralAPI"]
)
{
# The Generative Procedural Plugin name
token primvars:hdGp:proceduralType = "BifrostGraph"
# The full name of the Bifrost compound or graph to execute in Hydra
token primvars:bifrost:graph = "Groom::create_clumpy_hairs"
# The inputs parameters must use the same names as the Bifrost
# compound input ports with an additional "primvars:" prefix
prepend rel primvars:mesh = </Mia/Head/scalp>
float primvars:hair_count = 9000000
float primvars:curl_frequency = 6.5
# The output of the Bifrost compound you want to render in Hydra
string primvars:bifrost:output = "hairs"
}
}
```
There are several USD files in `test/BifrostHydra/resources` following such setup.
78 changes: 78 additions & 0 deletions bifrost_hydra/src/BifrostHdEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#-
#*****************************************************************************
# Copyright 2023 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#*****************************************************************************
#+

set(hd_Engine_headers
Container.h
Engine.h
JobTranslationData.h
Parameters.h
Requirement.h
Runtime.h
ValueTranslationData.h
)

bifusd_install_headers(
hdEngineHeadersInstall
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}
FILES ${hd_Engine_headers}
DESTINATION "BifrostHydra/Engine"
)

set(public_libs
Amino::SDK::Preview
BifrostGraph::Executor::Preview
hdEngineHeadersInstall
)

set(private_libs
Amino::Core
Bifrost::Object
hd
BifrostHdTranslators
)

set(src_files
Container.cpp
Engine.cpp
JobTranslationData.cpp
Parameters.cpp
Requirement.cpp
Runtime.cpp
ValueTranslationData.cpp
)

bifusd_set_extra_rpaths(extra_rpaths)

bifusd_create_shared_lib(
BifrostHdEngine "BIFROST_HD_ENGINE_BUILD_DLL" # TODO: add export file
PUBLIC_INSTALL
PUBLIC_DEFINITIONS $<${BIFUSD_IS_MSC}: BOOST_LIB_TOOLSET="vc141">
PRIVATE_DEFINITIONS $<${BIFUSD_IS_DEBUG}: TBB_USE_DEBUG BOOST_DEBUG_PYTHON BOOST_LINKING_PYTHON>

PRIVATE_OPTIONS $<${BIFUSD_IS_MSC}:/wd4251 /wd4273>
$<${BIFUSD_IS_GCC}: -Wno-deprecated -Wno-unused-macros>
$<${BIFUSD_IS_CLANG}: -Wno-deprecated -Wno-unused-macros>

SRC_FILES ${src_files}
PUBLIC_LINK_LIBS ${public_libs}
PRIVATE_LINK_LIBS ${private_libs}
EXTRA_RPATH ${extra_rpaths}
)

add_subdirectory(translation)
add_subdirectory(config)
Loading

0 comments on commit 1387119

Please sign in to comment.