bool UsdShadeParameter::ConnectToSource(UsdShadeInput const &input) const { UsdShadeConnectableAPI source(input.GetAttr().GetPrim()); return ConnectToSource(source, input.GetBaseName(), /* sourceType */ UsdShadeAttributeType::Input); }
static void _ExtractPrimvarsFromNode(UsdShadeShader const & shadeNode, HdMaterialNode const & node, HdMaterialNetwork *materialNetwork) { // Check if it is a node that reads primvars. // XXX : We could be looking at more stuff here like manifolds.. if (node.identifier == TfToken("Primvar_3")) { // Extract the primvar name from the usd shade node // and store it in the list of primvars in the network UsdShadeInput nameAttrib = shadeNode.GetInput(TfToken("varname")); if (nameAttrib) { VtValue value; nameAttrib.Get(&value); if (value.IsHolding<std::string>()) { materialNetwork->primvars.push_back( TfToken(value.Get<std::string>())); } } } }
bool UsdShadeOutput::CanConnect(const UsdShadeInput &sourceInput) const { return CanConnect(sourceInput.GetAttr()); }