Skip to content

Commit d445260

Browse files
committed
Merge branch 'RB-10.6'
2 parents 3aa8d51 + b35dd41 commit d445260

File tree

7 files changed

+135
-40
lines changed

7 files changed

+135
-40
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ jobs:
3333
linux-gcc11,
3434
linux-debug-gcc11,
3535
windows,
36-
windows-debug,
37-
macos-arm64
36+
windows-debug
3837
]
3938

4039
include:
@@ -44,7 +43,7 @@ jobs:
4443
buildType: RELEASE
4544
containerImage: ghcr.io/gafferhq/build/build:3.0.0
4645
options: .github/workflows/main/options.posix
47-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/9.1.0/gafferDependencies-9.1.0-linux-gcc11.tar.gz
46+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/10.0.0/gafferDependencies-10.0.0-linux-gcc11.tar.gz
4847
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
4948
publish: true
5049
jobs: 4
@@ -54,7 +53,7 @@ jobs:
5453
buildType: DEBUG
5554
containerImage: ghcr.io/gafferhq/build/build:3.0.0
5655
options: .github/workflows/main/options.posix
57-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/9.1.0/gafferDependencies-9.1.0-linux-gcc11.tar.gz
56+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/10.0.0/gafferDependencies-10.0.0-linux-gcc11.tar.gz
5857
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
5958
publish: false
6059
jobs: 4
@@ -63,7 +62,7 @@ jobs:
6362
os: windows-2022
6463
buildType: RELEASE
6564
options: .github/workflows/main/options.windows
66-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/9.1.0/gafferDependencies-9.1.0-windows.zip
65+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/10.0.0/gafferDependencies-10.0.0-windows.zip
6766
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
6867
publish: true
6968
jobs: 4
@@ -72,31 +71,29 @@ jobs:
7271
os: windows-2022
7372
buildType: RELWITHDEBINFO
7473
options: .github/workflows/main/options.windows
75-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/9.1.0/gafferDependencies-9.1.0-windows.zip
74+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/10.0.0/gafferDependencies-10.0.0-windows.zip
7675
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
7776
publish: false
7877
jobs: 4
7978

80-
- name: macos-arm64
81-
os: macos-14
82-
buildType: RELEASE
83-
options: .github/workflows/main/options.posix
84-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/9.1.0/gafferDependencies-9.1.0-macos-arm64.tar.gz
85-
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
86-
publish: true
87-
jobs: 3
88-
8979
runs-on: ${{ matrix.os }}
9080

9181
container: ${{ matrix.containerImage }}
9282

9383
steps:
9484

95-
- uses: actions/checkout@v4
85+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
86+
87+
- name: Install Windows SDK
88+
run: |
89+
curl.exe -L --output winsdksetup.exe --url https://download.microsoft.com/download/9/7/9/97982c1d-d687-41be-9dd3-6d01e52ceb68/windowssdk/winsdksetup.exe
90+
Start-Process ./winsdksetup.exe -ArgumentList "/Features OptionId.DesktopCPPx64 /Quiet /NoRestart" -NoNewWindow -Wait
91+
shell: pwsh
92+
if: runner.os == 'Windows'
9693

97-
- uses: ilammy/[email protected]
94+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
9895
with:
99-
sdk: 10.0.17763.0
96+
sdk: 10.0.20348.0
10097

10198
- name: Install toolchain (Windows)
10299
run: |
@@ -151,7 +148,7 @@ jobs:
151148
shell: bash
152149

153150
- name: Cache
154-
uses: actions/cache@v4
151+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
155152
with:
156153
path: sconsCache
157154
key: ${{ runner.os }}-${{ matrix.containerImage }}-${{env.CORTEX_DEPENDENCIES_HASH}}-${{ matrix.buildType }}-${{ github.sha }}
@@ -177,7 +174,7 @@ jobs:
177174
${{ env.PACKAGE_COMMAND }} ${{ env.CORTEX_BUILD_NAME }}.${{env.PACKAGE_EXTENSION}} ${{ env.CORTEX_BUILD_NAME }}
178175
if: matrix.publish
179176

180-
- uses: actions/upload-artifact@v4
177+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
181178
with:
182179
name: ${{ env.CORTEX_BUILD_NAME }}
183180
path: ${{ env.CORTEX_BUILD_NAME }}.${{ env.PACKAGE_EXTENSION }}

