Skip to content

Commit 3b097e3

Browse files
committed
Merge release v22.05
2 parents 857ffda + 1c55a0c commit 3b097e3

File tree

874 files changed

+47793
-7673
lines changed

Some content is hidden

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

874 files changed

+47793
-7673
lines changed

CHANGELOG.md

Lines changed: 356 additions & 15 deletions
Large diffs are not rendered by default.

VERSIONS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Our test machines have the following software versions installed
1515
| Software | Linux | macOS | Windows |
1616
| ------------- | -------------------- | ---------------------------- | ------------------------------ |
1717
| OS | CentOS Linux 7 | 10.15.7 | Windows 10 |
18-
| C++ Compiler | gcc 6.3.1 | Apple clang 11.0.3 (Xcode 11.7) | MSVC 14.0 (Visual Studio 2015) |
19-
| CMake | 3.14.6 | 3.16.5 | 3.16.5 |
18+
| C++ Compiler | gcc 6.3.1 | Apple clang 12.0.0 (Xcode 12.4) | MSVC 14.0 (Visual Studio 2015) |
19+
| CMake | 3.14.6 | 3.18.6 | 3.16.5 |
2020
| Python | 2.7.16, 3.6.8 | 2.7.10, 3.7.7 | 2.7.12, 3.7.4, 3.8.10 |
2121
| Boost | 1.66.0, 1.70.0 | 1.70.0 | 1.70.0 |
2222
| Intel TBB | 2018 Update 6 | 2018 Update 1 | 2018 Update 6 |
23-
| OpenSubdiv | 3.4.3 | 3.4.3 | 3.4.3 |
23+
| OpenSubdiv | 3.4.4 | 3.4.4 | 3.4.4 |
2424
| OpenImageIO | 2.1.16.0 | 2.1.16.0 | 2.1.16.0 |
2525
| OpenColorIO | 1.1.0 | 1.1.0 | 1.1.0 |
2626
| OSL | 1.8.12 | | |

build_scripts/build_usd.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,12 @@ def InstallOpenVDB(context, force, buildArgs):
11091109

11101110
def InstallOpenImageIO(context, force, buildArgs):
11111111
with CurrentWorkingDirectory(DownloadURL(OIIO_URL, context, force)):
1112-
extraArgs = ['-DOIIO_BUILD_TOOLS=OFF',
1112+
# The only time that we want to build tools with OIIO is for testing
1113+
# purposes. Libraries such as usdImagingGL might need to use tools like
1114+
# idiff to compare the output images from their tests
1115+
buildOIIOTools = 'ON' if (context.buildUsdImaging
1116+
and context.buildTests) else 'OFF'
1117+
extraArgs = ['-DOIIO_BUILD_TOOLS={}'.format(buildOIIOTools),
11131118
'-DOIIO_BUILD_TESTS=OFF',
11141119
'-DUSE_PYTHON=OFF',
11151120
'-DSTOP_ON_WARNING=OFF']
@@ -1196,7 +1201,7 @@ def InstallOpenColorIO(context, force, buildArgs):
11961201
############################################################
11971202
# OpenSubdiv
11981203

1199-
OPENSUBDIV_URL = "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_4_3.zip"
1204+
OPENSUBDIV_URL = "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_4_4.zip"
12001205

12011206
def InstallOpenSubdiv(context, force, buildArgs):
12021207
with CurrentWorkingDirectory(DownloadURL(OPENSUBDIV_URL, context, force)):
@@ -1969,7 +1974,8 @@ def __init__(self, args):
19691974
self.buildPrman = self.buildImaging and args.build_prman
19701975
self.prmanLocation = (os.path.abspath(args.prman_location)
19711976
if args.prman_location else None)
1972-
self.buildOIIO = args.build_oiio
1977+
self.buildOIIO = args.build_oiio or (self.buildUsdImaging
1978+
and self.buildTests)
19731979
self.buildOCIO = args.build_ocio
19741980

19751981
# - Alembic Plugin

cmake/defaults/Options.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ if (${PXR_BUILD_USD_IMAGING} AND NOT ${PXR_BUILD_IMAGING})
134134
set(PXR_BUILD_USD_IMAGING "OFF" CACHE BOOL "" FORCE)
135135
endif()
136136

137+
if (${PXR_ENABLE_METAL_SUPPORT})
138+
if (NOT APPLE)
139+
message(STATUS
140+
"Setting PXR_ENABLE_METAL_SUPPORT=OFF because Metal is only supported on macOS")
141+
set(PXR_ENABLE_METAL_SUPPORT "OFF" CACHE BOOL "" FORCE)
142+
endif()
143+
endif()
144+
137145
if (${PXR_ENABLE_GL_SUPPORT} OR ${PXR_ENABLE_METAL_SUPPORT} OR ${PXR_ENABLE_VULKAN_SUPPORT})
138146
set(PXR_BUILD_GPU_SUPPORT "ON")
139147
else()

cmake/defaults/Packages.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ if (PXR_BUILD_IMAGING)
190190
find_package(OpenEXR REQUIRED)
191191
find_package(OpenImageIO REQUIRED)
192192
add_definitions(-DPXR_OIIO_PLUGIN_ENABLED)
193+
if (OIIO_idiff_BINARY)
194+
set(IMAGE_DIFF_TOOL ${OIIO_idiff_BINARY} CACHE STRING "Uses idiff for image diffing")
195+
endif()
193196
endif()
194197
# --OpenColorIO
195198
if (PXR_BUILD_OPENCOLORIO_PLUGIN)

cmake/defaults/Version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
# Versioning information
2525
set(PXR_MAJOR_VERSION "0")
2626
set(PXR_MINOR_VERSION "22")
27-
set(PXR_PATCH_VERSION "3")
27+
set(PXR_PATCH_VERSION "5")
2828

2929
math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}")

