Skip to content

Commit e34cee7

Browse files
committed
Merge branch 'RB-10.4' into main
2 parents d7949ec + b3aa12a commit e34cee7

File tree

14 files changed

+245
-62
lines changed

14 files changed

+245
-62
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
linux-python2,
3434
linux-python2-debug,
3535
linux-python3,
36-
macos-python2
3736
]
3837

3938
include:
@@ -43,7 +42,7 @@ jobs:
4342
buildType: RELEASE
4443
containerImage: ghcr.io/gafferhq/build/build:2.0.0
4544
options: .github/workflows/main/options.posix
46-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-linux.tar.gz
45+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.1.0/gafferDependencies-5.1.0-Python2-linux.tar.gz
4746
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
4847
publish: true
4948

@@ -52,7 +51,7 @@ jobs:
5251
buildType: DEBUG
5352
containerImage: ghcr.io/gafferhq/build/build:2.0.0
5453
options: .github/workflows/main/options.posix
55-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-linux.tar.gz
54+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.1.0/gafferDependencies-5.1.0-Python2-linux.tar.gz
5655
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
5756
publish: false
5857

@@ -61,33 +60,23 @@ jobs:
6160
buildType: RELEASE
6261
containerImage: ghcr.io/gafferhq/build/build:2.0.0
6362
options: .github/workflows/main/options.posix
64-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-linux.tar.gz
63+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.1.0/gafferDependencies-5.1.0-Python3-linux.tar.gz
6564
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
6665
publish: true
6766

68-
- name: macos-python2
69-
os: macos-10.15
70-
buildType: RELEASE
71-
containerImage:
72-
options: .github/workflows/main/options.posix
73-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-osx.tar.gz
74-
# `testAppleseed` currently omitted due to clashes with system image IO frameworks.
75-
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
76-
publish: true
77-
7867
- name: windows-python3
7968
os: windows-2019
8069
buildType: RELEASE
8170
options: .github/workflows/main/options.windows
82-
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.0.0/gafferDependencies-6.0.0-Python3-windows.zip
71+
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.1.0/gafferDependencies-6.1.0-Python3-windows.zip
8372
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
8473
publish: false
8574

8675
- name: windows-python3-debug
8776
os: windows-2019
8877
buildType: RELWITHDEBINFO
8978
options: .github/workflows/main/options.windows
90-
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.0.0/gafferDependencies-6.0.0-Python3-windows.zip
79+
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.1.0/gafferDependencies-6.1.0-Python3-windows.zip
9180
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
9281
publish: false
9382

