File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -762,9 +762,9 @@ bool USDScene::hasAttribute( const SceneInterface::Name &name ) const
762762 pxr::TfToken kind;
763763 return model.GetKind ( &kind );
764764 }
765- else if ( AttributeAlgo::findUSDAttribute ( m_location->prim , name.string () ) )
765+ else if ( auto attribute = AttributeAlgo::findUSDAttribute ( m_location->prim , name.string () ) )
766766 {
767- return true ;
767+ return attribute. HasAuthoredValue () ;
768768 }
769769 else
770770 {
@@ -813,6 +813,10 @@ void USDScene::attributeNames( SceneInterface::NameList &attrs ) const
813813 std::vector<pxr::UsdAttribute> attributes = m_location->prim .GetAuthoredAttributes ();
814814 for ( const auto &attribute : attributes )
815815 {
816+ if ( !attribute.HasAuthoredValue () )
817+ {
818+ continue ;
819+ }
816820 IECore::InternedString name = IECoreUSD::AttributeAlgo::cortexAttributeName ( attribute );
817821 if ( name.string ().size () )
818822 {
Original file line number Diff line number Diff line change @@ -2388,6 +2388,7 @@ def assertExpectedAttributes( sphere ) :
23882388 "namespaced:test" ,
23892389 "nonexistent" ,
23902390 "radius" ,
2391+ "test:noAuthoredValue" ,
23912392 ] :
23922393 self .assertFalse ( sphere .hasAttribute ( name ) )
23932394 self .assertIsNone ( sphere .readAttribute ( name , 0 ) )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ def Sphere "sphere"
2323 )
2424 float primvars:arnold:disp_height = 0.5
2525 int primvars:arnold:poly_mesh:subdiv_iterations = 3
26+ custom string[] test:noAuthoredValue
2627}
2728def Xform "a"
2829{
You can’t perform that action at this time.
0 commit comments