Intercepting UsdShade sourceAsset with a custom resolver

   2168   1   1
User Avatar
Member
9 posts
Joined: 8月 2015
オフライン
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
スタッフ
4557 posts
Joined: 7月 2005
オフライン
I think the only way to do that would be by implementing a custom ArResolver.
  • Quick Links