您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetPrim函数代码示例

51自学网 2021-06-01 21:13:19
  C++
这篇教程C++ GetPrim函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetPrim函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPrim函数的具体用法?C++ GetPrim怎么用?C++ GetPrim使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetPrim函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _GetCollectionPropertyName

UsdRelationship UsdLuxLinkingAPI::_GetExcludesRel(bool create /* =false */) const{    const TfToken &relName = _GetCollectionPropertyName(_tokens->excludes);    return create ? GetPrim().CreateRelationship(relName, /* custom */ false) :                    GetPrim().GetRelationship(relName);}
开发者ID:lvxejay,项目名称:USD,代码行数:7,


示例2: GetPrim

PXR_NAMESPACE_CLOSE_SCOPE// ===================================================================== //// Feel free to add custom code below this line. It will be preserved by// the code generator.//// Just remember to wrap code in the appropriate delimiters:// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.// ===================================================================== //// --(BEGIN CUSTOM CODE)--PXR_NAMESPACE_OPEN_SCOPEUsdGeomPrimvar UsdGeomPrimvarsAPI::CreatePrimvar(const TfToken& attrName,                                const SdfValueTypeName &typeName,                                const TfToken& interpolation,                                int elementSize) const{    const UsdPrim &prim = GetPrim();    UsdGeomPrimvar primvar(prim, attrName, typeName);    if (primvar){        if (!interpolation.IsEmpty())            primvar.SetInterpolation(interpolation);        if (elementSize > 0)            primvar.SetElementSize(elementSize);    }    // otherwise, errors have already been issued    return primvar;}
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:32,


示例3: TRACE_FUNCTION

