コード例 #1
0
ファイル: specializes.cpp プロジェクト: mplanck/USD
PXR_NAMESPACE_OPEN_SCOPE

// ------------------------------------------------------------------------- //
// UsdSpecializes
// ------------------------------------------------------------------------- //
bool
UsdSpecializes::AddSpecialize(const SdfPath &primPath, UsdListPosition position)
{
    SdfChangeBlock block;
    if (SdfPrimSpecHandle spec = _CreatePrimSpecForEditing()) {
        SdfSpecializesProxy paths = spec->GetSpecializesList();
        switch (position) {
        case UsdListPositionFront:
            paths.Prepend(primPath);
            break;
        case UsdListPositionBack:
            paths.Append(primPath);
            break;
        case UsdListPositionTempDefault:
            if (UsdAuthorOldStyleAdd()) {
                paths.Add(primPath);
            } else {
                paths.Prepend(primPath);
            }
            break;
        }
        return true;
    }
    return false;
}
コード例 #2
0
ファイル: specializes.cpp プロジェクト: mplanck/USD
bool
UsdSpecializes::ClearSpecializes()
{
    SdfChangeBlock block;
    if (SdfPrimSpecHandle spec = _CreatePrimSpecForEditing()) {
        SdfSpecializesProxy paths = spec->GetSpecializesList();
        return paths.ClearEdits();
    }
    return false;
}
コード例 #3
0
ファイル: inherits.cpp プロジェクト: JT-a/USD
bool
UsdInherits::ClearInherits()
{
    SdfChangeBlock block;
    if (SdfPrimSpecHandle spec = _CreatePrimSpecForEditing()) {
        SdfInheritsProxy inhs = spec->GetInheritPathList();
        return inhs.ClearEdits();
    }
    return false;
}
コード例 #4
0
ファイル: specializes.cpp プロジェクト: mplanck/USD
bool
UsdSpecializes::RemoveSpecialize(const SdfPath &primPath)
{
    SdfChangeBlock block;
    if (SdfPrimSpecHandle spec = _CreatePrimSpecForEditing()) {
        SdfSpecializesProxy paths = spec->GetSpecializesList();
        paths.Remove(primPath);
        return true;
    }
    return false;
}
コード例 #5
0
ファイル: inherits.cpp プロジェクト: JT-a/USD
bool
UsdInherits::RemoveInherit(const SdfPath &primPath)
{
    SdfChangeBlock block;
    if (SdfPrimSpecHandle spec = _CreatePrimSpecForEditing()) {
        SdfInheritsProxy inhs = spec->GetInheritPathList();
        inhs.Remove(primPath);
        return true;
    }
    return false;
}
コード例 #6
0
ファイル: inherits.cpp プロジェクト: JT-a/USD
PXR_NAMESPACE_OPEN_SCOPE

// ------------------------------------------------------------------------- //
// UsdInherits
// ------------------------------------------------------------------------- //
bool
UsdInherits::AppendInherit(const SdfPath &primPath)
{
    SdfChangeBlock block;
    if (SdfPrimSpecHandle spec = _CreatePrimSpecForEditing()) {
        SdfInheritsProxy inhs = spec->GetInheritPathList();
        inhs.Add(primPath);
        return true;
    }
    return false;
}