diff options
author | Michael Kowalski <makowalski@nvidia.com> | 2022-03-25 18:29:39 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2022-03-25 18:29:39 +0300 |
commit | c671a26637a7be3dc95cefdfb2cf566d43ef6627 (patch) | |
tree | 56eaaafb48142e85944fa272b0b0827fa6c1bf8b /source/blender/io/usd/intern/usd_writer_material.cc | |
parent | 378022c7973db54f1ad8cf335a9359c3bf27ddb5 (diff) |
USD: Support building against USD 21.11+
For 3.2 USD will be bumped to a newer version with some
slight API changes, however since we cannot simultaneously
land the libs for all platforms as well as these code changes,
we'll have to support both 21.02 and 21.11+ for at least a
short period of time making the code slightly more messy than
it could have been.
Differential Revision: https://developer.blender.org/D14184
Reviewed by: sybren
Diffstat (limited to 'source/blender/io/usd/intern/usd_writer_material.cc')
-rw-r--r-- | source/blender/io/usd/intern/usd_writer_material.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/io/usd/intern/usd_writer_material.cc b/source/blender/io/usd/intern/usd_writer_material.cc index 29ab0479f6e..b548a666ef7 100644 --- a/source/blender/io/usd/intern/usd_writer_material.cc +++ b/source/blender/io/usd/intern/usd_writer_material.cc @@ -163,7 +163,7 @@ void create_usd_preview_surface_material(const USDExporterContext &usd_export_co created_shader = create_usd_preview_shader(usd_export_context, usd_material, input_node); preview_surface.CreateInput(input_spec.input_name, input_spec.input_type) - .ConnectToSource(created_shader, input_spec.source_name); + .ConnectToSource(created_shader.ConnectableAPI(), input_spec.source_name); } else if (input_spec.set_default_value) { /* Set hardcoded value. */ @@ -217,7 +217,7 @@ void create_usd_viewport_material(const USDExporterContext &usd_export_context, shader.CreateInput(usdtokens::metallic, pxr::SdfValueTypeNames->Float).Set(material->metallic); /* Connect the shader and the material together. */ - usd_material.CreateSurfaceOutput().ConnectToSource(shader, usdtokens::surface); + usd_material.CreateSurfaceOutput().ConnectToSource(shader.ConnectableAPI(), usdtokens::surface); } /* Return USD Preview Surface input map singleton. */ @@ -293,12 +293,12 @@ static void create_uvmap_shader(const USDExporterContext &usd_export_context, uv_shader.CreateInput(usdtokens::varname, pxr::SdfValueTypeNames->Token) .Set(pxr::TfToken(uv_set)); usd_tex_shader.CreateInput(usdtokens::st, pxr::SdfValueTypeNames->Float2) - .ConnectToSource(uv_shader, usdtokens::result); + .ConnectToSource(uv_shader.ConnectableAPI(), usdtokens::result); } else { uv_shader.CreateInput(usdtokens::varname, pxr::SdfValueTypeNames->Token).Set(default_uv); usd_tex_shader.CreateInput(usdtokens::st, pxr::SdfValueTypeNames->Float2) - .ConnectToSource(uv_shader, usdtokens::result); + .ConnectToSource(uv_shader.ConnectableAPI(), usdtokens::result); } } @@ -313,7 +313,7 @@ static void create_uvmap_shader(const USDExporterContext &usd_export_context, if (uv_shader.GetPrim().IsValid()) { uv_shader.CreateInput(usdtokens::varname, pxr::SdfValueTypeNames->Token).Set(default_uv); usd_tex_shader.CreateInput(usdtokens::st, pxr::SdfValueTypeNames->Float2) - .ConnectToSource(uv_shader, usdtokens::result); + .ConnectToSource(uv_shader.ConnectableAPI(), usdtokens::result); } } } @@ -488,7 +488,7 @@ static pxr::UsdShadeShader create_usd_preview_shader(const USDExporterContext &u case SH_NODE_BSDF_DIFFUSE: case SH_NODE_BSDF_PRINCIPLED: { shader.CreateIdAttr(pxr::VtValue(usdtokens::preview_surface)); - material.CreateSurfaceOutput().ConnectToSource(shader, usdtokens::surface); + material.CreateSurfaceOutput().ConnectToSource(shader.ConnectableAPI(), usdtokens::surface); break; } |