Skip to content

Commit c4d5cac

Browse files
committed
Merge branch 'RB-10.4' into main
2 parents 38d1eb1 + 98eb5b8 commit c4d5cac

File tree

12 files changed

+226
-83
lines changed

12 files changed

+226
-83
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
os: windows-2019
7171
buildType: RELEASE
7272
options: .github/workflows/main/options.windows
73-
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.2.0/gafferDependencies-6.2.0-Python3-windows.zip
73+
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.2.1/gafferDependencies-6.2.1-Python3-windows.zip
7474
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
7575
publish: true
7676

Changes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
10.4.5.0 (relative to 10.4.4.0)
2+
========
3+
4+
Improvements
5+
------------
6+
7+
- CurvesAlgo, MeshAlgo, PointsAlgo : `resamplePrimitiveVariable()` now supports all data types when resampling a `Constant` primitive variable.
8+
9+
Build
10+
-----
11+
12+
- Update Windows release build dependencies to 6.2.1.
13+
- Added compatibility with OpenImageIO 2.4.
14+
115
10.4.4.0 (relative to 10.4.3.1)
216
========
317

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ SConsignFile()
5656

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

config/installDependencies.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@
9696
subprocess.check_output( "7z x %s -o%s -aoa -y" % ( archiveFileName, args.dependenciesDir ) )
9797
# 7z (and zip extractors generally) don't have an equivalent of --strip-components=1
9898
# Copy the files up one directory level to compensate
99-
for p in glob.glob(
100-
os.path.join(
101-
args.dependenciesDir.replace( "/", "\\" ),
102-
os.path.splitext( args.archiveURL.split( "/" )[-1] )[0],
103-
"*"
104-
)
105-
):
99+
extractedPath = os.path.join(
100+
args.dependenciesDir.replace( "/", "\\" ),
101+
os.path.splitext( args.archiveURL.split( "/" )[-1] )[0]
102+
)
103+
for p in glob.glob( os.path.join( extractedPath, "*" ) ):
106104
shutil.move( p, args.dependenciesDir )
105+
os.rmdir( extractedPath )
107106

108107
# Remove all Cortex related files from the package, so there is no conflict
109108
# with the files generated by our build.

include/IECoreScene/private/PrimitiveAlgoUtils.h

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct AverageValueFromVector
117117
}
118118

119119
template<typename T>
120-
IECore::DataPtr operator()( const IECore::TypedData<std::vector<T> > *data, typename std::enable_if<IsArithmeticVectorTypedData<IECore::TypedData<std::vector<T> > >::value>::type *enabler = nullptr )
120+
IECore::DataPtr operator()( const IECore::TypedData<std::vector<T> > *data, typename std::enable_if<IsArithmeticVectorTypedData<IECore::TypedData<std::vector<T> > >::value>::type *enabler = nullptr )
121121
{
122122
const auto &src = data->readable();
123123
if( !src.empty() )
@@ -133,61 +133,42 @@ struct AverageValueFromVector
133133
}
134134
};
135135

136-
137-
inline IECore::DataPtr createArrayData( PrimitiveVariable& primitiveVariable, const Primitive *primitive, PrimitiveVariable::Interpolation interpolation )
136+
struct FillVectorFromValue
138137
{
139-
if ( primitiveVariable.interpolation != PrimitiveVariable::Constant )
140-
return nullptr;
138+
template<typename T>
139+
using IsVectorTypedDataDefined = std::negation< std::is_void< typename IECore::TypedDataTraits< std::vector< T > >::DataHolder > >;
140+
141+
explicit FillVectorFromValue( const size_t len )
142+
: m_len( len )
143+
{}
141144

142-
size_t len = primitive->variableSize( interpolation );
143-
switch( primitiveVariable.data->typeId() )
145+
template< typename T >
146+
IECore::DataPtr operator()( const IECore::GeometricTypedData< T > *data, typename std::enable_if< IsVectorTypedDataDefined< T >::value >::type *enabler = nullptr ) const
144147
{
145-
case IECore::IntDataTypeId:
146-
{
147-
IECore::IntVectorDataPtr newData = new IECore::IntVectorData();
148-
newData->writable().resize( len, static_cast< const IECore::IntData * >( primitiveVariable.data.get() )->readable() );
149-
return newData;
150-
}
151-
break;
152-
case IECore::FloatDataTypeId:
153-
{
154-
IECore::FloatVectorDataPtr newData = new IECore::FloatVectorData();
155-
newData->writable().resize( len, static_cast< const IECore::FloatData * >( primitiveVariable.data.get() )->readable() );
156-
return newData;
157-
}
158-
break;
159-
case IECore::V2fDataTypeId:
160-
{
161-
IECore::V2fVectorDataPtr newData = new IECore::V2fVectorData();
162-
newData->writable().resize( len, static_cast< const IECore::V2fData * >( primitiveVariable.data.get() )->readable() );
163-
return newData;
164-
}
165-
break;
166-
case IECore::V3fDataTypeId:
167-
{
168-
IECore::V3fVectorDataPtr newData = new IECore::V3fVectorData();
169-
newData->writable().resize( len, static_cast< const IECore::V3fData * >( primitiveVariable.data.get() )->readable() );
170-
return newData;
171-
}
172-
break;
173-
case IECore::Color3fDataTypeId:
174-
{
175-
IECore::Color3fVectorDataPtr newData = new IECore::Color3fVectorData();
176-
newData->writable().resize( len, static_cast< const IECore::Color3fData * >( primitiveVariable.data.get() )->readable() );
177-
return newData;
178-
}
179-
break;
180-
case IECore::StringDataTypeId:
181-
{
182-
IECore::StringVectorDataPtr newData = new IECore::StringVectorData();
183-
newData->writable().resize( len, static_cast< const IECore::StringData * >( primitiveVariable.data.get() )->readable() );
184-
return newData;
185-
}
186-
break;
187-
default:
188-
return nullptr;
148+
using VectorT = IECore::GeometricTypedData< std::vector< T > >;
149+
typename VectorT::Ptr newData = new VectorT();
150+
newData->writable().resize( m_len, static_cast< const IECore::GeometricTypedData< T > * >( data )->readable() );
151+
return newData;
189152
}
190-
}
153+
154+
template< typename T >
155+
IECore::DataPtr operator()( const IECore::TypedData< T > *data, typename std::enable_if< IsVectorTypedDataDefined< T >::value >::type *enabler = nullptr ) const
156+
{
157+
using VectorT = IECore::TypedData< std::vector< T > >;
158+
typename VectorT::Ptr newData = new VectorT();
159+
newData->writable().resize( m_len, static_cast< const IECore::TypedData< T > * >( data )->readable() );
160+
return newData;
161+
}
162+
163+
IECore::DataPtr operator()( const IECore::Data *data ) const
164+
{
165+
return nullptr;
166+
}
167+
168+
private:
169+
170+
size_t m_len;
171+
};
191172