cmake/macros/Public.cmake

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,22 @@ function(pxr_register_test TEST_NAME)
636636
return()
637637
endif()
638638

639+
set(OPTIONS RUN_SERIAL PYTHON REQUIRES_SHARED_LIBS REQUIRES_PYTHON_MODULES PERCEPTUAL)
640+
set(ONE_VALUE_ARGS
641+
CUSTOM_PYTHON
642+
COMMAND
643+
STDOUT_REDIRECT STDERR_REDIRECT
644+
POST_COMMAND POST_COMMAND_STDOUT_REDIRECT POST_COMMAND_STDERR_REDIRECT
645+
PRE_COMMAND PRE_COMMAND_STDOUT_REDIRECT PRE_COMMAND_STDERR_REDIRECT
646+
FILES_EXIST FILES_DONT_EXIST
647+
CLEAN_OUTPUT
648+
EXPECTED_RETURN_CODE
649+
TESTENV
650+
WARN WARN_PERCENT HARD_WARN FAIL FAIL_PERCENT HARD_FAIL)
651+
set(MULTI_VALUE_ARGS DIFF_COMPARE IMAGE_DIFF_COMPARE ENV PRE_PATH POST_PATH)
652+
639653
cmake_parse_arguments(bt
640-
"RUN_SERIAL;PYTHON;REQUIRES_SHARED_LIBS;REQUIRES_PYTHON_MODULES"
641-
"CUSTOM_PYTHON;COMMAND;STDOUT_REDIRECT;STDERR_REDIRECT;POST_COMMAND;POST_COMMAND_STDOUT_REDIRECT;POST_COMMAND_STDERR_REDIRECT;PRE_COMMAND;PRE_COMMAND_STDOUT_REDIRECT;PRE_COMMAND_STDERR_REDIRECT;FILES_EXIST;FILES_DONT_EXIST;CLEAN_OUTPUT;EXPECTED_RETURN_CODE;TESTENV"
642-
"DIFF_COMPARE;ENV;PRE_PATH;POST_PATH"
654+
"${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}"
643655
${ARGN}
644656
)
645657

@@ -719,6 +731,53 @@ function(pxr_register_test TEST_NAME)
719731
set(testWrapperCmd ${testWrapperCmd} --baseline-dir=${baselineDir})
720732
endif()
721733

734+
if (bt_IMAGE_DIFF_COMPARE)
735+
if (IMAGE_DIFF_TOOL)
736+
foreach (compareFile ${bt_IMAGE_DIFF_COMPARE})
737+
set(testWrapperCmd ${testWrapperCmd} --image-diff-compare=${compareFile})
738+
endforeach ()
739+
740+
# For now the baseline directory is assumed by convention from the test
741+
# name. There may eventually be cases where we'd want to specify it by
742+
# an argument though.
743+
set(baselineDir ${testenvDir}/baseline)
744+
set(testWrapperCmd ${testWrapperCmd} --baseline-dir=${baselineDir})
745+
746+
if (bt_WARN)
747+
set(testWrapperCmd ${testWrapperCmd} --warn=${bt_WARN})
748+
endif()
749+
750+
if (bt_WARN_PERCENT)
751+
set(testWrapperCmd ${testWrapperCmd} --warnpercent=${bt_WARN_PERCENT})
752+
endif()
753+
754+
if (bt_HARD_WARN)
755+
set(testWrapperCmd ${testWrapperCmd} --hardwarn=${bt_HARD_WARN})
756+
endif()
757+
758+
if (bt_FAIL)
759+
set(testWrapperCmd ${testWrapperCmd} --fail=${bt_FAIL})
760+
endif()
761+
762+
if (bt_FAIL_PERCENT)
763+
set(testWrapperCmd ${testWrapperCmd} --failpercent=${bt_FAIL_PERCENT})
764+
endif()
765+
766+
if (bt_HARD_FAIL)
767+
set(testWrapperCmd ${testWrapperCmd} --hardfail=${bt_HARD_FAIL})
768+
endif()
769+
770+
if(bt_PERCEPTUAL)
771+
set(testWrapperCmd ${testWrapperCmd} --perceptual)
772+
endif()
773+
774+
# Make sure to add the image diff tool to the PATH so
775+
# it can be easily found within the testWrapper
776+
get_filename_component(IMAGE_DIFF_TOOL_PATH ${IMAGE_DIFF_TOOL} DIRECTORY)
777+
set(testWrapperCmd ${testWrapperCmd} --post-path=${IMAGE_DIFF_TOOL_PATH})
778+
endif()
779+
endif()
780+
722781
if (bt_CLEAN_OUTPUT)
723782
set(testWrapperCmd ${testWrapperCmd} --clean-output-paths=${bt_CLEAN_OUTPUT})
724783
endif()

