Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion convert/converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void Converter::CreateDebugBoneMesh(const SdfPath& parent_path,
material_path.AppendElementString("pbr_shader");
UsdShadeShader pbr_shader = UsdShadeShader::Define(stage, pbr_shader_path);
pbr_shader.CreateIdAttr(VtValue(kTokPreviewSurface));
usd_material.CreateSurfaceOutput().ConnectToSource(pbr_shader, kTokSurface);
usd_material.CreateSurfaceOutput().ConnectToSource(pbr_shader.ConnectableAPI(), kTokSurface);
pbr_shader.CreateInput(kTokInputUseSpecular, SdfValueTypeNames->Int).Set(1);
pbr_shader.CreateInput(kTokInputSpecularColor, SdfValueTypeNames->Color3f)
.Set(kColorBlack);
Expand Down
16 changes: 8 additions & 8 deletions convert/materializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const Materializer::Value& Materializer::FindOrCreate(Gltf::Id material_id) {
UsdShadeShader pbr_shader =
UsdShadeShader::Define(cc_->stage, pbr_shader_path);
pbr_shader.CreateIdAttr(VtValue(kTokPreviewSurface));
value.material.CreateSurfaceOutput().ConnectToSource(pbr_shader, kTokSurface);
value.material.CreateSurfaceOutput().ConnectToSource(pbr_shader.ConnectableAPI(), kTokSurface);

if (material.unlit) {
AttachUnlitTextureInputs(
Expand Down Expand Up @@ -241,7 +241,7 @@ UsdShadeShader Materializer::CreateTextureShader(
const auto uvset_found = uvsets.find(uvset_index);
UFG_ASSERT_LOGIC(uvset_found != uvsets.end());
tex.CreateInput(kTokSt, SdfValueTypeNames->Float2)
.ConnectToSource(uvset_found->second.shader, kTokResult);
.ConnectToSource(uvset_found->second.shader.ConnectableAPI(), kTokResult);

// Set sampler states.
Gltf::Sampler::WrapMode wrap_s =
Expand Down Expand Up @@ -331,7 +331,7 @@ template <typename Vec>void Materializer::AttachTextureInputTo(
.Set(ToVec4(scale));
}
tex.CreateOutput(connect_tok, output_type);
in.ConnectToSource(tex, connect_tok);
in.ConnectToSource(tex.ConnectableAPI(), connect_tok);
}


Expand Down Expand Up @@ -407,7 +407,7 @@ void Materializer::AttachBaseTextureInput(
}
tex.CreateOutput(kTokRgb, SdfValueTypeNames->Float3);
tex.CreateOutput(kTokA, SdfValueTypeNames->Float);
in.ConnectToSource(tex, kTokRgb);
in.ConnectToSource(tex.ConnectableAPI(), kTokRgb);
} else {
in.Set(uvset_valid ? tex_args.scale.ToVec3() : ToVec3(kFallbackBase));
}
Expand All @@ -430,7 +430,7 @@ void Materializer::AttachBaseTextureInput(
// into the texture.
in_opacity.Set(tex_args.opacity);
} else {
in_opacity.ConnectToSource(tex, kTokA);
in_opacity.ConnectToSource(tex.ConnectableAPI(), kTokA);
}
} else {
// The scale alpha value is 1 if we are baking the baseColorFactor into
Expand Down Expand Up @@ -515,7 +515,7 @@ void Materializer::AttachUnlitTextureInputs(
}
tex.CreateOutput(kTokRgb, SdfValueTypeNames->Float3);
tex.CreateOutput(kTokA, SdfValueTypeNames->Float);
emissive_in.ConnectToSource(tex, kTokRgb);
emissive_in.ConnectToSource(tex.ConnectableAPI(), kTokRgb);
} else {
emissive_in.Set(uvset_valid ? tex_args.scale.ToVec3()
: ToVec3(kFallbackBase));
Expand Down Expand Up @@ -561,8 +561,8 @@ void Materializer::AttachUnlitTextureInputs(
}
tex.CreateOutput(kTokRgb, SdfValueTypeNames->Float3);
tex.CreateOutput(kTokA, SdfValueTypeNames->Float);
diffuse_in.ConnectToSource(tex, kTokRgb);
opacity_in.ConnectToSource(tex, kTokA);
diffuse_in.ConnectToSource(tex.ConnectableAPI(), kTokRgb);
opacity_in.ConnectToSource(tex.ConnectableAPI(), kTokA);
} else {
diffuse_in.Set(kColorBlack);
opacity_in.Set(opacity_scale);
Expand Down