192173
/// template to dispatch only primvars which are supported by the SplitTask
193174
/// Numeric & string like arrays, which contain elements which can be added to a std::set

src/IECoreImage/ImageReader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ class ImageReader::Implementation
166166
if( !tiled )
167167
{
168168
return input->read_native_deep_scanlines(
169+
0, // subimage
170+
0, // miplevel
169171
spec->height + spec->y - 1,
170172
spec->height + spec->y,
171173
0, // first deep sample
@@ -186,6 +188,8 @@ class ImageReader::Implementation
186188
// are doing things correctly, and this is an OIIO bug. For the moment, just read in
187189
// the whole image starting from the origin, because this doesn't crash.
188190
return input->read_native_deep_tiles(
191+
0, // subimage
192+
0, // miplevel
189193
spec->x, spec->width + spec->x,
190194
spec->y, spec->height + spec->y,
191195
0, 1, // first deep sample

src/IECoreScene/CurvesAlgo.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,8 @@ void resamplePrimitiveVariable( const CurvesPrimitive *curves, PrimitiveVariable
514514
}
515515
else if ( primitiveVariable.interpolation == PrimitiveVariable::Constant )
516516
{
517-
DataPtr arrayData = Detail::createArrayData(primitiveVariable, curves, interpolation);
518-
if (arrayData)
519-
{
520-
dstData = arrayData;
521-
}
517+
Detail::FillVectorFromValue fn( curves->variableSize( interpolation ) );
518+
dstData = dispatch( srcData.get(), fn );
522519
}
523520
else if ( interpolation == PrimitiveVariable::Uniform )
524521
{

src/IECoreScene/MeshAlgoResample.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ void IECoreScene::MeshAlgo::resamplePrimitiveVariable( const MeshPrimitive *mesh
329329

330330
if ( primitiveVariable.interpolation == PrimitiveVariable::Constant )
331331
{
332-
DataPtr arrayData = Detail::createArrayData(primitiveVariable, mesh, interpolation);
332+
Detail::FillVectorFromValue fn( mesh->variableSize( interpolation ) );
333+
DataPtr arrayData = dispatch( srcData.get(), fn );
333334
if (arrayData)
334335
{
335336
primitiveVariable = PrimitiveVariable(interpolation, arrayData);

src/IECoreScene/PointsAlgo.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,16 @@ void resamplePrimitiveVariable( const PointsPrimitive *points, PrimitiveVariable
257257

258258
if ( primitiveVariable.interpolation == PrimitiveVariable::Constant )
259259
{
260-
261-
DataPtr arrayData = Detail::createArrayData(primitiveVariable, points, interpolation);
260+
Detail::FillVectorFromValue fn( points->variableSize( interpolation ) );
261+
DataPtr arrayData = dispatch( srcData.get(), fn );
262262
if (arrayData)
263263
{
264264
primitiveVariable = PrimitiveVariable(interpolation, arrayData);
265265
}
266266
return;
267267
}
268-
else if( interpolation == PrimitiveVariable::Uniform )
268+
269+
if( interpolation == PrimitiveVariable::Uniform )
269270
{
270271
if( primitiveVariable.interpolation == PrimitiveVariable::Vertex || primitiveVariable.interpolation == PrimitiveVariable::Varying || primitiveVariable.interpolation == PrimitiveVariable::FaceVarying )
271272
{

0 commit comments

Comments
 (0)