Intercepting UsdShade sourceAsset with a custom resolver

   1703   1   1
User Avatar
Member
9 posts
Joined: Aug. 2015
Offline
in LOPS, materials get bound to Karma with:
  def Shader "myMaterial"
        {
            uniform token info:implementationSource = "sourceAsset"
            uniform asset info:sourceAsset = @opdef:/LINK_TO_SOURCE_NODE?ARG_TO_OUTPUT_COMPILED_VEX@
        }
    }

we have USD with materials coming from outside Houdini, all defined with sourceAssetas well. We can write nodes to generate houdini materials for them, and would like to intercept the read of whatever's inside sourceAsset = @THIS_REGION@so we can feed a Hydra renderer with the code output from these nodes. What's more, we would like the sourceAssetto remain unchanged when we re-export this USD.

Is there a way to inject code in the sourceAssetreader that would customize the code being output to Hydra?

Thanks!
User Avatar
Staff
4504 posts
Joined: July 2005
Offline
I think the only way to do that would be by implementing a custom ArResolver.
  • Quick Links