cmake/macros/testWrapper.py

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,28 @@ def _parseArgs():
5858
action='append',
5959
help=('Compare output file with a file in the baseline-dir of the '
6060
'same name'))
61+
parser.add_argument('--image-diff-compare', default=[], type=str,
62+
action='append',
63+
help=('Compare output image with an image in the baseline '
64+
'of the same name'))
65+
parser.add_argument('--fail', type=str,
66+
help='The threshold for the acceptable difference of a pixel for failure')
67+
parser.add_argument('--failpercent', type=str,
68+
help='The percentage of pixels that can be different before failure')
69+
parser.add_argument('--hardfail', type=str,
70+
help='Triggers a failure if any pixels are above this threshold')
71+
parser.add_argument('--warn', type=str,
72+
help='The threshold for the acceptable difference of a pixel for a warning')
73+
parser.add_argument('--warnpercent', type=str,
74+
help='The percentage of pixels that can be different before a warning')
75+
parser.add_argument('--hardwarn', type=str,
76+
help='Triggers a warning if any pixels are above this threshold')
77+
parser.add_argument('--perceptual', action='store_true',
78+
help='Performs a test to see if two images are visually different')
6179
parser.add_argument('--files-exist', nargs='*',
6280
help=('Check that a set of files exist.'))
6381
parser.add_argument('--files-dont-exist', nargs='*',
64-
help=('Check that a set of files exist.'))
82+
help=('Check that a set of files do not exist.'))
6583
parser.add_argument('--clean-output-paths', nargs='*',
6684
help=('Path patterns to remove from the output files being diff\'d.'))
6785
parser.add_argument('--post-command', type=str,
@@ -166,6 +184,56 @@ def _diff(fileName, baselineDir, verbose):
166184

167185
return True
168186

187+
def _imageDiff(fileName, baseLineDir, verbose, env, warn=None, warnpercent=None,
188+
hardwarn=None, fail=None, failpercent=None, hardfail=None,
189+
perceptual=None):
190+
import platform
191+
if platform.system() == 'Windows':
192+
imageDiff = 'idiff.exe'
193+
else:
194+
imageDiff = 'idiff'
195+
196+
cmdArgs = []
197+
if warn is not None:
198+
cmdArgs.extend(['-warn', warn])
199+
200+
if warnpercent is not None:
201+
cmdArgs.extend(['-warnpercent', warnpercent])
202+
203+
if hardwarn is not None:
204+
cmdArgs.extend(['-hardwarn', hardwarn])
205+
206+
if fail is not None:
207+
cmdArgs.extend(['-fail', fail])
208+
209+
if failpercent is not None:
210+
cmdArgs.extend(['-failpercent', failpercent])
211+
212+
if hardfail is not None:
213+
cmdArgs.extend(['-hardfail', hardfail])
214+
215+
if perceptual:
216+
cmdArgs.extend(['-p'])
217+
218+
for image in glob.glob(fileName):
219+
cmd = [imageDiff]
220+
cmd.extend(cmdArgs)
221+
cmd.extend([_resolvePath(baseLineDir, image), image])
222+
223+
if verbose:
224+
print("image diffing with {0}".format(cmd))
225+
226+
# This will print any diffs to stdout which is a nice side-effect
227+
# 0: OK: the images match within the warning and error thresholds.
228+
# 1: Warning: the errors differ a little, but within error thresholds.
229+
# 2: Failure: the errors differ a lot, outside error thresholds.
230+
# 3: The images were not the same size and could not be compared.
231+
# 4: File error: could not find or open input files, etc.
232+
if subprocess.call(cmd, shell=False, env=env) not in (0, 1):
233+
return False
234+
235+
return True
236+
169237
def _copyTree(src, dest):
170238
''' Copies the contents of src into dest.'''
171239
if not os.path.exists(dest):
@@ -215,7 +283,7 @@ def _runCommand(raw_command, stdout_redir, stderr_redir, env,
215283
"Error: return code {0} doesn't match "
216284
"expected {1} (EXPECTED_RETURN_CODE).".format(retcode,
217285
expected_return_code))
218-
sys.exit(1)
286+
sys.exit(1)
219287

220288
if __name__ == '__main__':
221289
args = _parseArgs()
@@ -225,6 +293,11 @@ def _runCommand(raw_command, stdout_redir, stderr_redir, env,
225293
"--diff-compare.")
226294
sys.exit(1)
227295

296+
if args.image_diff_compare and not args.baseline_dir:
297+
sys.stderr.write("Error: --baseline-dir must be specified with "
298+
"--image-diff-compare.")
299+
sys.exit(1)
300+
228301
if args.clean_output_paths and not args.diff_compare:
229302
sys.stderr.write("Error: --diff-compare must be specified with "
230303
"--clean-output-paths.")
@@ -313,4 +386,17 @@ def _runCommand(raw_command, stdout_redir, stderr_redir, env,
313386
'(DIFF_COMPARE).'.format(diff))
314387
sys.exit(1)
315388

389+
if args.image_diff_compare:
390+
converted = vars(args)
391+
params = {key: converted[key] for key in
392+
('warn', 'warnpercent', 'hardwarn',
393+
'fail', 'failpercent', 'hardfail', 'perceptual')
394+
if key in converted}
395+
396+
for image in args.image_diff_compare:
397+
if not _imageDiff(image, args.baseline_dir, args.verbose, env, **params):
398+
sys.stderr.write('Error: image diff for {0} failed '
399+
'(IMAGE_DIFF_COMPARE).\n'.format(image))
400+
sys.exit(1)
401+
316402
sys.exit(0)

docs/tut_setup_version_badge.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
:fa:`cogs` :ref:`Configure your Environment <tut_usd_tutorials:Environment Setup>`
44

5-
:fa:`check` Tested with `USD 22.03 <https://github.com/PixarAnimationStudios/USD/tree/v22.03>`_
5+
:fa:`check` Tested with `USD 22.05 <https://github.com/PixarAnimationStudios/USD/tree/v22.05>`_

docs/tut_simple_shading.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ what identifies the source of the Material's surface shading.
131131
pbrShader.CreateInput("roughness", Sdf.ValueTypeNames.Float).Set(0.4)
132132
pbrShader.CreateInput("metallic", Sdf.ValueTypeNames.Float).Set(0.0)
133133
134-
material.CreateSurfaceOutput().ConnectToSource(pbrShader, "surface")
134+
material.CreateSurfaceOutput().ConnectToSource(pbrShader.ConnectableAPI(), "surface")
135135
136136
Add Texturing
137137
=============
@@ -152,9 +152,9 @@ how to map surface coordinates to texture coordinates.
152152
diffuseTextureSampler = UsdShade.Shader.Define(stage,'/TexModel/boardMat/diffuseTexture')
153153
diffuseTextureSampler.CreateIdAttr('UsdUVTexture')
154154
diffuseTextureSampler.CreateInput('file', Sdf.ValueTypeNames.Asset).Set("USDLogoLrg.png")
155-
diffuseTextureSampler.CreateInput("st", Sdf.ValueTypeNames.Float2).ConnectToSource(stReader, 'result')
155+
diffuseTextureSampler.CreateInput("st", Sdf.ValueTypeNames.Float2).ConnectToSource(stReader.ConnectableAPI(), 'result')
156156
diffuseTextureSampler.CreateOutput('rgb', Sdf.ValueTypeNames.Float3)
157-
pbrShader.CreateInput("diffuseColor", Sdf.ValueTypeNames.Color3f).ConnectToSource(diffuseTextureSampler, 'rgb')
157+
pbrShader.CreateInput("diffuseColor", Sdf.ValueTypeNames.Color3f).ConnectToSource(diffuseTextureSampler.ConnectableAPI(), 'rgb')
158158
159159
Note that we have not yet specified what texture coordinate (primvar) the
160160
PrimvarReader should read. We could author the name of the primvar directly on

pxr/base/arch/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pxr_library(arch
1515
${PLATFORM_LIBS}
1616

1717
PUBLIC_CLASSES
18+
align
1819
attributes
1920
daemon
2021
debugger
@@ -37,7 +38,6 @@ pxr_library(arch
3738
vsnprintf
3839

3940
PUBLIC_HEADERS
40-
align.h
4141
api.h
4242
buildMode.h
4343
defines.h

0 commit comments

Comments
 (0)