Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
751 stars 198 forks source link

maya-usd and primvar-reader #3238

Open cchampet opened 12 months ago

cchampet commented 12 months ago

Hello,

Here at Superprod we are doing the surfacing in Houdini. The result is exported into USD.
And we would like to get the surfacing into Maya (the USDPreviewSurface). This is the case for simple usage (we have the USDPreviewSurface and connected Textures), but not for more complexe cases. Example with a primvar-reader node:

In Houdini I setup something like this:
image

Then I export a USD, and I have something like this:

#usda 1.0
(
    endTimeCode = 1
    framesPerSecond = 24
    metersPerUnit = 1
    startTimeCode = 1
    timeCodesPerSecond = 24
    upAxis = "Y"
)

def Xform "world"
{
    def Xform "geo"
    {
        def Mesh "mesh1" (
            prepend apiSchemas = ["MaterialBindingAPI"]
        )
        {
            rel material:binding = </world/mtl/mat_prv>
            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 Scope "mtl"
    {
        def Material "mat_prv"
        {
            token outputs:displacement.connect = </world/mtl/mat_prv/mat_prv.outputs:displacement>
            token outputs:surface.connect = </world/mtl/mat_prv/mat_prv.outputs:surface>

            def Shader "mat_prv"
            {
                uniform token info:id = "UsdPreviewSurface"
                color3f inputs:diffuseColor.connect = </world/mtl/mat_prv/usdprimvarreader1.outputs:result>
                token outputs:displacement
                token outputs:surface
            }

            def Shader "usdprimvarreader1"
            {
                uniform token info:id = "UsdPrimvarReader_float"
                string inputs:varname = "my_primvar"
                float outputs:result
            }
        }
    }
}

And in Maya, if I import this USD, I have this in the hypershade:
image

The primvar-reader is missing...
Also, the primvar (here my_primvar) is not "translated" into the Maya world. I know that this topic has been discussed in various threads (#896 for example). But I do not know if a direction has been decided about this?
At first, I would expect to find the USDPreviewSurfaces and basic set of nodes into Maya. Do you have any work in progress linked to this?

Thank you all for your amazing work here! Cheers,

Additional context OS centos 7 Maya 2022.3 Maya USD 0.23.0

maya-usd-git-sync[bot] commented 8 months ago

Issue synced internally to EMSUSD-793