Skip to content

Commit c1e00ba

Browse files
authored
Merge pull request #1327 from johnhaddon/float4FromUSD
USD DataAlgo : Support conversion of `float4` to `Color4f`
2 parents 130cbea + e08e467 commit c1e00ba

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

contrib/IECoreUSD/src/IECoreUSD/DataAlgo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ static const std::map<pxr::TfType, IECore::DataPtr (*)( const pxr::VtValue &, Ge
215215
{ TfType::Find<VtArray<GfVec2f>>(), &dataFromArray<GfVec2f> },
216216
{ TfType::Find<GfVec3f>(), &dataFromValue<GfVec3f> },
217217
{ TfType::Find<VtArray<GfVec3f>>(), &dataFromArray<GfVec3f> },
218+
{ TfType::Find<GfVec4f>(), &dataFromValue<GfVec4f> },
219+
{ TfType::Find<VtArray<GfVec4f>>(), &dataFromArray<GfVec4f> },
218220
{ TfType::Find<GfVec2d>(), &dataFromValue<GfVec2d> },
219221
{ TfType::Find<VtArray<GfVec2d>>(), &dataFromArray<GfVec2d> },
220222
{ TfType::Find<GfVec3d>(), &dataFromValue<GfVec3d> },

contrib/IECoreUSD/test/IECoreUSD/USDSceneTest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ def testPrimVarTypes ( self ) :
283283
'test_Float2_Scalar_constant' : IECore.V2fData( imath.V2f( 0.1, 0.2 ) ),
284284
'test_Float3_Array_constant' : IECore.V3fVectorData( [imath.V3f( 1.1, 1.2, 1.3 ), imath.V3f( 2.1, 2.2, 2.3 ), imath.V3f( 3.1, 3.2, 3.3 )] ),
285285
'test_Float3_Scalar_constant' : IECore.V3fData( imath.V3f( 0.1, 0.2, 0.3 ) ),
286+
'test_Float4_Array_constant' : IECore.Color4fVectorData( [imath.Color4f( 1.1, 1.2, 1.3, 1.4 ), imath.Color4f( 2.1, 2.2, 2.3, 2.4 ), imath.Color4f( 3.1, 3.2, 3.3, 3.4 )] ),
287+
'test_Float4_Scalar_constant' : IECore.Color4fData( imath.Color4f( 0.1, 0.2, 0.3, 0.4 ) ),
286288
'test_Float_Array_constant' : IECore.FloatVectorData( [0.7, 0.8, 0.9] ),
287289
'test_Float_Scalar_constant' : IECore.FloatData( 0.6 ),
288290
'test_Half_Array_constant' : IECore.HalfVectorData( [0.0999756, 0.199951, 0.300049] ),

0 commit comments

Comments
 (0)