Skip to content

Commit 1387119

Browse files
committed
BIFROST-9303 - version 1.2.1 changes matching Bifrost 2.8.0.0
1 parent 0b892ea commit 1387119

File tree

149 files changed

+56405
-13218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+56405
-13218
lines changed

.clang-tidy

+437
Large diffs are not rendered by default.

CHANGELOG.md

+86-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,84 @@
1+
## [1.2.1] - 2023-11-15
2+
3+
### Build
4+
5+
- BIFROST-9103 - Replace pxr by PXR_NS
6+
- BIFROST-9093 - Uses cpp2json executable instead of the deprecated amino_cpp2json_foreach one.
7+
- BIFROST-8182 - Remove -Wno-unused-macros on Windows targets
8+
- BIFROST-8182 - Clang-tidy support: Add the cmake target "bifrost_usd_clang_tidy" to the build.
9+
10+
### Feature
11+
12+
- BIFROST-8077 - Add support for half and matrix attribute types
13+
14+
- BIFROST-8574 - Add anchor_path parameter on add_reference_prim and add_payload_prim
15+
16+
By specifying an "anchor_path", the identifier of the referenced layer will not include such anchor path in the reference list.
17+
18+
- BIFROST-8424 - Add slider and color picker on ops
19+
20+
- BIFROST-9008 - Add set_layer_permission node
21+
22+
To be used for the very specific scenario when you need to reference a layer
23+
that needs to be modified by an other runtime than Bifrost.
24+
25+
For example, if a stage generated by Bifrost references a "file based" layer
26+
storing some USD materials who should be authored in the LookdevX Editor,
27+
it would not work by default. This is because in order to keep the referenced layer
28+
"file based", the "read only" mode would need to be enabled in the open_layer node.
29+
If not in read only mode, the opened layer ("file based" layer) would be automatically
30+
copied into an anonymous layer by Bifrost USD (to avoid side effects) and so would not
31+
be editable in LookdevX in a persistent way (as the layer identifier would change at
32+
every execution of the graph).
33+
34+
The node graph to open a layer in Bifrost and let it be editable outside should look as following:
35+
open_layer (with read_only "on") -> set_layer_permission (with read_only "off") -> add_reference_prim
36+
37+
The open_layer node will call the BifrostUsd::Layer constructor that is "opening or finding" the USD layer
38+
using the file path as an identifier (and will not create an anonymous layer, because of the read only mode).
39+
The set_layer_permission will allow the layer to be editable and will not output an anonymous layer.
40+
41+
- BIFROST-8788 - Use for_each in define_usd_mesh
42+
43+
- BIFROST-7769 - use getEnv*() functions from public Executor SDK
44+
45+
- BIFROST-8199 - Use ConfigEnv instead of Object to get config from environment
46+
47+
- BIFROST-3401 - Use new API for FileUtils::getRelativePath.
48+
49+
### Bugfix
50+
51+
- BIFROST-9067 - Fix connection order when creating an add_to_stage node 'on the fly'
52+
53+
- BIFROST-8826 - fix random test failures on Windows
54+
55+
- Layer::exportToFile() now uses SdfLayer::New() instead of CreateNew().
56+
This prevents a temporary and default file to be created on the disk
57+
before the final exported file is actually written. On Windows, when
58+
Pixar USD is writing an initial file and almost immediately attempts
59+
to replace its content by renaming another file to such initial file,
60+
an "access denied" error can occasionally occur; eliminating the
61+
temporary file on the first place by not calling CreateNew() avoids
62+
this error.
63+
- Each unit test file now outputs its exported files into its own unique
64+
folder, avoiding completely the possibility that two concurrent tests
65+
from different test files would attempt to export to the same file.
66+
These unique output folders are deleted as a first phase for each test
67+
file, allowing tests to assume and check that an output file is not
68+
already on disk before it is being exported.
69+
- Some tests were previously just lucky to succeed, as they were
70+
exporting a root layer and sublayer to disk, but the sublayer was
71+
actually exported into the default output folder, not into the expected
72+
folder, and since the sublayer file was already saved to disk by
73+
another test case, the test assumed that everything went fine. Such
74+
test cases are now fixed or were removed (if not fixable).
75+
- Tests do not export initial files first, then replacing these by final
76+
file content, and finally checking the final file for some expected
77+
content. This was also occasionally causing "access denied" errors, as
78+
described above.
79+
- add README.md in test folder
80+
81+
182
## [1.2.0] - 2023-05-12
283

384
### Build
@@ -28,9 +109,9 @@
28109
- BIFROST-8426 - Inconsistent UI in define_usd_prim
29110

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

35116

36117
## [1.1.0] - 2023-03-29
@@ -48,15 +129,12 @@
48129
### Feature
49130

50131
- BIFROST-7955 - Add applied schema nodes
51-
- add_applied_schema: This node adds the applied API schema name to the apiSchema metadata of the prim
52-
- remove_applied_schema: This node removes the applied API schema name from the apiSchema metadata of the prim
132+
- add_applied_schema: This node adds the applied API schema name to the apiSchema metadata of the prim
133+
- remove_applied_schema: This node removes the applied API schema name from the apiSchema metadata of the prim
53134

54135

55136
### Bugfix
56137

57138
## [1.0.0] - 2022-12-12
58139

59-
- Initial release
60-
- 2022-12-12
61-
62140
- Initial release

CMakeLists.txt

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#-
22
#*****************************************************************************
3-
# Copyright 2022 Autodesk, Inc.
3+
# Copyright 2023 Autodesk, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -30,6 +30,8 @@ if( NOT BIFUSD_PACKAGE_NAME )
3030
set(BIFUSD_PACKAGE_NAME bifrost_usd_pack)
3131
endif()
3232

33+
set(IS_BIFUSD_STANDALONE ON CACHE BOOL "Indicate if this is a standalone build of Bifrost USD")
34+
3335
include(cmake/version.info)
3436

3537
# Enable no language yet.
@@ -96,7 +98,7 @@ include(cmake/utils.cmake)
9698

9799
# Standalone build setup the compiler
98100
# Else use the parent environment's compiler
99-
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
101+
if(IS_BIFUSD_STANDALONE)
100102
#==============================================================================
101103
# COMPILER
102104
#==============================================================================
@@ -181,16 +183,41 @@ add_subdirectory(test)
181183
#
182184
# Maya
183185
if( MAYA_RUNTIME_LOCATION)
184-
find_package( Bifrost REQUIRED Maya)
186+
find_package(Maya REQUIRED)
187+
find_package(Bifrost REQUIRED Maya)
185188
add_subdirectory(maya_plugin)
186189
endif()
187190

191+
#==============================================================================
192+
# Bifrost Hydra
193+
# NOT PART OF PUBLIC BIFROST SDK YET
194+
# NOT PART OF PUBLIC BIFROST SDK YET
195+
# NOT PART OF PUBLIC BIFROST SDK YET
196+
#==============================================================================
197+
#
198+
if( BIFUSD_BUILD_HYDRA )
199+
add_subdirectory(bifrost_hydra)
200+
endif()
201+
202+
#==============================================================================
203+
# Configure "clang_tidy" target
204+
#==============================================================================
205+
#
206+
if( CLAND_TIDY_LOCATION )
207+
include(${BIFUSD_TOOLS_DIR}/clang-tidy.cmake)
208+
bifrost_usd_clang_tidy()
209+
endif()
210+
188211
#==============================================================================
189212
# FINALIZE
190213
#==============================================================================
191-
# Publish the findUSD module helper
214+
# Publish the CMake module files
192215
install(
193216
FILES ${BIFUSD_CMAKE_DIR}/modules/FindUSD.cmake
194217
DESTINATION ${BIFUSD_INSTALL_CMAKE_DIR}/modules )
195218

219+
install(
220+
FILES ${BIFUSD_CMAKE_DIR}/modules/FindMaya.cmake
221+
DESTINATION ${BIFUSD_INSTALL_CMAKE_DIR}/modules )
222+
196223
include( ${BIFUSD_TOOLS_DIR}/finalize.cmake)

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ To build doxygen doc (require doxygen 1.8.14):
5555
cmake --build <build directory path> --target usd_pack_apidoc
5656
```
5757

58+
To run clang-tidy
59+
```
60+
cmake --build <build directory path> --target bifrost_usd_clang_tidy
61+
```
62+
5863
## Testing
5964

6065
```

bifrost_hydra/CMakeLists.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#-
2+
#*****************************************************************************
3+
# Copyright 2023 Autodesk, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#*****************************************************************************
17+
#+
18+
19+
if(IS_BIFUSD_STANDALONE)
20+
include(${BIFROST_LOCATION}/sdk_preview/cmake/setup.cmake)
21+
endif()
22+
find_package(BifrostPreview REQUIRED SDK)
23+
24+
add_subdirectory(src)
25+
add_subdirectory(test)

bifrost_hydra/README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
## Bifrost Hydra (Experimental)
3+
Requires a version of the Bifrost SDK that is not released yet.
4+
Register a new Hydra Generative Procedural plugin capable of running a Bifrost Graph that will output
5+
Bifrost geometries to the Hydra Scene Index without using any scene delegate.
6+
In your Hydra based application (usdview for example), the following variables are needed:
7+
```
8+
export BIFROST_LOCATION=<bifrost path>
9+
export BIFROST_LIB_CONFIG_FILES=<install directory path>/bifrost_hydra_translation.json
10+
export HD_ENABLE_SCENE_INDEX_EMULATION=1
11+
export USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1
12+
export HDGP_INCLUDE_DEFAULT_RESOLVER=1
13+
```
14+
15+
Here is a USD file example showing how to setup the Generative Procedural for Bifrost.
16+
```
17+
#usda 1.0
18+
(
19+
def Xform "Mia"
20+
{
21+
def "Head" (
22+
prepend references = @mia_young.usd@</head>
23+
)
24+
{
25+
}
26+
27+
def GenerativeProcedural "BifrostGraph" (
28+
prepend apiSchemas = ["HydraGenerativeProceduralAPI"]
29+
)
30+
{
31+
# The Generative Procedural Plugin name
32+
token primvars:hdGp:proceduralType = "BifrostGraph"
33+
34+
# The full name of the Bifrost compound or graph to execute in Hydra
35+
token primvars:bifrost:graph = "Groom::create_clumpy_hairs"
36+
37+
# The inputs parameters must use the same names as the Bifrost
38+
# compound input ports with an additional "primvars:" prefix
39+
prepend rel primvars:mesh = </Mia/Head/scalp>
40+
float primvars:hair_count = 9000000
41+
float primvars:curl_frequency = 6.5
42+
43+
# The output of the Bifrost compound you want to render in Hydra
44+
string primvars:bifrost:output = "hairs"
45+
}
46+
}
47+
```
48+
There are several USD files in `test/BifrostHydra/resources` following such setup.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#-
2+
#*****************************************************************************
3+
# Copyright 2023 Autodesk, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#*****************************************************************************
17+
#+
18+
19+
set(hd_Engine_headers
20+
Container.h
21+
Engine.h
22+
JobTranslationData.h
23+
Parameters.h
24+
Requirement.h
25+
Runtime.h
26+
ValueTranslationData.h
27+
)
28+
29+
bifusd_install_headers(
30+
hdEngineHeadersInstall
31+
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}
32+
FILES ${hd_Engine_headers}
33+
DESTINATION "BifrostHydra/Engine"
34+
)
35+
36+
set(public_libs
37+
Amino::SDK::Preview
38+
BifrostGraph::Executor::Preview
39+
hdEngineHeadersInstall
40+
)
41+
42+
set(private_libs
43+
Amino::Core
44+
Bifrost::Object
45+
hd
46+
BifrostHdTranslators
47+
)
48+
49+
set(src_files
50+
Container.cpp
51+
Engine.cpp
52+
JobTranslationData.cpp
53+
Parameters.cpp
54+
Requirement.cpp
55+
Runtime.cpp
56+
ValueTranslationData.cpp
57+
)
58+
59+
bifusd_set_extra_rpaths(extra_rpaths)
60+
61+
bifusd_create_shared_lib(
62+
BifrostHdEngine "BIFROST_HD_ENGINE_BUILD_DLL" # TODO: add export file
63+
PUBLIC_INSTALL
64+
PUBLIC_DEFINITIONS $<${BIFUSD_IS_MSC}: BOOST_LIB_TOOLSET="vc141">
65+
PRIVATE_DEFINITIONS $<${BIFUSD_IS_DEBUG}: TBB_USE_DEBUG BOOST_DEBUG_PYTHON BOOST_LINKING_PYTHON>
66+
67+
PRIVATE_OPTIONS $<${BIFUSD_IS_MSC}:/wd4251 /wd4273>
68+
$<${BIFUSD_IS_GCC}: -Wno-deprecated -Wno-unused-macros>
69+
$<${BIFUSD_IS_CLANG}: -Wno-deprecated -Wno-unused-macros>
70+
71+
SRC_FILES ${src_files}
72+
PUBLIC_LINK_LIBS ${public_libs}
73+
PRIVATE_LINK_LIBS ${private_libs}
74+
EXTRA_RPATH ${extra_rpaths}
75+
)
76+
77+
add_subdirectory(translation)
78+
add_subdirectory(config)

0 commit comments

Comments
 (0)