@@ -65,9 +65,7 @@ IECORE_PUSH_DEFAULT_VISIBILITY
6565#include " pxr/usd/usdGeom/scope.h"
6666#include " pxr/usd/usdGeom/tokens.h"
6767#include " pxr/usd/usdGeom/xform.h"
68- #if PXR_VERSION >= 2111
6968#include " pxr/usd/usdLux/lightAPI.h"
70- #endif
7169#include " pxr/usd/usdShade/material.h"
7270#include " pxr/usd/usdShade/materialBindingAPI.h"
7371#include " pxr/usd/usdShade/connectableAPI.h"
@@ -96,10 +94,6 @@ using namespace IECore;
9694using namespace IECoreScene ;
9795using namespace IECoreUSD ;
9896
99- #if PXR_VERSION < 2011
100- #define GetPrimInPrototype GetPrimInMaster
101- #endif
102-
10397namespace
10498{
10599
@@ -262,26 +256,15 @@ void writeSetInternal( const pxr::UsdPrim &prim, const pxr::TfToken &name, const
262256 targets.push_back ( USDScene::toUSD ( *it, /* relative = */ true ) );
263257 }
264258
265- #if PXR_VERSION < 2009
266-
267- pxr::UsdCollectionAPI collection = pxr::UsdCollectionAPI::ApplyCollection ( prim, validNamespacedName ( name ), pxr::UsdTokens->explicitOnly );
268-
269- #else
270-
271259 pxr::UsdCollectionAPI collection = pxr::UsdCollectionAPI::Apply ( prim, validNamespacedName ( name ) );
272260 collection.CreateExpansionRuleAttr ( pxr::VtValue ( pxr::UsdTokens->explicitOnly ) );
273-
274- #endif
275-
276261 collection.CreateIncludesRel ().SetTargets ( targets );
277262}
278263
279264using PrimPredicate = bool (pxr::UsdPrim::*)() const ;
280265boost::container::flat_map<pxr::TfToken, PrimPredicate> g_schemaTypeSetPredicates = {
281266 { pxr::TfToken ( " __cameras" ), &pxr::UsdPrim::IsA<pxr::UsdGeomCamera> },
282- #if PXR_VERSION >= 2111
283267 { pxr::TfToken ( " __lights" ), &pxr::UsdPrim::HasAPI<pxr::UsdLuxLightAPI> },
284- #endif
285268 { pxr::TfToken ( " usd:pointInstancers" ), &pxr::UsdPrim::IsA<pxr::UsdGeomPointInstancer> }
286269};
287270
@@ -1117,12 +1100,10 @@ bool USDScene::hasAttribute( const SceneInterface::Name &name ) const
11171100 pxr::TfToken kind;
11181101 return model.GetKind ( &kind );
11191102 }
1120- #if PXR_VERSION >= 2111
11211103 else if ( name == g_lightAttributeName )
11221104 {
11231105 return m_location->prim .HasAPI <pxr::UsdLuxLightAPI>();
11241106 }
1125- #endif
11261107 else if ( name == g_doubleSidedAttributeName )
11271108 {
11281109 return pxr::UsdGeomGprim ( m_location->prim ).GetDoubleSidedAttr ().HasAuthoredValue ();
@@ -1170,12 +1151,10 @@ void USDScene::attributeNames( SceneInterface::NameList &attrs ) const
11701151 attrs.push_back ( g_kindAttributeName );
11711152 }
11721153
1173- #if PXR_VERSION >= 2111
11741154 if ( m_location->prim .HasAPI <pxr::UsdLuxLightAPI>() )
11751155 {
11761156 attrs.push_back ( g_lightAttributeName );
11771157 }
1178- #endif
11791158
11801159 if ( pxr::UsdGeomGprim ( m_location->prim ).GetDoubleSidedAttr ().HasAuthoredValue () )
11811160 {
@@ -1265,12 +1244,10 @@ ConstObjectPtr USDScene::readAttribute( const SceneInterface::Name &name, double
12651244 pxr::TfToken value; attr.Get ( &value );
12661245 return new StringData ( value.GetString () );
12671246 }
1268- #if PXR_VERSION >= 2111
12691247 else if ( name == g_lightAttributeName )
12701248 {
12711249 return ShaderAlgo::readLight ( pxr::UsdLuxLightAPI ( m_location->prim ), m_root->timeCode ( time ) );
12721250 }
1273- #endif
12741251 else if ( name == g_kindAttributeName )
12751252 {
12761253 pxr::TfToken kind;
@@ -1367,7 +1344,6 @@ void USDScene::writeAttribute( const SceneInterface::Name &name, const Object *a
13671344 }
13681345 else if ( const IECoreScene::ShaderNetwork *shaderNetwork = runTimeCast<const ShaderNetwork>( attribute ) )
13691346 {
1370- #if PXR_VERSION >= 2111
13711347 if ( name == g_lightAttributeName )
13721348 {
13731349 ShaderAlgo::writeLight ( shaderNetwork, m_location->prim );
@@ -1377,10 +1353,6 @@ void USDScene::writeAttribute( const SceneInterface::Name &name, const Object *a
13771353 const auto &[output, purpose] = materialOutputAndPurpose ( name.string () );
13781354 m_materials[purpose][output] = shaderNetwork;
13791355 }
1380- #else
1381- const auto &[output, purpose] = materialOutputAndPurpose ( name.string () );
1382- m_materials[purpose][output] = shaderNetwork;
1383- #endif
13841356 }
13851357 else if ( name.string () == " gaffer:globals" )
13861358 {
@@ -1750,13 +1722,11 @@ void USDScene::attributesHash( double time, IECore::MurmurHash &h ) const
17501722 // Kind can not be animated so no need to update `mightBeTimeVarying`.
17511723 }
17521724
1753- #if PXR_VERSION >= 2111
17541725 if ( m_location->prim .HasAPI <pxr::UsdLuxLightAPI>() )
17551726 {
17561727 mightBeTimeVarying = mightBeTimeVarying || ShaderAlgo::lightMightBeTimeVarying ( pxr::UsdLuxLightAPI ( m_location->prim ) );
17571728 haveAttributes = true ;
17581729 }
1759- #endif
17601730
17611731 auto doubleSidedAttr = pxr::UsdGeomGprim ( m_location->prim ).GetDoubleSidedAttr ();
17621732 if ( doubleSidedAttr && doubleSidedAttr.HasAuthoredValue () )
0 commit comments