UsdGeomPrimvar UsdGeomPrimvarsAPI::FindPrimvarWithInheritance(const TfToken &name) const{    TRACE_FUNCTION();    const TfToken attrName = UsdGeomPrimvar::_MakeNamespaced(name);    UsdPrim prim = GetPrim();    if (!prim) {        TF_CODING_ERROR("FindPrimvarWithInheritance called on invalid prim: %s",                         UsdDescribe(prim).c_str());        return UsdGeomPrimvar();    }    UsdGeomPrimvar  localPv = GetPrimvar(name);    if (localPv.HasAuthoredValue()){        return localPv;    }        for (prim = prim.GetParent(); prim && !prim.IsPseudoRoot();         prim = prim.GetParent()) {        UsdAttribute attr = prim.GetAttribute(attrName);        if (attr.HasAuthoredValue()) {            if (UsdGeomPrimvar pv = UsdGeomPrimvar(attr)) {                // Only constant primvars can be inherited.                if (pv.GetInterpolation() == UsdGeomTokens->constant) {                    return pv;                } else {                    // Non-constant interpolation blocks inheritance.                    return UsdGeomPrimvar();                }            }        }    }    return localPv;}
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:34,


示例4: prim

UsdAttributeUsdSchemaBase::_CreateAttr(TfToken const &attrName,                           SdfValueTypeName const & typeName,                           bool custom, SdfVariability variability,                           VtValue const &defaultValue,                            bool writeSparsely) const{    UsdPrim prim(GetPrim());        if (writeSparsely && !custom){        // We are a builtin, and we're trying to be parsimonious.        // We only need to even CREATE a propertySpec if we are        // authoring a non-fallback default value        UsdAttribute attr = prim.GetAttribute(attrName);        VtValue  fallback;        if (defaultValue.IsEmpty() ||            (!attr.HasAuthoredValueOpinion()             && attr.Get(&fallback)             && fallback == defaultValue)){            return attr;        }    }        UsdAttribute attr(prim.CreateAttribute(attrName, typeName,                                           custom, variability));    if (attr && !defaultValue.IsEmpty()) {        attr.Set(defaultValue);    }    return attr;}
开发者ID:MWDD,项目名称:USD,代码行数:31,


示例5: UsdShadeNodeGraph

UsdShadeNodeGraph::InterfaceInputConsumersMapUsdRiMaterialAPI::ComputeInterfaceInputConsumersMap(        bool computeTransitiveConsumers) const{    return UsdShadeNodeGraph(GetPrim())._ComputeInterfaceInputConsumersMap(        computeTransitiveConsumers, _tokens->ri);}
开发者ID:JT-a,项目名称:USD,代码行数:7,


示例6: GetPrim

UsdVolVolume::FieldMapUsdVolVolume::GetFieldPaths() const{    std::map<TfToken, SdfPath> fieldMap;    const UsdPrim &prim = GetPrim();    if (prim) {        std::vector<UsdProperty> fieldProps =            prim.GetPropertiesInNamespace(_tokens->fieldPrefix);        for (const UsdProperty &fieldProp : fieldProps) {            UsdRelationship fieldRel = fieldProp.As<UsdRelationship>();            SdfPathVector targets;            // All relationships starting with "field:" should point to            // UsdVolFieldBase primitives.            if (fieldRel && fieldRel.GetForwardedTargets(&targets)) {                if (targets.size() == 1 &&                     targets.front().IsPrimPath()) {                    fieldMap.emplace(fieldRel.GetBaseName(), targets.front());                }            }        }    }    return fieldMap;}
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:26,


示例7: GetPrim

boolUsdGeomPointInstancer::ActivateAllIds() const{    SdfInt64ListOp  op;    op.SetExplicitItems(std::vector<int64_t>());        return GetPrim().SetMetadata(UsdGeomTokens->inactiveIds, op);}
开发者ID:JT-a,项目名称:USD,代码行数:8,


示例8: UsdGeomPrimvar

UsdGeomPrimvarUsdGeomPrimvarsAPI::GetPrimvar(const TfToken &name) const{    // The getter SHOULD issue an error if 'name' is malformed, which    // _MakeNamespaced() will do for us.    return UsdGeomPrimvar(GetPrim().GetAttribute                           (UsdGeomPrimvar::_MakeNamespaced(name)));}
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:8,


示例9: GetPrim

bool UsdSpecializes::SetSpecializes(const SdfPathVector& items){    // Proxy editor has no clear way of setting explicit items in a single    // call, so instead, just set the field directly.    SdfPathListOp paths;    paths.SetExplicitItems(items);    return GetPrim().SetMetadata(SdfFieldKeys->Specializes, paths);}
开发者ID:mplanck,项目名称:USD,代码行数:9,


示例10: TfStringPrintf

std::stringUsdSkelSkeletonQuery::GetDescription() const{    if(IsValid()) {        return TfStringPrintf(            "UsdSkelSkeletonQuery (skel = <%s>, anim = <%s>)",            GetPrim().GetPath().GetText(),            _animQuery.GetPrim().GetPath().GetText());    }    return "invalid UsdSkelSkeletonQuery";}
开发者ID:rodeofx,项目名称:USD,代码行数:11,


示例11: SdfAbstractDataSpecId

boolUsdProperty::IsAuthored() const{    // Look for the strongest authored property spec.    for (Usd_Resolver res(             &GetPrim().GetPrimIndex()); res.IsValid(); res.NextLayer()) {        if (res.GetLayer()->HasSpec(                SdfAbstractDataSpecId(&res.GetLocalPath(), &_PropName())))            return true;    }    return false;}
开发者ID:lvxejay,项目名称:USD,代码行数:12,


示例12: UsdShadeOutput

UsdShadeOutput UsdRiMaterialAPI::_GetShadeOutput(const UsdAttribute &outputAttr,                                   const TfToken &oldEncodingRelName) const{    if (outputAttr) {        return UsdShadeOutput(outputAttr);    } else if (UsdShadeUtils::ReadOldEncoding()) {        if (UsdRelationship rel = GetPrim().GetRelationship(oldEncodingRelName))        {            return UsdShadeOutput(rel);        }    }    return UsdShadeOutput();}
开发者ID:JT-a,项目名称:USD,代码行数:14,


示例13: surfaceOutput

boolUsdRiMaterialAPI::SetSurfaceSource(const SdfPath &surfacePath) const{    if (UsdShadeUtils::WriteNewEncoding()) {        UsdShadeOutput surfaceOutput(CreateSurfaceAttr());        return UsdShadeConnectableAPI::ConnectToSource(            surfaceOutput, surfacePath.IsPropertyPath() ? surfacePath :                surfacePath.AppendProperty(_tokens->defaultOutputName));    } else if (UsdRelationship surfaceRel = GetPrim().CreateRelationship(                    _tokens->riLookSurface, /*custom*/ false)) {        return surfaceRel.SetTargets(std::vector<SdfPath>{surfacePath});    }    return false;}
开发者ID:JT-a,项目名称:USD,代码行数:14,


示例14: bxdfOutput

boolUsdRiMaterialAPI::SetBxdfSource(const SdfPath &bxdfPath) const{    if (UsdShadeUtils::WriteNewEncoding()) {        UsdShadeOutput bxdfOutput(CreateBxdfAttr());        return UsdShadeConnectableAPI::ConnectToSource(            bxdfOutput, bxdfPath.IsPropertyPath() ?                 bxdfPath :                bxdfPath.AppendProperty(_tokens->defaultOutputName));    } else if (UsdRelationship bxdfRel = GetPrim().CreateRelationship(                    _tokens->riLookBxdf, /*custom*/ false)) {        return bxdfRel.SetTargets(std::vector<SdfPath>{bxdfPath});    }    return false;}
开发者ID:JT-a,项目名称:USD,代码行数:15,


示例15: GetNormalsAttr

boolUsdGeomPointBased::SetNormalsInterpolation(TfToken const &interpolation){    if (UsdGeomPrimvar::IsValidInterpolation(interpolation)){        return GetNormalsAttr().SetMetadata(UsdGeomTokens->interpolation,                                             interpolation);    }    TF_CODING_ERROR("Attempt to set invalid interpolation "                     "/"%s/" for normals attr on prim %s",                     interpolation.GetText(),                     GetPrim().GetPath().GetString().c_str());        return false;}
开发者ID:400dama,项目名称:USD,代码行数:15,


示例16: volumeOutput

boolUsdRiMaterialAPI::SetVolumeSource(const SdfPath &volumePath) const{    if (UsdShadeUtils::WriteNewEncoding()) {        UsdShadeOutput volumeOutput(CreateVolumeAttr());        return UsdShadeConnectableAPI::ConnectToSource(            volumeOutput, volumePath.IsPropertyPath() ?                 volumePath :                volumePath.AppendProperty(_tokens->defaultOutputName));    } else if (UsdRelationship volumeRel = GetPrim().CreateRelationship(                    _tokens->riLookVolume, /*custom*/ false)) {        return volumeRel.SetTargets(std::vector<SdfPath>{volumePath});    }    return false;}
开发者ID:JT-a,项目名称:USD,代码行数:15,


示例17: displacementOutput

boolUsdRiMaterialAPI::SetDisplacementSource(const SdfPath &displacementPath) const{    if (UsdShadeUtils::WriteNewEncoding()) {        UsdShadeOutput displacementOutput(CreateDisplacementAttr());        return UsdShadeConnectableAPI::ConnectToSource(            displacementOutput, displacementPath.IsPropertyPath() ?                 displacementPath :                displacementPath.AppendProperty(_tokens->defaultOutputName));    } else if (UsdRelationship displacementRel = GetPrim().CreateRelationship(                    _tokens->riLookDisplacement, /*custom*/ false)) {        return displacementRel.SetTargets(            std::vector<SdfPath>{displacementPath});    }    return false;}
开发者ID:JT-a,项目名称:USD,代码行数:16,


示例18: TRACE_FUNCTION

boolUsdSkelSkeletonQuery::ComputeJointWorldTransforms(VtMatrix4dArray* xforms,                                                  UsdGeomXformCache* xfCache,                                                  bool atRest) const{    TRACE_FUNCTION();    if (!xfCache) {        TF_CODING_ERROR("'xfCache' pointer is null.");        return false;    }        VtMatrix4dArray localXforms;    if (ComputeJointLocalTransforms(&localXforms, xfCache->GetTime(), atRest)) {        const auto& topology = _definition->GetTopology();        GfMatrix4d rootXform = xfCache->GetLocalToWorldTransform(GetPrim());        return UsdSkelConcatJointTransforms(topology, localXforms,                                            xforms, &rootXform);    }    return false;}
开发者ID:rodeofx,项目名称:USD,代码行数:22,



注:本文中的GetPrim函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetPriorityClass函数代码示例
C++ GetPositionZ函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。