[Bf-blender-cvs] [716f31a93da] usd-importer-T81257-merge: USD Import: fixed warnings.
makowalski
noreply at git.blender.org
Fri Apr 16 03:44:28 CEST 2021
Commit: 716f31a93da55580c1504f975fd941ec86b78f91
Author: makowalski
Date: Thu Apr 15 19:10:23 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rB716f31a93da55580c1504f975fd941ec86b78f91
USD Import: fixed warnings.
Removed unused function and now calling UncheckedGet() to
query shader diffuse color.
===================================================================
M source/blender/io/usd/intern/usd_reader_material.cc
===================================================================
diff --git a/source/blender/io/usd/intern/usd_reader_material.cc b/source/blender/io/usd/intern/usd_reader_material.cc
index 790b87d1bdf..b09f1ed1caa 100644
--- a/source/blender/io/usd/intern/usd_reader_material.cc
+++ b/source/blender/io/usd/intern/usd_reader_material.cc
@@ -112,21 +112,6 @@ static void link_nodes(
nodeAddLink(ntree, source, source_socket, dest, dest_socket);
}
-static pxr::UsdShadeShader get_source_shader(const pxr::UsdShadeConnectableAPI &source,
- const pxr::TfToken in_shader_id)
-{
- if (source && source.GetPrim().IsA<pxr::UsdShadeShader>()) {
- pxr::UsdShadeShader source_shader(source.GetPrim());
- if (source_shader) {
- pxr::TfToken shader_id;
- if (source_shader.GetShaderId(&shader_id) && shader_id == in_shader_id) {
- return source_shader;
- }
- }
- }
- return pxr::UsdShadeShader();
-}
-
// Returns true if the given shader may have opacity < 1.0, based
// on heuristics. Also returns the shader's opacityThreshold input
// in r_opacity_threshold, if this input has an authored value.
@@ -219,7 +204,7 @@ void set_viewport_material_props(Material *mtl, const pxr::UsdShadeShader &usd_p
pxr::VtValue val;
if (diffuse_color_input.GetAttr().HasAuthoredValue() &&
diffuse_color_input.GetAttr().Get(&val) && val.IsHolding<pxr::GfVec3f>()) {
- pxr::GfVec3f color = val.Get<pxr::GfVec3f>();
+ pxr::GfVec3f color = val.UncheckedGet<pxr::GfVec3f>();
mtl->r = color[0];
mtl->g = color[1];
mtl->b = color[2];
More information about the Bf-blender-cvs
mailing list