@@ -766,6 +766,34 @@ class USDComposer {
766766 _getAttributes ( path ) {
767767
768768 const attrs = { } ;
769+
770+ this . _collectAttributesFromPath ( path , attrs ) ;
771+
772+ // Collect overrides from sibling variants
773+ const variantMatch = path . match ( / ^ ( .+ ?) \/ \{ ( \w + ) = ( \w + ) \} \/ ( .+ ) $ / ) ;
774+ if ( variantMatch ) {
775+
776+ const basePath = variantMatch [ 1 ] ;
777+ const relativePath = variantMatch [ 4 ] ;
778+ const variantPaths = this . _getVariantPaths ( basePath ) ;
779+
780+ for ( const vp of variantPaths ) {
781+
782+ if ( path . startsWith ( vp ) ) continue ;
783+
784+ const overridePath = vp + '/' + relativePath ;
785+ this . _collectAttributesFromPath ( overridePath , attrs ) ;
786+
787+ }
788+
789+ }
790+
791+ return attrs ;
792+
793+ }
794+
795+ _collectAttributesFromPath ( path , attrs ) {
796+
769797 const prefix = path + '.' ;
770798
771799 for ( const attrPath in this . specsByPath ) {
@@ -781,7 +809,6 @@ class USDComposer {
781809
782810 }
783811
784- // Include elementSize for skinning attributes
785812 if ( attrSpec . fields ?. elementSize !== undefined ) {
786813
787814 attrs [ attrName + ':elementSize' ] = attrSpec . fields . elementSize ;
@@ -796,8 +823,6 @@ class USDComposer {
796823
797824 }
798825
799- return attrs ;
800-
801826 }
802827
803828 /**
@@ -830,7 +855,6 @@ class USDComposer {
830855
831856 }
832857
833- // Apply displayColor if no texture/color was set
834858 const displayColor = attrs [ 'primvars:displayColor' ] ;
835859 if ( displayColor && displayColor . length >= 3 ) {
836860
@@ -856,7 +880,6 @@ class USDComposer {
856880
857881 }
858882
859- // Apply displayOpacity for transparency
860883 const displayOpacity = attrs [ 'primvars:displayOpacity' ] ;
861884 if ( displayOpacity && displayOpacity . length >= 1 ) {
862885
0 commit comments