Unity-Technologies / usd-unity-sdk

Integration of Pixar's Universal Scene Description into Unity. UPDATE: This package has been superseded by our new bundle of USD packages. Please see README & link below for further details.
https://forum.unity.com/threads/new-openusd-packages-now-available.1524583/
Apache License 2.0
500 stars 77 forks source link

Exporting with references not available? #379

Closed Mikooman closed 1 year ago

Mikooman commented 1 year ago

Hey everyone,

I am currently testing out the export functionality and was wondering if there is the possibility to export a scene and setup some of the children as references? What I mean is, let's say I have a gameobject that I want to export that looks like this:

Is there a chance to export the whole gameobject in a way, that the created usd file references the spheres as new usd files, instead of creating the meshes directly in only one file?

So the resulting usd file would look something like this:

#usda 1.0

def "GameObject" (
    kind = "gameobject"
)
{
    def Xform "Cube"
    (
        prepend references = @./path/to/Cube.usd@
    )
    {
        #Transform
        matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]

        def Xform "Sphere1"
        (
            prepend references = @./path/to/Sphere1.usd@
        )
        {
            #Transform
            matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (1, 0, 0, 1) )
            uniform token[] xformOpOrder = ["xformOp:transform"]
        }

        def Xform "Sphere2"
        (
            prepend references = @./path/to/Sphere2.usd@
        )
        {
            #Transform
            matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (-1, 0, 0, 1) )
            uniform token[] xformOpOrder = ["xformOp:transform"]
        }
    }
}

And it then creates the referenced usd files as separate files, defining the cube/spheres.

Thanks for your support

vickycl commented 1 year ago

Hey @Mikooman, this isn't something we currently support. It's a great question though, and I'll mark it as an enhancement for planning future export features :)

vickycl commented 1 year ago

Hey! We've moved this feature request to our Roadmap for better internal visibility. If you head over to the Roadmap you can add more detail about your use case (on the 'USD Import ticket') for this feature to help us prioritize as we hope to be able to work on this in the future :)