.github/workflows/main/options.posix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LIBPATH = libs
1919

2020
PYTHON = deps + "/bin/python"
2121

22-
pythonABIVersion = "3.10"
22+
pythonABIVersion = "3.11"
2323

2424
PYTHON_LINK_FLAGS = "-lpython" + pythonABIVersion
2525

Changes

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33

44

55

6+
10.6.x.x (relative to 10.6.0.1)
7+
========
8+
9+
10+
11+
10.6.0.1 (relative to 10.6.0.0)
12+
========
13+
14+
Fixes
15+
-----
16+
17+
- USDScene : Worked around numerical imprecision when converting between time and UsdTimeCode.
18+
19+
Build
20+
-----
21+
22+
- CI : Updated to GafferHQ/dependencies 10.0.0.
23+
624
10.6.0.0 (relative to 10.5.15.2)
725
========
826

@@ -35,11 +53,19 @@ Breaking Changes
3553
- Removed support for `IECORE_RTLD_GLOBAL` environment variable.
3654
- SmoothSkinningData : Removed, along with all associated Ops and Parameters.
3755

38-
10.5.x.x (relative to 10.5.15.2)
56+
10.5.x.x (relative to 10.5.15.3)
3957
========
4058

4159

4260

61+
10.5.15.3 (relative to 10.5.15.2)
62+
=========
63+
64+
Fixes
65+
-----
66+
67+
- USDScene : Worked around numerical imprecision when converting between time and UsdTimeCode.
68+
4369
10.5.15.2 (relative to 10.5.15.1)
4470
=========
4571

SConstruct

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ SConsignFile()
5757
ieCoreMilestoneVersion = 10 # for announcing major milestones - may contain all of the below
5858
ieCoreMajorVersion = 7 # backwards-incompatible changes
5959
ieCoreMinorVersion = 0 # new backwards-compatible features
60-
ieCorePatchVersion = 0 # bug fixes
60+
ieCorePatchVersion = 1 # bug fixes
6161
ieCoreVersionSuffix = "" # used for alpha/beta releases. Example: "a1", "b2", etc.
6262

6363
###########################################################################################
@@ -1167,46 +1167,47 @@ def pythonVersion( pythonEnv ) :
11671167
universal_newlines = True
11681168
).strip()
11691169

1170-
pythonEnv = env.Clone()
1170+
basePythonEnv = env.Clone()
11711171

11721172
# decide where python is
1173-
if pythonEnv["PYTHON"]=="" :
1173+
if basePythonEnv["PYTHON"]=="" :
11741174
if env["PLATFORM"] == "win32" :
11751175
sys.stderr.write( "ERROR : Python executable path must be set with PYTHON option.\n" )
11761176
Exit( 1 )
11771177
else:
1178-
pythonEnv["PYTHON"] = getPythonConfig( pythonEnv, "--exec-prefix" ) + "/bin/python"
1178+
basePythonEnv["PYTHON"] = getPythonConfig( basePythonEnv, "--exec-prefix" ) + "/bin/python"
11791179

11801180
# run it to determine version
1181-
pythonEnv["PYTHON_VERSION"] = pythonVersion( pythonEnv )
1181+
basePythonEnv["PYTHON_VERSION"] = pythonVersion( basePythonEnv )
11821182

11831183
# get the include path for python if we haven't been told it explicitly
11841184
# Windows does not have python-config so rely the user setting the appropriate options
11851185
if env["PLATFORM"] != "win32" :
1186-
if pythonEnv["PYTHON_INCLUDE_PATH"]=="" :
1187-
pythonEnv["PYTHON_INCLUDE_FLAGS"] = getPythonConfig( pythonEnv, "--includes" ).split()
1186+
if basePythonEnv["PYTHON_INCLUDE_PATH"]=="" :
1187+
basePythonEnv["PYTHON_INCLUDE_FLAGS"] = getPythonConfig( basePythonEnv, "--includes" ).split()
11881188
else :
1189-
pythonEnv["PYTHON_INCLUDE_FLAGS"] = [ systemIncludeArgument, "$PYTHON_INCLUDE_PATH" ]
1189+
basePythonEnv["PYTHON_INCLUDE_FLAGS"] = [ systemIncludeArgument, "$PYTHON_INCLUDE_PATH" ]
11901190

