Skip to content

Is valid checks if anything exists at a path after composition instead of if an authored spec of the correct kind exists. #15

@NicTanghe

Description

@NicTanghe

I think this changes what thr function is supposed to be used for.
THe c++ impl reads.

bool IsValid() const {
    if (!UsdIsConcrete(_type) || !_prim)
        return false;

    if (_type == UsdTypePrim)
        return true;

    SdfSpecType specType = _GetDefiningSpecType();

    return (_type == UsdTypeAttribute &&
            specType == SdfSpecTypeAttribute) ||
           (_type == UsdTypeRelationship &&
            specType == SdfSpecTypeRelationship);
}
  1. The object must be concrete (not abstract / schema-only)
  2. There must be a defining authored spec
  3. If it’s a Prim → valid immediately
  4. If it’s an Attribute → defining spec must be Attribute
  5. If it’s a Relationship → defining spec must be Relationship

Current

self.stage.prim_index(&self.path).is_some()

seems to not check spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions