mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
1
Composition in TinyUSDZ
Syoyo Fujita edited this page 2023-10-29 22:00:32 +09:00
W.I.P
Currently TinyUSDZ resolves nested composition in breadth-first manner.
for i = 0; i < kMaxIter:
# solve subLayers
# solve inherits
# solve variants
# solve references, payload
# solve specializes
if no unresolved composition item:
break
To support asset path correctly in breadth-first resolver , TinyUSDZ stores current working path(asset's base directory) and asset search path to each PrimSpec.
/build
(workdir)
/test
composition-001.usda
/muda
element.usda
instance.usda
/ari
element.usda
instance.usda
# composition-001.usda
#usda 1.0
def "bora" {
def "dora" ( references = @./muda/element.usda@</Root> ) {
# current working path = ../test/
}
def "jora" ( references = @./ari/element.usda@</Root> ) {
# current working path = ../test/
}
}
# muda/element.usda
#usda 1.0
def "Root" {
def "item" ( payload = @./instance.usda@ ) {
# current working path = ../test/muda/
}
}
# ari/element.usda
#usda 1.0
def "Root" {
def "item" ( payload = @./instance.usda@ ) {
# current working path = ../test/ari/
}
}