1191-
pythonEnv.Append( CXXFLAGS = "$PYTHON_INCLUDE_FLAGS" )
1191+
basePythonEnv.Append( CXXFLAGS = "$PYTHON_INCLUDE_FLAGS" )
11921192

11931193
if env["PLATFORM"] == "posix" :
11941194
## We really want to not have the -Wno-strict-aliasing flag, but it's necessary to stop boost
11951195
# python warnings that don't seem to be prevented by including boost via -isystem even. Better to
11961196
# be able to have -Werror but be missing one warning than to have no -Werror.
11971197
## \todo This is probably only necessary for specific gcc versions where -isystem doesn't
11981198
# fully work. Reenable when we encounter versions that work correctly.
1199-
pythonEnv.Append( CXXFLAGS = [ "-Wno-strict-aliasing" ] )
1199+
basePythonEnv.Append( CXXFLAGS = [ "-Wno-strict-aliasing" ] )
12001200

12011201
# get the python link flags
1202-
if pythonEnv["PYTHON_LINK_FLAGS"]=="" :
1203-
pythonEnv["PYTHON_LINK_FLAGS"] = getPythonConfig( pythonEnv, "--ldflags" )
1204-
pythonEnv["PYTHON_LINK_FLAGS"] = pythonEnv["PYTHON_LINK_FLAGS"].replace( "Python.framework/Versions/" + pythonEnv["PYTHON_VERSION"] + "/Python", "" )
1202+
if basePythonEnv["PYTHON_LINK_FLAGS"]=="" :
1203+
basePythonEnv["PYTHON_LINK_FLAGS"] = getPythonConfig( basePythonEnv, "--ldflags" )
1204+
basePythonEnv["PYTHON_LINK_FLAGS"] = basePythonEnv["PYTHON_LINK_FLAGS"].replace( "Python.framework/Versions/" + basePythonEnv["PYTHON_VERSION"] + "/Python", "" )
12051205

1206-
pythonEnv.Append( SHLINKFLAGS = pythonEnv["PYTHON_LINK_FLAGS"].split() )
1206+
basePythonEnv.Append( SHLINKFLAGS = basePythonEnv["PYTHON_LINK_FLAGS"].split() )
12071207
else :
1208-
pythonEnv["PYTHON_INCLUDE_FLAGS"] = ""
1208+
basePythonEnv["PYTHON_INCLUDE_FLAGS"] = ""
12091209

1210+
pythonEnv = basePythonEnv.Clone()
12101211
pythonEnv.Append( CPPFLAGS = "-DBOOST_PYTHON_MAX_ARITY=20" )
12111212

12121213
# if BOOST_PYTHON_LIB_SUFFIX is provided, use it
@@ -2066,9 +2067,9 @@ usdEnvSets = {
20662067
"IECORE_NAME" : "IECoreUSD"
20672068
}
20682069

2069-
# We are deliberately cloning from `pythonEnv` rather than
2070+
# We are deliberately cloning from `basePythonEnv` rather than
20702071
# `env` because USD itself has dependencies on Python.
2071-
usdEnv = pythonEnv.Clone( **usdEnvSets )
2072+
usdEnv = basePythonEnv.Clone( **usdEnvSets )
20722073

20732074
if usdEnv["WITH_USD_MONOLITHIC"] :
20742075
usdLibs = [ "usd_ms" ]
@@ -2097,10 +2098,20 @@ else :
20972098
if usdEnv["USD_LIB_PREFIX"] :
20982099
usdLibs = [ usdEnv["USD_LIB_PREFIX"] + x for x in usdLibs ]
20992100