Changes

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
10.4.2.0 (relative to 10.4.1.2)
2+
========
3+
4+
Improvements
5+
------------
6+
7+
- AlembicScene : Added support for `unsigned char`, `uint16`, `int16` and `uint32` GeomParams, mapping them to and from
8+
`UCharVectorData`, `UShortVectorData`, `ShortVectorData` and `UIntVectorData` PrimitiveVariables respectively (#1297).
9+
- CubicBasis (#1298) :
10+
- Added `Constant` standard basis, for performing stepped interpolation.
11+
- Bound `numCoefficients()` method to Python.
12+
- ShaderNetworkAlgo : Added support for spline parameters with `Constant` basis. These are mapped to the `constant` interpolation type in OSL (#1298).
13+
14+
Fixes
15+
-----
16+
17+
- Spline : Fixed bugs evaluating splines with discontinuities in the basis (#1298).
18+
19+
10.4.1.2 (relative to 10.4.1.1)
20+
========
21+
22+
Build
23+
-----
24+
25+
- Updated to GafferHQ/dependencies 5.1.0 (#1296).
26+
127
10.4.1.1 (relative to 10.4.1.0)
228
========
329

SConstruct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ SConsignFile()
5656

5757
ieCoreMilestoneVersion = 10 # for announcing major milestones - may contain all of the below
5858
ieCoreMajorVersion = 4 # backwards-incompatible changes
59-
ieCoreMinorVersion = 1 # new backwards-compatible features
60-
ieCorePatchVersion = 1 # bug fixes
59+
ieCoreMinorVersion = 2 # new backwards-compatible features
60+
ieCorePatchVersion = 0 # bug fixes
6161
ieCoreVersionSuffix = "" # used for alpha/beta releases. Example: "a1", "b2", etc.
6262

6363
###########################################################################################

contrib/IECoreAlembic/src/IECoreAlembic/PrimitiveReader.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@ void PrimitiveReader::readArbGeomParams( const Alembic::Abc::ICompoundProperty &
7272
IV3dGeomParam p( params, header.getName() );
7373
readGeomParam( p, sampleSelector, primitive );
7474
}
75+
else if( IUcharGeomParam::matches( header ) )
76+
{
77+
IUcharGeomParam p( params, header.getName() );
78+
readGeomParam( p, sampleSelector, primitive );
79+
}
80+
else if( IUInt16GeomParam::matches( header ) )
81+
{
82+
IUInt16GeomParam p( params, header.getName() );
83+
readGeomParam( p, sampleSelector, primitive );
84+
}
85+
else if( IInt16GeomParam::matches( header ) )
86+
{
87+
IInt16GeomParam p( params, header.getName() );
88+
readGeomParam( p, sampleSelector, primitive );
89+
}
90+
else if( IUInt32GeomParam::matches( header ) )
91+
{
92+
IUInt32GeomParam p( params, header.getName() );
93+
readGeomParam( p, sampleSelector, primitive );
94+
}
7595
else if( IInt32GeomParam::matches( header ) )
7696
{
7797
IInt32GeomParam p( params, header.getName() );

contrib/IECoreAlembic/src/IECoreAlembic/PrimitiveWriter.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ void PrimitiveWriter::writeArbGeomParams( const IECoreScene::Primitive *primitiv
101101
case BoolVectorDataTypeId :
102102
writeArbGeomParam<BoolVectorData, OBoolGeomParam>( p.first, p.second, params );
103103
break;
104+
case UCharVectorDataTypeId :
105+
writeArbGeomParam<UCharVectorData, OUcharGeomParam>( p.first, p.second, params );
106+
break;
107+
case UShortVectorDataTypeId :
108+
writeArbGeomParam<UShortVectorData, OUInt16GeomParam>( p.first, p.second, params );
109+
break;
110+
case ShortVectorDataTypeId :
111+
writeArbGeomParam<ShortVectorData, OInt16GeomParam>( p.first, p.second, params );
112+
break;
113+
case UIntVectorDataTypeId :
114+
writeArbGeomParam<UIntVectorData, OUInt32GeomParam>( p.first, p.second, params );
115+
break;
104116
case IntVectorDataTypeId :
105117
writeArbGeomParam<IntVectorData, OInt32GeomParam>( p.first, p.second, params );
106118
break;

contrib/IECoreAlembic/test/IECoreAlembic/AlembicSceneTest.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,5 +2005,40 @@ def testVisibilityAttribute( self ) :
20052005
self.assertNotEqual( child.hash( IECoreScene.SceneInterface.HashType.AttributesHash, 1 ), animatedFrame1Hash )
20062006
self.assertNotEqual( child.hash( IECoreScene.SceneInterface.HashType.AttributesHash, 1 ), withoutHash )
20072007

2008+
def testArbGeomParamTypes( self ) :
2009+
2010+
points = IECoreScene.PointsPrimitive( IECore.V3fVectorData( [ imath.V3f( i ) for i in range( 0, 2 ) ] ) )
2011+
2012+
points["uint8"] = IECoreScene.PrimitiveVariable(
2013+
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
2014+
IECore.UCharVectorData( range( 0, 2 ) )
2015+
)
2016+
points["uint16"] = IECoreScene.PrimitiveVariable(
2017+
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
2018+
IECore.UShortVectorData( range( 0, 2 ) )
2019+
)
2020+
points["int16"] = IECoreScene.PrimitiveVariable(
2021+
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
2022+
IECore.ShortVectorData( range( 0, 2 ) )
2023+
)
2024+
points["uint32"] = IECoreScene.PrimitiveVariable(
2025+
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
2026+
IECore.UIntVectorData( range( 0, 2 ) )
2027+
)
2028+
points["int32"] = IECoreScene.PrimitiveVariable(
2029+
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
2030+
IECore.IntVectorData( range( 0, 2 ) )
2031+
)
2032+
2033+
fileName = os.path.join( self.temporaryDirectory(), "visibilityAttribute.abc" )
2034+
root = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Write )
2035+
root.createChild( "object" ).writeObject( points, 0 )
2036+
del root
2037+
2038+
root = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Read )
2039+
points2 = root.child( "object" ).readObject( 0 )
2040+
for name in points.keys() :
2041+
self.assertEqual( points2[name], points[name] )
2042+
20082043
if __name__ == "__main__":
20092044
unittest.main()

include/IECore/CubicBasis.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ enum class StandardCubicBasis
5050
Linear,
5151
Bezier,
5252
BSpline,
53-
CatmullRom
53+
CatmullRom,
54+
Constant
5455
};
5556

5657
/// Provides a basis matrix class for use in constructing cubic curves.
@@ -142,6 +143,7 @@ class IECORE_EXPORT CubicBasis
142143
static const CubicBasis &bezier();
143144
static const CubicBasis &bSpline();
144145
static const CubicBasis &catmullRom();
146+
static const CubicBasis &constant();
145147

146148
StandardCubicBasis standardBasis() const;
147149
};

include/IECore/CubicBasis.inl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ CubicBasis<T>::CubicBasis( StandardCubicBasis standardBasis )
6464
case StandardCubicBasis::CatmullRom:
6565
*this = CubicBasis<T>::catmullRom();
6666
break;
67+
case StandardCubicBasis::Constant:
68+
*this = CubicBasis<T>::constant();
69+
break;
6770
case StandardCubicBasis::Unknown:
6871
throw IECore::Exception( "CubicBasis::CubicBasis - Invalid basis");
6972
}
@@ -352,6 +355,21 @@ const CubicBasis<T> &CubicBasis<T>::catmullRom()
352355
return m;
353356
}
354357

358+
template<typename T>
359+
const CubicBasis<T> &CubicBasis<T>::constant()
360+
{
361+
static CubicBasis<T> m(
362+
MatrixType(
363+
0, 0, 0, 0,
364+
0, 0, 0, 0,
365+
0, 0, 0, 0,
366+
1, 0, 0, 0
367+
),
368+
1
369+
);
370+
return m;
371+
}
372+
355373
template<typename T>
356374
StandardCubicBasis CubicBasis<T>::standardBasis() const
357375
{
@@ -371,6 +389,10 @@ StandardCubicBasis CubicBasis<T>::standardBasis() const
371389
{
372390
return StandardCubicBasis::CatmullRom;
373391
}
392+
else if( *this == CubicBasis<T>::constant() )
393+
{
394+
return StandardCubicBasis::Constant;
395+
}
374396

375397
return StandardCubicBasis::Unknown;
376398
}

include/IECore/Spline.inl

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,14 @@ inline X Spline<X,Y>::solve( X x, typename PointContainer::const_iterator &segme
128128
// If we hit the end of the points while searching, return the end point of the last valid segment
129129
// this is just a linear search right now - it should be possible to optimise this using points.lower_bound
130130
// to quickly find a better start point for the search.
131-
X co[4];
132-
basis.coefficients( X( 1 ), co );
131+
X endCo[4];
132+
basis.coefficients( X( 1 ), endCo );
133+
X startCo[4];
134+
basis.coefficients( X( 0 ), startCo );
133135
X xp[4] = { X(0), X(0), X(0), X(0) };
134136

135137
segment = points.begin();
138+
It prevSegment = segment;
136139
for( int pointNum = 0;; pointNum += basis.step )
137140
{
138141
It xIt( segment );
@@ -142,8 +145,20 @@ inline X Spline<X,Y>::solve( X x, typename PointContainer::const_iterator &segme
142145
xIt++;
143146
}
144147

145-
if( xp[0] * co[0] + xp[1] * co[1] + xp[2] * co[2] + xp[3] * co[3] > x )
148+
if( xp[0] * endCo[0] + xp[1] * endCo[1] + xp[2] * endCo[2] + xp[3] * endCo[3] > x )
146149
{
150+
// We've crossed the target value, we can stop the search
151+
152+
if( segment != points.begin() && xp[0] * startCo[0] + xp[1] * startCo[1] + xp[2] * startCo[2] + xp[3] * startCo[3] > x )
153+
{
154+
// We've not only crossed the target, we'd already jumped past it at the start of
155+
// this segment... this could happen when there is a discontinuity between segments
156+
// ( ie. for the "constant" basis ). In this case, we want to take the end of the
157+
// previous segment
158+
segment = prevSegment;
159+
return X( 1 );
160+
}
161+
147162
break;
148163
}
149164

@@ -154,6 +169,7 @@ inline X Spline<X,Y>::solve( X x, typename PointContainer::const_iterator &segme
154169
return X( 1 );
155170
}
156171

172+
prevSegment = segment;
157173
for( unsigned i=0; i<basis.step; i++ )
158174
{
159175
segment++;

src/IECorePython/CubicBasisBinding.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ void bindCubicBasis( const char *name )
9898
.def_readwrite( "matrix", &T::matrix )
9999
.def_readwrite( "step", &T::step )
100100
.def( "coefficients", &coefficients<T> )
101+
.def( "numCoefficients", &T::numCoefficients )
101102
.def( "derivativeCoefficients", &derivativeCoefficients<T> )
102103
.def( "integralCoefficients", &integralCoefficients<T> )
103104
.def( "__call__", (BaseType (T::*) ( BaseType, BaseType, BaseType, BaseType, BaseType )const)&T::template operator()<BaseType> )
@@ -121,6 +122,7 @@ void bindCubicBasis( const char *name )
121122
.def( "bezier", &T::bezier, return_value_policy<copy_const_reference>() ).staticmethod( "bezier" )
122123
.def( "bSpline", &T::bSpline, return_value_policy<copy_const_reference>() ).staticmethod( "bSpline" )
123124
.def( "catmullRom", &T::catmullRom, return_value_policy<copy_const_reference>() ).staticmethod( "catmullRom" )
125+
.def( "constant", &T::constant, return_value_policy<copy_const_reference>() ).staticmethod( "constant" )
124126
.def( "standardBasis", &T::standardBasis )
125127
.def( "__repr__", &repr<T> )
126128
;
@@ -135,6 +137,7 @@ void bindCubicBasis()
135137
.value("Bezier", IECore::StandardCubicBasis::Bezier )
136138
.value("BSpline", IECore::StandardCubicBasis::BSpline )
137139
.value("CatmullRom", IECore::StandardCubicBasis::CatmullRom )
140+
.value("Constant", IECore::StandardCubicBasis::Constant )
138141
.export_values()
139142
;
140143

0 commit comments

Comments
 (0)