Exemplo n.º 1
0
bool 
UsdShadeParameter::ConnectToSource(UsdShadeInput const &input) const
{
    UsdShadeConnectableAPI source(input.GetAttr().GetPrim());
    return ConnectToSource(source, input.GetBaseName(),
        /* sourceType */ UsdShadeAttributeType::Input);
}
Exemplo n.º 2
0
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>()));
            }
        }        
    }
}
Exemplo n.º 3
0
Arquivo: output.cpp Projeto: JT-a/USD
bool 
UsdShadeOutput::CanConnect(const UsdShadeInput &sourceInput) const 
{
    return CanConnect(sourceInput.GetAttr());
}