2101+
usdPythonLib = env.subst( "boost_python$BOOST_PYTHON_LIB_SUFFIX" )
2102+
pxrVersionHeader = env.FindFile( "pxr/pxr.h", dependencyIncludes )
2103+
if pxrVersionHeader is not None and "#define PXR_USE_INTERNAL_BOOST_PYTHON\n" in open( str( pxrVersionHeader ) ) :
2104+
usdPythonLib = usdEnv["USD_LIB_PREFIX"] + "python"
2105+
2106+
usdLibs.append( usdPythonLib )
2107+
21002108
usdEnvAppends = {
21012109
"CXXFLAGS" : [
21022110
"-Wno-deprecated" if env["PLATFORM"] != "win32" else "",
21032111
"/Zc:inline-" if env["PLATFORM"] == "win32" else "",
2112+
# This warning is already disabled generally for release builds,
2113+
# but also requires disabling for debug builds with USD.
2114+
"/wd4702" if env["PLATFORM"] == "win32" else "",
21042115
"-DIECoreUSD_EXPORTS",
21052116
systemIncludeArgument, "$USD_INCLUDE_PATH",
21062117
systemIncludeArgument, "$PYTHON_INCLUDE_PATH",

contrib/IECoreUSD/src/IECoreUSD/USDScene.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,28 @@ class USDScene::IO : public RefCounted
715715

716716
pxr::UsdTimeCode timeCode( double timeSeconds ) const
717717
{
718-
return timeSeconds * m_timeCodesPerSecond;
718+
const double timeCode = timeSeconds * m_timeCodesPerSecond;
719+
720+
// It's common for `timeSeconds` to have been converted from a
721+
// `frame` value (by Gaffer's SceneReader for example), and it's
722+
// also common for USD's `timeCodesPerSecond` to match the FPS used
723+
// in the conversion, meaning that integer timecodes correspond to
724+
// integer frames.
725+
//
726+
// But numerical imprecision means that `timeCode` may no longer be
727+
// the exact same integer `frame` we started with. Compute the
728+
// integer version of the timecode, and if it is an equally
729+
// plausible conversion of `timeSeconds`, then prefer it.
730+
//
731+
// This is important because timesamples and value clips are commonly
732+
// placed on integer timecodes, and we want to hit them exactly.
733+
const double integerTimeCode = std::round( timeCode );
734+
if( integerTimeCode / m_timeCodesPerSecond == timeSeconds )
735+
{
736+
return integerTimeCode;
737+
}
738+
739+
return timeCode;
719740
}
720741

721742
// Tags

contrib/IECoreUSD/test/IECoreUSD/USDSceneTest.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,5 +4607,44 @@ def testUsdVolVolumeWithEmptyField( self ) :
46074607
root = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Read )
46084608
self.assertIsNone( root.child( "volume" ).readObject( 0 ) )
46094609

4610+
def testTimeCodeClamping( self ) :
4611+
4612+
fileName = os.path.join( self.temporaryDirectory(), "test.usda" )
4613+
fileName = "test.usda"
4614+
4615+
# Create a stage with a fairly common timesampling setup.
4616+
# TimeCodesPerSecond and FramesPerSecond are equal, so that integer
4617+
# timecodes correspond to whole frames.
4618+
4619+
framesPerSecond = 30.0
4620+
4621+
stage = pxr.Usd.Stage.CreateNew( fileName )
4622+
stage.SetTimeCodesPerSecond( framesPerSecond )
4623+
stage.SetFramesPerSecond( framesPerSecond )
4624+
4625+
# Keyframe a boolean value, alternating on and off each frame.
4626+
4627+
prim = pxr.UsdGeom.Xform.Define( stage, "/child" )
4628+
primVar = pxr.UsdGeom.PrimvarsAPI( prim ).CreatePrimvar( "test", pxr.Sdf.ValueTypeNames.Bool )
4629+
4630+
frameRange = range( 1, 50000 )
4631+
for frame in frameRange :
4632+
primVar.Set( bool( frame % 2 ), frame )
4633+
4634+
stage.GetRootLayer().Save()
4635+
del stage
4636+
4637+
# Read back the values for each frame, asserting they are as expected.
4638+
# Because boolean values can't be interpolated, we have to hit the
4639+
# _exact_ timecode for the frame - if we're under, then we'll get the
4640+
# held value from the previous frame.
4641+
4642+
scene = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Read )
4643+
child = scene.child( "child" )
4644+
4645+
for frame in frameRange :
4646+
timeInSeconds = frame / framesPerSecond
4647+
self.assertEqual( child.readAttribute( "render:test", timeInSeconds ), IECore.BoolData( frame % 2 ) )
4648+
46104649
if __name__ == "__main__":
46114650
unittest.main()

src/IECoreScene/ShaderNetworkAlgo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "boost/container/flat_map.hpp"
5050
#include "boost/regex.hpp"
5151

52+
#include <array>
5253
#include <unordered_map>
5354
#include <unordered_set>
5455

0 commit comments

Comments
 (0)