File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -769,7 +769,7 @@ class USDComposer {
769769
770770 this . _collectAttributesFromPath ( path , attrs ) ;
771771
772- // Collect overrides from sibling variants
772+ // Collect overrides from sibling variants (when path is inside a variant)
773773 const variantMatch = path . match ( / ^ ( .+ ?) \/ \{ ( \w + ) = ( \w + ) \} \/ ( .+ ) $ / ) ;
774774 if ( variantMatch ) {
775775
@@ -786,6 +786,25 @@ class USDComposer {
786786
787787 }
788788
789+ } else {
790+
791+ // Check for variant overrides at ancestor levels
792+ const parts = path . split ( '/' ) ;
793+ for ( let i = 1 ; i < parts . length - 1 ; i ++ ) {
794+
795+ const ancestorPath = parts . slice ( 0 , i + 1 ) . join ( '/' ) ;
796+ const relativePath = parts . slice ( i + 1 ) . join ( '/' ) ;
797+ const variantPaths = this . _getVariantPaths ( ancestorPath ) ;
798+
799+ for ( const vp of variantPaths ) {
800+
801+ const overridePath = vp + '/' + relativePath ;
802+ this . _collectAttributesFromPath ( overridePath , attrs ) ;
803+
804+ }
805+
806+ }
807+
789808 }
790809
791810 return attrs ;
You can’t perform that action at this time.
0 commit comments